3.6 Math rendering

--math-method=METHOD[:URL]

Specify the method used to display TeX math. The following methods are possible (some take an optional URL, separated from the method name by a colon). The default value is mathml.

plain

Render math using Unicode characters, to the extent possible. When this is not possible, fall back to plain TeX.

mathjax[:URL]

Render math using MathJaX. TeX math will be put between \(...\) (for inline math) or \[...\] (for display math) and wrapped in <span> tags with class math. Then the MathJax JavaScript will render it. The URL should point to the MathJax.js load script. If a URL is not provided, a link to the Cloudflare CDN will be inserted. This method works in HTML and HTML-derived formats.

mathml

Convert TeX math to MathML. MathML is supported natively by the main web browsers and most e-book readers. This option works in HTML and XML formats.

webtex[:URL]

Convert TeX formulas to <img> tags that link to an external script that converts formulas to images. The formula will be URL-encoded and concatenated with the URL provided. For SVG images you can for example use --math-method=webtex:https://latex.codecogs.com/svg.latex?. If no URL is specified, the CodeCogs URL generating PNGs will be used (https://latex.codecogs.com/png.latex?). Note: this method works not just in HTML but in Markdown, which is useful if you’re targeting a version of Markdown without native math support.

katex[:URL]

Use KaTeX to display embedded TeX math in HTML output. The URL is the base URL for the KaTeX library. That directory should contain a katex.min.js and a katex.min.css file. If a URL is not provided, a link to the KaTeX CDN will be inserted. This method works in HTML and HTML-derived formats.

gladtex

Enclose TeX math in <eq> tags in HTML output. The resulting HTML can then be processed by GladTeX to produce SVG images of the typeset formulas and an HTML file with these images embedded.

pandoc -s --math-method=gladtex input.md -o myfile.htex
gladtex -d image_dir myfile.htex
# produces myfile.html and images in image_dir
--mathjax[=URL]

Deprecated. Use --math-method=mathjax[:URL] instead.

--mathml

Deprecated. Use --math-method=mathml instead.

--webtex[=URL]

Deprecated. Use --math-method=webtex[:URL] instead.

--katex[=URL]

Deprecated. Use --math-method=katex[:URL] instead.

--gladtex

Deprecated. Use --math-method=gladtex instead.