TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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:


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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.