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.

3 thoughts on “latex2wp: a tool for converting LaTeX to WordPress-ready HTML

  1. Many thanks for this. I just tried it out. While for WP it works perfectly; the HTML version (–html) seems to produce black images. I wanted to use the HTML version in my emails. Would it be possible to fix it by any chance? Many thanks!

    Like

    1. Thanks for trying it out. We can certainly try to make it suit your needs. Let’s continue the conversation on github.

      Like

Leave a comment