View on GitHub

plasTeX

plasTeX is a Python package to convert LaTeX markup to DOM

Welcome to the plasTeX Documentation.

plasTeX is a LaTeX document processing framework written entirely in Python. It currently comes bundled with a HTML5 renderer (including multiple themes), a simple text renderer and several less developped renderers targetting Man pages, DocBook and EPUB, as well as a way to simply dump the document to a generic form of XML. Other renderers can be added by users.

The reference documentation for plasTeX is available in PDF and HTML format. Of course, the original document is written in LaTeX. The PDF version was generated using pdflatex, and the HTML version was generated using plasTeX.

Here is an example LaTeX document converted to HTML using plasTeX. For reference, the PDF version of the document is also available. The HTML document above was generated using the default configuration, but many options can be set, including controlling splitting into multiple files and adding CSS files. Here an alternative render on a single page and loading a couple of CSS tweaks.

plasTeX differs from other tools like LaTeX2HTML , TeX4ht , TtH , etc. in that the parsing and rendering of the document are completely separated. This separation makes it possible to render the document in multiple output formats. It also allows the parser to create a cleaner document object, so that the rendering process is easier.

Since the renderer has complete control over which pieces of the document are rendered, it is possible that the resultant document is structured quite differently than the input document. This object actually allows you to traverse and edit the document tree. It can also be used to collect statistics about the document. The Stacks project is a striking example of using plasTeX's flexibility.

plasTeX Users

If you are interested in who else is using plasTeX, we are keeping a list of the projects that we know of right here. If you are using plasTeX, let us know by opening a GitHub issue so we can post your project's name as well.

Contributing

plasTeX is still maintained but its developpement and maintainance pace are very slow because nobody has much time for it. If you are interested in helping, you should read the documentation for contributors.