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$,

   E = mc^2

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


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.