[tex4ht] problem using "\" inside verbatim in make4ht mathjax mode

Nasser M. Abbasi nma at 12000.org
Thu Sep 27 02:29:00 CEST 2018

just when I was thinking may be mathjax with make4ht might actually
work, I found new problem.

It seems passing verbatim text to mathjax is tricky. I do not
if this is a mathjax problem or tex4ht.

When compiling this MWE


HW1 \ref{sec:HW1}  & 100\% \\\hline

The HTML shows  this

     HW1 ???  & 100\% \\\hline

It is actually rendering \ref{sec:HW1} as math when
it is inside verbatim!

I put the HTML generated here if you like to see it


Compiled using

make4ht -ulm default -c ./nma_mathjax.cfg foo.tex
         "htm,0,notoc*,p-width,charset=utf-8" " -cunihtf -utf8"


nma_mathjax.cfg is


Using mathjax-latex-4ht downloaded from


Since it is not in tex4ht source yet.

Is there a way to resolve this issue? May be use different
verbatim class when using mathjax than not?

There is no such problem when using make4ht with svg or
png. Only when using mathjax.

This will be a problem if mathjax would look inside verbatim
and try to interpret strings with "\" in them as math, since
I use verbatim alot to put plain latex code in Latex for illustration.


More information about the tex4ht mailing list