latex2wp: a tool for converting LaTeX to WordPress-ready HTML

Migrating my blog from Blogger to WordPress turned out to be more trouble than I hoped, because WordPress requires a particular syntax for latex, and several hacks I used to make things display nicely on Blogger just garbled things in WordPress. No one thing was actually complicated to migrate, but taken all together it was just tedious.

I ended up using Luca Trevisan’s latex2wp tool, which converts basic latex into HTML ready to be cut and paste into WordPress. This is great because I can now write and store all blog posts in basic latex, and just change the tool as necessary in the future if I need to move site again, or if WordPress changes its syntax, or whatever.

Since I found the tool so useful I decided to put my own tweaked version on github. As additional features, I’ve added

    • installation by pip,
    • a simple commandline entrypoint,
    • support for simple on-the-fly macros defined with \def.

And no doubt I will find myself adding more features as time goes on! Everything can be found at https://github.com/seaneberhard/latex2wp.

Leave a comment