The asciimath and latexmath passthrough blocks along with the asciimath and latexmath passthrough macros provide a (backend dependent) mechanism for rendering mathematical formulas. You can use the following math markups:
LaTeX math can be included in documents that are processed by dblatex(1). Example inline formula:
latexmath:[$C = \alpha + \beta Y^{\gamma} + \epsilon$]
For more examples see the AsciiDoc website or the
distributed doc/latexmath.txt
file.
MathJax allows LaTeX Math style formulas to be included
in XHTML documents generated via the AsciiDoc xhtml11 and html5 backends.
This route overcomes several restrictions of the MathML-based approaches,
notably, restricted support of MathML by many mainstream browsers. To enable
MathJax support you must define the mathjax attribute, for example using the
-a mathjax
command-line option. Equations are specified as explained above
using the latexmath passthrough blocks. By default, rendering of equations
with MathJax requires a working internet connection and will thus not work if
you are offline (but it can be configured differently).
LaTeXMathML allows LaTeX Math style formulas to be included in XHTML
documents generated using the AsciiDoc xhtml11 and html5 backends.
AsciiDoc uses the
original
LaTeXMathML by Douglas Woodall. LaTeXMathML is derived from
ASCIIMath and is for users who are more familiar with or prefer
using LaTeX math formulas (it recognizes a subset of LaTeX Math, the
differences are documented on the LaTeXMathML web page). To enable
LaTeXMathML support you must define the latexmath attribute, for
example using the -a latexmath
command-line option. Example inline
formula:
latexmath:[$\sum_{n=1}^\infty \frac{1}{2^n}$]
For more examples see the AsciiDoc website or the
distributed doc/latexmathml.txt
file.
The latexmath macro used to include LaTeX Math in DocBook outputs is not the same as the latexmath macro used to include LaTeX MathML in XHTML outputs. LaTeX Math applies to DocBook outputs that are processed by dblatex and is normally used to generate PDF files. LaTeXMathML is very much a subset of LaTeX Math and applies to XHTML documents. This remark does not apply to MathJax which does not use any of the latexmath macros (but only requires the latexmath passthrough blocks for identification of the equations). |
ASCIIMath formulas can be included in XHTML
documents generated using the xhtml11 and html5 backends. To enable
ASCIIMath support you must define the asciimath attribute, for
example using the -a asciimath
command-line option. Example inline
formula:
asciimath:[`x/x={(1,if x!=0),(text{undefined},if x=0):}`]
For more examples see the AsciiDoc website or the
distributed doc/asciimath.txt
file.
MathML is a low level XML markup for mathematics. AsciiDoc has no macros for MathML but users familiar with this markup could use passthrough macros and passthrough blocks to include MathML in output documents.