LaTeXML A LaTeX to XML/HTML/MathML Converter


In most cases, 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 the default transformation into HTML5, which represents mathematics using MathML. Different file extensions (or the --format option) imply different output formats, including XHTML, HTML4 w/images for math, JATS, TEI. There are also options to split large documents into several pages, or to combine multiple documents into a single site. See the command documentation, below.

The functionality of latexml and latexmlpost are conveniently combined into the single executable latexmlc, without creating the intermediate XML file. The above commands are equivalent to

   latexmlc --dest=somewhere/mydoc.html mydoc

Moreover, latexmlc provides extra functionality such as the creation of ePub documents:

   latexmlc --dest=mydoc.epub mydoc

However, be aware that a future merging and renaming will occur in the not-too-distant future, resulting in a single executable latexml which will combine all functionality.


If you want to dig deeper:

LaTeXML Manual



describes the latexml command.


describes the latexmlpost command for postprocessing.


describes the latexmlc command.