# Chapter 2 Using LaTeXML

The main commands provided by the LaTeXML system are

latexml

for converting TeX and BibTeX sources to XML.

latexmlpost

for various postprocessing tasks including conversion to HTML, processing images, conversion to MathML and so on.

latexmlc

combines both latexml and latexmlpost into a single command, with some extra functionality.

The usage of these commands can be as simple as

latexmlc doc.tex --dest=doc.html

to convert a single document into HTML5 document, Or if you want to examine the XML, for some reason (I usually do)

latexml --dest=doc.xml doc ; latexmlpost doc --dest=doc.html

Or can be as complicated as

# Conversion
latexml --dest=main.xml main.tex
latexml --dest=A.xml    A
$\vdots$
# Scan
latexmlpost --prescan --db=my.db --dest=/site/main.html main
latexmlpost --prescan --db=my.db --dest=/site/A.html    A
$\vdots$
# Pagination
latexmlpost --noscan --db=my.db --dest=/site/main.html main
latexmlpost --noscan --db=my.db --dest=/site/A.html    A
$\vdots$

to convert a whole set of documents, including a bibliography, into a complete interconnected site. See 2.4 for details.

How best to use the commands depends, of course, on what you are trying to achieve. In the next section, we’ll describe the use of latexml, which performs the conversion to XML. The following sections consider a sequence of successively more complicated postprocessing situations, using latexmlpost, by which one or more TeX sources can be converted into one or more web documents or a complete site.

The command latexmlc can also create ePub documents:

latexmlc --dest=doc.epub doc

Additionally, there is a convenience command latexmlmath for converting individual formula into various formats.