# tex4ht leaving equations unchanged

I'm trying to convert a LaTeX document to a webpage that'll be hosted on a server that's capable of processing and rendering simple TeX equations, but not doing section-level formatting.

So I'm trying to convert the document to HTML using TeX4ht, but leave the equations in the form $my-eq-here$ in the resulting HTML to have the server process them and be able to modify them later. Any ideas on how to accomplish this using TeX4ht?

-

htlatex provides support for jsMath out of the box:

htlatex file "xhtml,jsmath" " -cmozhtf"


If you need output for a different engine, htlatex offers fine control on how math is to be output. In the Q/A section of the manual an example is shown that can be adapted to any use case.

To output the original LaTeX source surrounded by $signs, create a file my.cfg in the same directory as the main .tex file with the following contents: \Preamble{html} \newtoks\eqtoks \def\AltMath#1${\eqtoks{$#1$}%
\HCode{\the\eqtoks}$} \Configure{$}{}{}{\expandafter\AltMath}
\begin{document}
\EndPreamble


Now the command

htlatex file 'my'


produces a HTML file where the all inline equations are represented as their (equivalent) LaTeX source.

You can use the same switches after my as with html. Replace {html} by {xhtml} in my.cfg to get XHTML output.

-