2 plastex — The Command-Line Interface

While plasTeX makes it possible to parse LaTeX directly from Python code, most people will simply use the supplied command-line interface, plastex. plastex will invoke the parsing processes and apply a specified renderer. By default, plastex will convert to HTML, although this can be changed in the plastex configuration.

Invoking plastex is very simple. To convert a LaTeX document to HTML using all of the defaults, simply type the following at shell prompt.

plastex mylatex.tex

where ‘mylatex.tex’ is the name of your LaTeX file. The LaTeX source will be parsed, all packages will be loaded and macros expanded, and converted to HTML. Hopefully, at this point you will have a lovely set of HTML files that accurately reflect the LaTeX source document. Unfortunately, converting LaTeX to other formats can be tricky, and there are many pitfalls. If you are getting warnings or errors while converting your document, you may want to check the FAQ in the appendix to see if your problem is addressed.

Running plastex with the default options may not give you output exactly the way you had envisioned. Luckily, there are many options that allow you to change the rendering behavior. These options are described in the following section.