Is there any tool that can convert Latex documents to HTML documents, so that all math is presented with MathJax?
(Obviously, it is fairly easy to hack together a quick Perl script that is able to do a crude conversion, but I am interested in a bit more robust solutions — at least it should get all cross-references right automatically.)
Best Answer
Update 07/2020:
The code bellow is not needed anymore. TeX4ht has now full support for the MathJax output. The equivalent of the code bellow is this:
If you want to keep your LaTeX math as plain text, use just:
make4ht
is replacement forhtlatex
that converts to HTML5 and UTF-8 by default, so no special configurations as in the old answer are necessary.Original answer:
You can use
TeX4ht
. It can output math asmathml
which can be then displayed withmathjax
. You can also configurehtml
header to loadmathjax
script frommathjax's cdn
:With this config file, we request to output math as
mathml
, then configurehtml
header so resulting file ishtml5
. Save it as for exampleht5mjlatex.cfg
and then call from command line:or you can use William F. Hammond's script (at bottom of the page)