Posting mathematical formulae in a Wordpress blog

December 2nd, 2008 at 10:52 pm

When your blog often deals with technical matters, and especially math, it is very useful to be able to post complex mathematical formulae / equations. There’s only so far that you can go with “ASCII-equations” like a^2 + b^2 = c^2. Being able to write \alpha^{2}+\beta^{2}=\gamma^{2} is so much nicer…

Several plugins exist for this in the world of WP. In the “simple” spectrum you can find an interface to PhpMathPublisher. But when it comes to mathematical equations, you can hardly compete with \LaTeX, and while using it is more complex, this is the best path to take if you don’t want to quickly run into limitations. Recall that Latex is used by 90% of academics to publish their papers packed with mathematical equations. The Latex syntax is widely accepted and quite standard among many implementations.

Enter the WP latex plugin. Just install it following the instructions and it will use the web service provided by Wordpress.com to render inline Latex equations into images for you. The images are stored into a local cache which means that once your post was generated and viewed once, the image is static and safe on your server (you can, of course, cancel this feature if you want to).

(Update 25.03.2009: I’ve switched to another plugin, but the rest of this post is still relevant)

The syntax of the plugin is very simple and you can use both inline equations like a^{\varphi (n)} \equiv 1 \pmod{n}, or larger equations centered and on a separate line:

\iiint\limits_V\left(\nabla\cdot\mathbf{F}\right)dV=\iint\limits_{\partial V} \mathbf{F} \cdot \mathbf{n}, dS.

[This is, by the way, Gauss's Divergence Theorem which, I recall, was very useful in Calculus II]

If Wordpress.com ever ceases providing the Latex rendering service you can always switch to another - there are plenty. This is the real power of the Latex standard - many renderers will understand the same syntax.

If this isn’t hard core enough for you, you can always install your own Latex service. mathtex is a CGI script you can install on your server. It will communicate with a locally installed Latex program and an image renderer to generate images from you. The problem is - it’s not very simple to install Latex on a shared hosting account. It’s possible though, and many people have done it. So if you don’t feel “safe” enough using a remote web service for rendering equations, you can always spend some extra effort and roll your own. The WP latex plugin makes it easy to switch services.

By the way, while we’re on the topic of Latex equations, this page is a nice “live preview” AJAX renderer for trying your equations out. And this one holds a comprehensive (albeit ugly) list of mathematical symbols in Latex.

Related posts:

  1. Switched to another WP latex plugin
  2. Upgrading to Wordpress 2.2
  3. Fighting blog and forum spam - a temporary victory
  4. Posting Project Euler solutions in my blog
  5. Migrating to Wordpress

5 Responses to “Posting mathematical formulae in a Wordpress blog”

  1. Kevin DNo Gravatar Says:

    Finally i found this plugin - WP latex plugin! Thanks a lot! I couldn’t figure out how i can post formulas. What i did is i posted small screenshots of formulas from Word :)

  2. PhilipNo Gravatar Says:

    Same Here ! It took quite some time to find this post, but it paid off. Thanks for the plug in and the information. A +

  3. Rory WinstonNo Gravatar Says:

    Eli

    I use a slightly hacked version of the mathtran script to automatically convert marked-up elements to images. Works well. I have an example here:

    http://www.theresearchkitchen.com/blog/archives/109

    Cheers
    Rory

  4. elibenNo Gravatar Says:

    @Rory

    Thanks for the note. It’s a viable alternative, which AFAICS does pretty much the same. Does it have caching, though ?

  5. CraigNo Gravatar Says:

    Best Domain Registry,Website and Prospect Funnel System On The Market.
    http://tinyurl.com/anoj84

Leave a Reply

To post code with preserved formatting, enclose it in `backticks` (even multiple lines)


generic acomplia purchase cialis overnight delivery cheap acomplia online buy generic clomid buy cialis low price viagra without prescription where to buy cialis lowest price levitra where to buy propecia cheap cialis from canada lasix no prescription viagra without rx cheap accutane tablets viagra online without prescription viagra no rx buying cialis online zithromax viagra in uk free cialis cialis us where to buy acomplia find cialis online buy viagra lowest price accutane prescription buy cheap accutane online cialis buy buy generic cialis online acomplia order propecia online lowest price synthroid synthroid without a prescription synthroid online buy propecia online cheap levitra online where to buy levitra cialis online review synthroid prices cialis generic cialis buy drug buy viagra on line viagra pharmacy cialis for order price of levitra zithromax online where to buy synthroid soma generic generic clomid propecia online stores viagra cheap drug cheap generic soma cialis cheap zithromax online cheap order accutane online purchase zithromax online purchase viagra online buy cheap clomid cheap generic propecia zithromax pharmacy online pharmacy cialis cheapest acomplia cost of cialis no prescription viagra free viagra purchase lasix online cialis from india viagra from india order discount cialis soma online stores find no rx cialis cialis no rx required find viagra without prescription approved cialis pharmacy lasix discount