[tex4ht] problems using mathjax mode with siunitx package

Nasser M. Abbasi nma at 12000.org
Sat Dec 29 06:01:58 CET 2018


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.

Here is a MWE



  S  &=  \SI{2775}{\square\ft}


Compiled using

make4ht foo1.tex "htm,mathjax"

It looks like this in HTML


The HTML generated is

<!DOCTYPE html>
<html lang="en-US" xml:lang="en-US" >
<meta  charset="iso-8859-1" />
<meta name="generator" content="TeX4ht (http://www.tug.org/tex4ht/)" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" type="text/css" href="foo1.css" />
<meta name="src" content="foo1.tex" />
  <script type="text/x-mathjax-config"> MathJax.Hub.Config({ 'fast-preview': {disabled: true},
TeX: { extensions: ["color.js","AMSmath.js"], equationNumbers: { autoNumber: "AMS" } },
extensions: ["tex2jax.js"], tex2jax: {  inlineMath: [ ["\\\(","\\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ], processEscapes: true, processEnvironments: true } });
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<!--l. 10--><p class="noindent" >\begin{align*} S &= \SI{2775}{\square \ft } \end{align*}

So mathjax does not know about siunitx.  Other than rewriting all the
latex code so not to use this package, which I really do not want
to do, is there a way to work around this? Is new
configuration needed somewhere? I have other\DeclareSIUnit macros
in the code such as


Using TL 2018
Thank you for any hints how to handle this.


More information about the tex4ht mailing list