Ancora Imparo

17 February 2007

Equations on WordPress

Filed under: mathematics,visualization — Darmok @ 21:04 UTC

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?

About these ads

21 Comments

  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!} $

    Comment by jd2718 — 17 February 2007 @ 23:59 UTC

  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.

    Comment by Darmok — 18 February 2007 @ 00:25 UTC

  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!} $

    Comment by Darmok — 18 February 2007 @ 00:43 UTC

  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.

    Comment by jd2718 — 18 February 2007 @ 02:00 UTC

  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).

    Comment by Darmok — 18 February 2007 @ 06:02 UTC

  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.

    Comment by pelkabo — 20 February 2007 @ 11:40 UTC

  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.

    Comment by pelkabo — 20 February 2007 @ 11:47 UTC

  8. Awe=some

    Too bad there’s no “Preview comment” button. I have no idea what that is actually going to end up looking like.

    Comment by Cyde Weys — 20 February 2007 @ 13:09 UTC

  9. http://www.ams.org/tex/short-math-guide.html

    It was enough to get me started, but I will need, eventually, to look further.

    Jonathan

    Comment by jd2718 — 20 February 2007 @ 20:20 UTC

  10. 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.

    Comment by Darmok — 21 February 2007 @ 07:15 UTC

  11. Let’s see:
    \sum_{n=0}^\infty \frac{1}{n!}

    Comment by Anonymous — 22 August 2007 @ 12:46 UTC

  12. and now for a gratuitous equation

    \displaystyle A^{b^{C^{x^{Y^{s^7-p^{56}}}}}} s=4
    cheers :-)

    Comment by ripcurl3142 — 2 September 2007 @ 09:43 UTC

  13. take 2

    \displaystyle A^{b^{C^{x^{Y^{s^7-p^{56}}}}}}
    :-|

    Comment by ripcurl3142 — 2 September 2007 @ 09:45 UTC

  14. How to have equation numbers in the blog. I mean i want to know how to use \verbatim \begin{equation} ... \end{equation}?

    Comment by signalssystems — 12 September 2007 @ 07:09 UTC

  15. 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{}} .

    Comment by Darmok — 13 September 2007 @ 04:20 UTC

  16. not works on my blog with equation input
    E=mc^2

    Comment by steven — 14 September 2007 @ 04:34 UTC

  17. e^{-x}\ge 1-x, \forall x\in \mathbb{R}. Hope this will work. Thanks in advance :)

    Comment by wenjiajing — 30 October 2007 @ 02:20 UTC

  18. [...] Imparo has a post about it here. No Comments Leave a Commenttrackback addressThere was an error with your comment, please try [...]

    Pingback by WordPress does LaTeX « Paulsmyth’s Weblog — 13 December 2007 @ 10:42 UTC

  19. [...] Here is how to post latex [...]

    Pingback by Just testing out wordpress « Currently Testing out Wordpress — 5 January 2008 @ 15:35 UTC

  20. [...] Equations on WordPress [...]

    Pingback by Дорогие и любимые студенты! « Шпаргалка по матану — 11 April 2009 @ 17:58 UTC

  21. [...] supports basic LaTeX.  This post is just a reminder for myself that it works, and there is even an example post. 37.787752 [...]

    Pingback by LaTeX in WordPress « Minh's math blog — 5 March 2010 @ 04:03 UTC


RSS feed for comments on this post.

The Rubric Theme Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: