STEM Formulas
Activating Formulas
Especially in science, adding formulas is essential. AsciiDoc combines simple syntax with high expressiveness for mathematical representations.
Activate the :stem: attribute in the document header:
= My Document
You can choose between two syntax variants:
-
:stem:or:stem: asciimath– simpler, more readable syntax -
:stem: latexmath– more powerful LaTeX syntax
Inserting Formulas
For inline formulas within running text:
Einstein's famous formula stem:[E = mc^2].
Result: Einstein’s famous formula ``E = mc^2``.
For block formulas on their own line:
++++
x = (-b +- sqrt(b^2-4ac))/(2a)
++++
Result:
AsciiMath and LaTeXMath
The default AsciiMath syntax is intuitively readable:
| Input | Meaning |
|---|---|
|
|
x squared |
|
|
Square root of x |
|
|
Fraction a/b |
|
|
Sum from 1 to n |
|
|
Integral from 0 to 1 |
You can mix both syntaxes in the same document. Instead of stem:, simply write asciimath: or latexmath: for individual formulas:
AsciiMath: asciimath:[sum_(i=1)^n i]
LaTeX: latexmath:[\sum_{i=1}^{n} i]
AsciiMath: ``sum_(i=1)^n i``
LaTeX: \(\sum_{i=1}^{n} i\)
The adoc Coach helps you with formula syntax. Write stem in the editor and press ESC for suggestions. |