Succumbing to LaTeX

Update: The original post below was written as part of Cosmic Variance. Every time you move your blog, stuff like this changes. Here, the way to put something into Latex is to start your comment with the tag

{latexpage}

Except — important! — use square brackets [] rather than curly braces {}. Then anything you put inside dollar signs gets interpreted as a LaTeX math formula, as usual. So

$g_{\mu\nu}$

should show up as

g_{\mu\nu}.

I’m using the QuickLaTeX plugin; more details here.

This stands in marked contrast with the previous system, explained below.

——————————————————-

For a long time I was reluctant to joint the many other sciencey blogs that had integrated equations by providing support for LaTeX, the technical typesetting system that nearly every physicist and mathematician uses. Possible reasons for this attitude include:

  1. We felt it was important to remain accessible to a wide range of readership, and feared that the appearance of equations would put people off (and tempt us into being unnecessarily technical).
  2. It sounded like work.

You can decide for yourself which is more true. The good thing is, there is no wrong answer!

But right now I am uninspired to blog because my brain is preoccupied with real science stuff. So I thought of posting about some of the fun ideas in quantum mechanics I’ve been learning about. But there’s really no way to do it without equations. So for that reason, and in belated honor of Donald Knuth’s birthday, I went and installed the LatexRenderer plugin.

So now it’s easy to include equations; they should even be available in comments. All you have to do is type [ latex ], then your LaTeX commands, then [ /latex ], except no spaces. So for example

[ latex ]R_{\mu\nu}-\frac{1}{2}Rg_{\mu\nu}=8\pi G T_{\mu\nu}[ /latex ],

if you left out the spaces, should produce

R_{\mu\nu}-\frac{1}{2}Rg_{\mu\nu}=8\pi G T_{\mu\nu}.

There are a million online tutorials; try this list of commands to get you started. Use comments to this post to try it out. (Sadly, no preview, so be careful, and this post will remain open for playing around.) One thing I’ve noticed: don’t use linebreaks within the formulas, just put everything on the same line. And use “displaystyle” if you want the look of a set-off (rather than in-line) equation.

200 Comments

200 thoughts on “Succumbing to LaTeX”

  1. Hi, I am still looking for good (and hopefully free) program to convert Word or maybe WPerfect to LaTex. The one I downloaded (Word2tex) seems unable to perform, likely because I just don’t get how to use all those wacky little files. I mean, I just want to rev up a simple click-to-start program (like any other Windows product) to take the Word doc and turn it into a LaTex document (and look at it to be sure it is right) without hassle, any help please? tx

  2. LaTeX. That’s so 20th century. The modern, up-to-date way to support equations is MathML; it’s what all the kids are using these days.

    To be honest, we tried for weeks to get MathML to work on one of the Space Elevator forums, and never succeeded. Your LaTeX renderer is somewhat of a kludge, but one can’t argue with the fact that it works.

    Did you know that one of the programming languages used by NASA for the Space Shuttle software, HAL/S, supported multiple-line statements containing 2-D equations?

  3. $latex nabla^c nabla_c h_{ab} – 2 R^c{}_{ab}{}^d h_{cd} = – 16 pi M int_gamma delta_4(x,z(tau)),u^a(tau)u^b(tau),dtau,$
    $latex nabla^b h_{ab}=O(mu^2)$

  4. Christina, really? It shows up okay for me, both in bloglines and in Google reader. Which feed are you using? Do you usually see images? (Because that’s all they are.) Do you have some weird background color?

  5. Kind of beautiful, in an austere way, don’t you think?

    …and utter gobbledygook to physics and maths illiterates like me 🙂

    Have fun.

  6. I see your density matrices and raise you a unitary operator, stuff that I am thinking about

    $latex ifrac{partial}{partial t} U(t,t’) = H_I(t)U(t,t’)[tex]

  7. $latex epsilon_123=1[tex]
    Does it work?
    Does the first equation with the R_mu_nu in your blog post have anything to do with general relativity?
    And I haven’t got a clue what those “austerely beautiful” equations are, or mean.

  8. Bob, I remember HAL from about an eon ago. Developed at Draper Labs in Cambridge and named for the gentleman who developed much of the Apollo navigation code. You could write a Kalman filter in 2 lines of code using the sub/superscript capability. Very cool. Thanks for reminding me of those days.

  9. Forward slashes on the closing /tex, guys.

    Precision counts!

    $latex epsilon_{123}=1$

    And yes, the first example is Einstein’s equation of general relativity.

  10. Sean, this is fabulous! I’ve been looking for a host that has $latex LaTeX[tex] installed. InMotion may be exactly what I’ve been looking for and may prompt a server switch in the very near future.

Comments are closed.

Scroll to Top