Following discussion here, I am able to convert test.md
(containing LaTeX code) to test.html
successfully.
pandoc --toc --standalone --mathjax -f markdown -t html test.md -o test.html
The doc on --mathjax
can be found here:
Use MathJax to display embedded TeX math in HTML output. TeX math will be put between (...) (for inline math) or [...] (for display math) and wrapped in 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.
The option --standalone
is important, without which the LaTeX code can not be rendered correctly.
PS. wrap inline equation like $INLINE EQUATION$
and wrap display equation like $$DISPLAY EQUATION$$
.
\(\)
tags. – Hypogastrium