Pandoc Notes

Personal notes about how to use Pandoc. Though, honestly, their website (https://pandoc.org/) is pretty good and you should just go there.

Markdown to HTML

pandoc input.md -f markdown -t html --table-of-contents -s -o output.html

MathML

echo '$\lim_{n\to\infty}n$' | pandoc --mathml

Outputs:

<p><math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>lim</mo><mrow><mi>n</mi><mo>→</mo><mi>∞</mi></mrow></msub><mi>n</mi></mrow><annotation encoding="application/x-tex">\lim_{n\to\infty}n</annotation></semantics></math></p>

Which looks like: limnn\lim_{n\to\infty}n