|
Math
Pandoc extension.
Anything between two $ characters will be treated as TeX math. The opening $ must have a character immediately to its right, while the closing $ must have a character immediately to its left. Thus, $20,000 and $30,000 won’t parse as math. If for some reason you need to enclose text in literal $ characters, backslash-escape them and they won’t be treated as math delimiters.
TeX math will be printed in all output formats. How it is rendered depends on the output format:
- Markdown, LaTeX, Org-Mode, ConTeXt
- It will appear verbatim between
$ characters.
- reStructuredText
- It will be rendered using an interpreted text role
:math: , as described here.
- AsciiDoc
- It will be rendered as
latexmath:[...] .
- Texinfo
- It will be rendered inside a
@math command.
- groff man
- It will be rendered verbatim without
$ ’s.
- MediaWiki
- It will be rendered inside
<math> tags.
- Textile
- It will be rendered inside
<span class="math"> tags.
- RTF, OpenDocument, ODT
- It will be rendered, if possible, using unicode characters, and will otherwise appear verbatim.
- Docbook
- If the
--mathml flag is used, it will be rendered using mathml in an inlineequation or informalequation tag. Otherwise it will be rendered, if possible, using unicode characters.
- Docx
- It will be rendered using OMML math markup.
- HTML, Slidy, Slideous, DZSlides, S5, EPUB
The way math is rendered in HTML will depend on the command-line options selected:
The default is to render TeX math as far as possible using unicode characters, as with RTF, DocBook, and OpenDocument output. Formulas are put inside a span with class="math" , so that they may be styled differently from the surrounding text if needed.
If the --latexmathml option is used, TeX math will be displayed between $ or $$ characters and put in <span> tags with class LaTeX . The LaTeXMathML script will be used to render it as formulas. (This trick does not work in all browsers, but it works in Firefox. In browsers that do not support LaTeXMathML, TeX math will appear verbatim between $ characters.)
If the --jsmath option is used, TeX math will be put inside <span> tags (for inline math) or <div> tags (for display math) with class math . The jsMath script will be used to render it.
If the --mimetex option is used, the mimeTeX CGI script will be called to generate images for each TeX formula. This should work in all browsers. The --mimetex option takes an optional URL as argument. If no URL is specified, it will be assumed that the mimeTeX CGI script is at /cgi-bin/mimetex.cgi .
If the --gladtex option is used, TeX formulas will be enclosed in <eq> tags in the HTML output. The resulting htex file may then be processed by gladTeX, which will produce image files for each formula and an html file with links to these images. So, the procedure is:
pandoc -s --gladtex myfile.txt -o myfile.htex
gladtex -d myfile-images myfile.htex
# produces myfile.html and images in myfile-images
If the --webtex option is used, TeX formulas will be converted 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. If no URL is specified, the Google Chart API will be used (http://chart.apis.google.com/chart?cht=tx&chl= ).
|