[tex4ht] problems using mathjax mode with siunitx package

Michal Hoftich michal.h21 at gmail.com
Sat Jan 5 20:32:38 CET 2019


Hi Nasser,


> I am trying the new mathjax mode with some old latex files
> that make heavy use of \usepackage{siunitx}
>
> None of the siunitx code works in mathjax but works OK
> in lualatex and in png or svg for math with make4ht.

there is a package that tries to emulate Siutnitx for MathJax:

https://github.com/burnpanck/MathJax-siunitx

I was able to require it using the following configuration:

-----
\Preamble{xhtml}
\Configure{@HEAD}{\HCode{\detokenize{
 <script type="text/x-mathjax-config">
 MathJax.Hub.Config({
   tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
   TeX: {extensions: ["[siunitx]/siunitx.js"]}
 });
 MathJax.Ajax.config.path['siunitx']  =
'http://rawgit.com/burnpanck/MathJax-siunitx/master';
 </script>
}}}
\Configure{@HEAD}{\HCode{<script type="text/javascript"
href="https://rawgit.com/burnpanck/MathJax-siunitx/master/examples/select-siunitx-version.js"></script>}}
\begin{document}
\EndPreamble
-----

The issue is that it doesn't seem to support custom units and what is
even worse, the \SI command doesn't seem to work. So the sample you
provided doesn't work, but some simpler stuff do. Look at their
showcase:
https://rawgit.com/burnpanck/MathJax-siunitx/master/examples/siunitx.dtx.html

You can make feature requests on their Github, there is nothing much
else what can be done.

Best regards,
Michal


More information about the tex4ht mailing list