This is updated on January 16, 2019. Using latest texlive, now mathjax is integrated in tex4ht. So the way to use mathjax is as simple as this
make4ht foo.tex "htm,mathjax"
The above is minimal call. My actuall call is this
make4ht -ulm default -e ~/new.mk4 -c ~/nma_mathjax.cfg foo.tex "htm,0,mathjax,notoc*,p-width,charset=utf-8" " -cunihtf -utf8"
Where 0 above is split level, which can be 1 or 2 or 3 and so on.
And nma_mathjax.cfg is
\Preamble{xhtml} %This trick below is to allow using \DeclareGraphicsExtensions %only when the graphics package is loaded. Thanks to Michal Hoftich for %this work around. Updated Oct 10, 2018. \makeatletter \@ifpackageloaded{graphicx}{% ONLY use if graphics package is loaded. \DeclareGraphicsExtensions{.svg,.png} \Configure{Picture}{.svg} %this below to make it resize the SVG image, if it is there, to %what is in the includegraphics. %thanks to @Michael.h21 for this trick \newcommand\emwidth{10} % convert pt to rem \newcommand\CalcRem[1]{\strip@pt\dimexpr(#1)/\emwidth} \Configure{graphics*} {svg} {\Picture[pict]{\csname Gin@base\endcsname.svg \space style="width:\CalcRem{\Gin@req@width}em;" }% \special{t4ht+@File: \csname Gin@base\endcsname.svg} } } {} \makeatother \begin{document} \edef\mymathjaxconf{\detokenize{MathJax.Hub.Config({ TeX: { MAXBUFFER: 40*1024, Macros : { relax: "{}", setlength: ["{}", 2], allowbreak: "{}", }}, });}} \ExplSyntaxOn \regex_replace_all:nnN{ \x{23}\x{23}}{\x{23}}{\mymathjaxconf} \ExplSyntaxOff \Configure{@HEAD}{\HCode{<script type="text/x-mathjax-config"> \mymathjaxconf</script>}} \EndPreamble
And the file new.mk4 is
if mode == "draft" then Make:htlatex {} else Make:htlatex {} Make:htlatex {} Make:htlatex {} end
Remember NOT to use pic-align option in the above. This causes problems with
mathjax. Also notice the extra space in " -cunihtf -utf8"