[Tex/LaTex] LaTeX generated website with TikZ diagrams

htmlonlinetikz-pgf

I am trying to generate my static website with LaTeX to avoid tedious/verbose HTML and underpowered markdown languages.

I know of latex2html and htlatex/TeX4ht for generating documents in the HTML format from LaTeX but neither are working with TikZ.

Does anyone here know how to get the TikZ diagrams working? Any tips on using LaTeX for static websites is also much appreciated.

EDIT: I now generate SVGs from the TikZ diagrams by inserting this line into my latex source:

\def\pgfsysdriver{pgfsys-tex4ht.def}

I like the idea of using SVG because of the resolution independence but I worry about the browser support.

Best Answer

My solution is far from perfect, but it has been simple and good enough for my needs.

I wrote a handout for a programming course using Sphinx (a documentation generator that uses reST as a markup language), and the diagrams using TikZ. The TikZ figures are compiled automatically and converted to PNG when generating the website.

For example, take a look at this page to see how the result looks like.

You can also take a look at the Makefile I use to compile the TikZ figures into PNG (.tex → .pdf using rubber, .pdf → .png using convert)