Last edited by hbghlyj 2025-5-29 05:25tex.stackexchange.com/questions/68916/convert … atex-to-mathjax-html
在命令行执行
make4ht filename.tex "mathjax"
发现有一些不足之处:
tikzcd没有转换成svg,而mathjax也不支持...
解决办法...再执行一次,不加"mathjax"这个参数,将得到的svg图逐个手动插入html
tikz画的图里面的\hyperlink转换后丢失
解决办法...在svg代码中逐个手动插入链接
mathjax不支持intertext见github.com/mathjax/MathJax/issues/736
解决办法:手动逐个将\intertext{TEXT}换成\end{xxx} TEXT \begin{xxx}
脚注会放到不同的文件里
解决办法:用脚本批量合并它们 github.com/michal-h21/make4ht
make4ht -u -f html5+mjcli filename.tex "mathjax" "fn-in"
使用"fn-in"这样就可以把脚注放到同一个html文件里了
其他方法: latexml lwarp Tutorial and working example for mathematics lecture notes that compile to both PDF and HTML - requiring only minimal changes to the original tex
\textnormal command is not supported
Note that \textrm is defined in MathJax as a macro, and it calls on \text internally.
The \textnormal→\textrm does not make much sense for the reasons that \textnormal is more like \text in matching the "surrounding environment" in MathJax.
Mathjax does not recognize \prescript
MathML has a prescripts mechanism using <mmultiscripts> and <mprescripts> so in MathJaX you also have the possibility of directly accessing those rather than relying on conversion from some "standard" LaTeX package markup. You can generate any MatHML element from the TeX MathJax syntax using \mmlToken make \sideset more strict