Peeter Joot's (OLD) Blog.

Math, physics, perl, and programming obscurity.


This blog uses (as all hosted blogs do implicitly), the wordpress latex plugin. This allows a limited form of latex use, in posts and in comments by enclosing the latex script in a dollar-“latex”-dollar sequence as in the following

$ latex y = \int x^2 dx$

which (with the space between the dollar and “latex” omitted) shows up as

y = \int x^2 dx

There are a number of restrictions for latex that this plugin uses, most annoying of which is that it must all be in one line.

I ended up writing a script to make “wordpress-latex” from standalone .tex files. After doing so, I found Luca’s wordpress-to-latex script, which I believe a number of wordpress users use. I’ve kept using my script which has a few features relative to Luca’s that I like:

  • I parse the bib references, and include a bibliography section at the end of the post, if there was one in the original latex document.
  • I have a pretty flexible set of regular expressions for simulating latex newcommand’s.  In particular multiple argument commands.  At the time I looked at Luca’s script, he did not have that.  You’ll see that the macro replacements I support are a subset of those in my personal latex macros collection.  It can easily be modified to include others, but it is currently very “Peeter” centric, since I’m very likely the only user of this script.
  • My script can also generate output for physicsforums and wikipedia latex based markdown.
  • I base my equation numbers on those from the .aux outputs of the latex code.

This script is occasionally buggy, and I have to sometimes tweak my wordpress latex after the fact manually.  Should anybody else attempt to use it, please feel free to pass along any comments or feedback.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: