LaTeXML A LaTeX to XML/HTML/MathML Converter


(November 17, 2020)

If you’re lucky, all that should be needed to convert a TeX file, mydoc.tex to XML, and then to HTML would be:

   latexml --dest=mydoc.xml mydoc
   latexmlpost --dest=somewhere/mydoc.html mydoc.xml

This will carry out a default transformation into HTML5, which represents mathematics using MathML. Using an extension of xhtml would generate XHTML including MathML. Adding the option --format=html4 to the call to latexmlpost will generate HTML (version 4), using images to represent the math.

If you’re not so lucky, or want to get fancy, well …dig deeper:

LaTeXML Manual



describes the latexml command.

latexmlpost command

describes the latexmlpost command for postprocessing.