# 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 with

$latex and end with a simple $

This stands in marked contrast with the previous system, explained below, although I think that system should still work.

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

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.

This entry was posted in Blog. Bookmark the permalink.

### 200 Responses to Succumbing to LaTeX

1. Sean says:

Success!

2. Sam says:

[ tex] e_ipi=-1 [ /tex]

$latex e^{PI i} = -1 [tex] 4. Sean says: Shouldn’t have any spaces between the “[” and the “tex” or “tex”. 5. Sean says: And it’s pi, not PI. 6. Big Vlad says: $e^{PI i} = -1$ 7. Julianne says: This has to be the most fabulously geeky comment thread, EVAH! 8. Neil B. says: 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 9. Sean says: Julianne, don’t you mean $epsilonnualphahbar$? 10. HB says: $zeta(1/2+pi^{-e}+i 10^{500} )=0$ 11. Bob Munck says: 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? 12. Not sure if it’s important, but it doesn’t seem to work in the feed. Reading the feed in bloglines, I just got the markup, not the equation. 13. Sam Gralla says: $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,$ $nabla^b h_{ab}=O(mu^2)$ 14. Sam Gralla says: Oh yeah, first try. I’m a winner. 15. Sean says: 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? 16. tacitus says: Kind of beautiful, in an austere way, don’t you think? …and utter gobbledygook to physics and maths illiterates like me 🙂 Have fun. 17. Eugene says: 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]

18. Freiddie says:

$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. 19. Freiddie says:$latex epsilon_{123}=1[tex] Trying again

20. Jerry Boetje says:

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.

21. Sean says:

Forward slashes on the closing /tex, guys.

Precision counts!

$epsilon_{123}=1$

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

22. Helge says:

$latex detbegin{pmatrix} 0 & 1 1 & 0 end{pmatrix} = -1 {tex] sucks. 23. Helge says:$latex detbegin{pmatrix} 0 & 1 1 & 0 end{pmatrix} = -1 [tex]
sucks.

24. Jim says:

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.

25. Jim says:

Huh, I think I got the ending tag wrong (it’s counterintuitive). It should have been $LaTeX$.