Equations on WordPress

WordPress.com just added support for using inline \textrm{\LaTeX{}} [Wikipedia], a freely available protocol for using typesetting and displaying mathematics and other technical information. It is powerful and not too difficult to learn the basics. Equations can now be placed within a paragraph, such as Einstein’s famous and world-changing E=mc^2. Of course, one could use regular HTML to display such an equation (E=mc2), but where \textrm{\LaTeX{}} really shines is for more complex formulas. For instance, the volume of a sphere (using a cylindrical coordinate system) is V=\int_0^{2\pi} \int_0^R \int_{-\sqrt{R^2-r^2}}^{\sqrt{R^2-r^2}} r \, dz \, dr \, d\theta = \frac{4}{3}\pi R^3. This is a very useful feature and I’m quite impressed that WordPress.com has offered it.

Update: WordPress.com has been busy! \textrm{\LaTeX{}} has now been enabled in comments as well. Furthermore, by using the\displaystyle command, one can have the equation display separately on its own line, instead of the vertically compact inline style used above. For instance, the volume equation I previously discussed would be displayed as follows:

\displaystyle V=\int_0^{2\pi} \int_0^R \int_{-\sqrt{R^2-r^2}}^{\sqrt{R^2-r^2}} r \, dz \, dr \, d\theta = \frac{4}{3}\pi R^3

For those unfamiliar with \textrm{\LaTeX{}} , it is really quite easy to learn. For reference, the code I have used here is as follows:

  • $latex \textrm{\LaTeX{}} $
  • $latex E=mc^2 $
  • $latex V=\int_0^{2\pi} \int_0^R \int_{-\sqrt{R^2-r^2}}^{\sqrt{R^2-r^2}} r \, dz \, dr \, d\theta = \frac{4}{3}\pi R^3 $
  • $latex \displaystyle V=\int_0^{2\pi} \int_0^R \int_{-\sqrt{R^2-r^2}}^{\sqrt{R^2-r^2}} r \, dz \, dr \, d\theta = \frac{4}{3}\pi R^3 $

Finally, \textrm{\LaTeX{}} is pronounced with a hard k sound at the end; it comes from the Greek letter Χ (chi). See Wikipedia for more information.

Any questions?

21 thoughts on “Equations on WordPress

  1. and now it works in the comments, too. This will probably force me to finally learn some version of TeX. Took me half an hour to come up with the following, and I couldn’t even get the lower limit under the sigma:

    \overset{\infty} \sum_{n=0} \frac{1}{n!}

    code: $ latex \overset{\infty} \sum_{n=0} \frac{1}{n!} $

  2. Wow, those WordPress people are fast! There are several good websites for explaining the formatting, especially since all we really need is the math stuff.

    The reason you couldn’t get it is because what WordPress seems to be using is only the inline form, not the displayed form. The inline form is more vertically compact. See this demonstration, from The Not So Short Introduction to LaTeX2e (PDF) by Tobias Oetiker, Hubert Partl, Irene Hya, and Elisabeth Schlegl.

  3. It seems that the display style has now been enabled as well. I may have to update my post. So now you can have both:

    \sum_{n=0}^\infty \frac{1}{n!}

    \displaystyle \sum_{n=0}^\infty \frac{1}{n!}

    The code is as follows:

    $latex \sum_{n=0}^\infty \frac{1}{n!} $

    $latex \displaystyle \sum_{n=0}^\infty \frac{1}{n!} $

  4. I’ve got the Short Math Guide for LaTeX by Michael Downes of the AMS open, and am trying to follow the (new for me) coding. I will try yours, thanks.

    This is very cool.

  5. Hmm, I’m not familiar with that work; is it available online?

    The one I linked to is quite good, but it’s long. I only looked at the math-related sections around three-quarters of the way in, but it was very helpful.

    I agree; this gives WordPress.com a significant advantage for those with mathematics-related blogs (as well as several other scientific/technical fields).

  6. Thank you for your comment on my blog. Your equation worked. I had been having some problems with this feature but I guess it just takes some getting used to.

  7. One more comment (very pedantic): according to Knuth, the X in LaTeX is supposed to be pronounced like the ch in Loch, not like a k.

  8. You’re welcome, Pelkabo. And you’re right. I should clarify my post. Cyde, I agree; I’ve already posted a few malformed equations in comments. I’ll submit a feedback here suggesting that such a feature be considered, but I’m still quite pleased at the feature. Jonathan, I look forward to seeing what you’ll post next.

  9. Glad you like it, Ripcurl! Unfortunately, signalssytems, I don’t know offhand how to number equations. I’d suggest reading one of the resources discussed in these comments, or looking for a forum devoted to \textrm{\LaTeX{}} .

Comments are closed.