LaTeXML
LaTeXML is a LaTeX to XML/HTML/MathML Converter
[edit] Overview
(mostly from their web site) LaTeXML is a free program, written in Perl, that attempts to faithfully mimic TeX’s behavior, but produces XML instead of DVI. The document model of the target XML makes explicit the model implied by LaTeX. The processing and model are both extensible; you can define the mapping between TeX constructs and the XML fragments to be created. A postprocessor, latexmlpost converts this XML into other formats such as HTML5 or XHTML, with options to convert the math into MathML (currently only presentation) or images.
[edit] Example
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 will generate HTML (version 4), using images to represent the math.
If you aren't so lucky then you may need to read the manual. Note that this is a good starting point for an ePub 3 document or could be fed to Sigil as an ePub 2 document using the html4 option.
[edit] For more information
- http://dlmf.nist.gov/LaTeXML/
- http://dlmf.nist.gov/LaTeXML/get.html Download LaTeXML and its prerequisites (perl and modules).