0

I would like to use tex4ht to convert a LaTeX document to an electronic book format, but rather than MathJaX or MathML, I want all math-mode code to be dumped into the html output between identifying tags. That is, I would like $\alpha$ to appear in the output as $\alpha$, ( \beta ) as $\beta$,

\begin{equation}
   E = mc^2
   \label{eq:Einstein}
 \end{equation}

to appear in the html with the appropriate formatting for the equation number, but the mathematical expression to appear between tags (or some such). In short, I would like tex4ht to take care of formatting into HTML everything in the document except the mathematics, which I will handle separately in a script I run on the html output file.

I found the code

\def\AltMath#1${\eqtoks{<dollar>$#1$</dollar>}% 
   \HCode{\the\eqtoks}$}
\Configure{$}{}{}{\expandafter\AltMath}

which seems to do what I want, and I was able to generalize to handle $$. However, I'm having no luck with \( \) and \[ \] blocks, or with environments such as equation, equation*, etc. I suspect that if I saw how to do these four, the rest would follow fairly easily.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.