Converting LaTeX to html with PlasTeX
PlasTeX is a Python program that parses tex files and can output to several formats, including html, using MathJax to render mathematics. It has an impressive list of users including the Stacks project, Kerodon, SAS, the Liquid Tensor Experiment, the sphere eversion project, and others. Stacks and Kerodon use gerby in conjunction with plasTeX which in turn uses flask. The most recent plasTeX release was January 2023 (see here).
Installation and usage
You can see roughly what the stock output looks like by going to the liquid tensor link above - it works well on a mobile phone screen too. Once you have it installed, which you can do with pip
or by cloning their github repository and running the setup command (instructions), it’s very simple to use: just
plastex filename.tex
will work. If you add --theme-css blue
to the end of the command above you will get retro-looking drop shadows, as seen on the sphere eversion link above.
You can see which LaTeX packages plasTeX supports by looking in their Packages folder. In particular, you can use tikz: diagrams appear as svg files with their tex source as alt text. Xypic isn’t supported as far as I can tell, nor is the svg package.