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. Brad Holden says:

    i_{775} - z_{850} > 1.5

    Its hard not to type the $, ( or [

  2. astropixie says:

    “For a long time I was reluctant to joint the many other sciencey blogs that had integrated equations by providing support for LaTeX”

    heck, my fellow grad student’s advisor remains reluctant to join the many other sciencey folks that had integrated equations using anything other than FORTRAN!!

  3. seriously says:

    W^{h^{e^{e^{e^{e^{e^{e^{e^{e^{e^{e^e}}}}}}}}}}}[tex]  latex W_{h_{o_{o_{o_{o_{o_{o_{o_{o_{o_{o_o}}}}}}}}}}}[tex]

  4. Freiddie says:

    $latex epsilon_{123}=1[tex] Now this should work

  5. Freiddie says:

    epsilon_{123}=1 Now this must work!

  6. Bob Munck 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.

    Really? I thought HAL/S stood for Houston Aerospace Language/Shuttle. It was supported by a Fresh Pond company named Intermetrics (a rival of my own SofTech). I had a little bit to do with re-targeting it to a French CPU, the Metra 4 (I think) when I was working for ESA on Spacelab.

  7. Sean says:

    Okay, here goes nothing:

    \displaystyle \frac{d}{dx}e^x = e^x.

  8. Name (required) says:

    langle langle hat{mathcal{O}} rangle rangle = lim_{t rightarrow infty} frac{1}{t} int_0^t langle psi_s left| hat{cal{O}} right| psi_s rangle ds = mbox{Tr} left( hat{rho} hat{mathcal{O}} right) ,

    hat{rho} = frac{1}{Z} mbox{exp} left( beta hat{H} + sum_{i=2}^n mu_i hat{F}_i right) .

  9. Name (required) says:

    Hmm, seems to evaluate as inline LaTeX for some reason. Maybe it’s the html tags?

    langle langle hat{mathcal{O}} rangle rangle = lim_{t rightarrow infty} frac{1}{t} int_0^t langle psi_s left| hat{cal{O}} right| psi_s rangle ds = mbox{Tr} left( hat{rho} hat{mathcal{O}} right) ,

    hat{rho} = frac{1}{Z} mbox{exp} left( beta hat{H} + sum_{i=2}^n mu_i hat{F}_i right) .

  10. Name (required) says:

    No, still no good. Excuse the debugging,

    frac{1}{2}

    int_0^{infty}

  11. Name (required) says:

    frac{0}{0}

  12. Hmm, looks like Sean’s thinking about the long-term time averages of certain quantities in quantum statistical mechanics. I wonder why?

  13. Sam says:

    e_{pi i}=-1

    second try…

  14. Name (required) says:

    begin{displaymath} int_0^infty frac{1}{x^x} dx end{displaymath}

    $latex begin{displaystyle} frac{1}{pi} int_0^pi cos left( n t – x sin t right) dt end{displaymath}{/tex]

  15. Sam says:

    e^{pi i}=-1

    third try…

  16. Sean says:

    It’s really just “displaystyle”; e.g.

    (tex)sum_{n=0}^infty(/tex)

    (with square brackets instead of parentheses) gives

    sum_{n=0}^infty

    while

    (tex)displaystyle sum_{n=0}^infty(/tex)

    gives

    displaystyle sum_{n=0}^infty

  17. Name (required) says:

    Oh well.

    Hmm, looks like Sean’s thinking about the long-term time averages of certain quantities in quantum statistical mechanics. I wonder why?

    Apparently he’s relating the long-term time average of a pure-state expectation value in the limit trightarrow infty, with the instantaneous exp. value of a mixed state

    langle langle hat{mathcal{O}} rangle rangle = lim_{t rightarrow infty} frac{1}{t} int_0^t langle psi_s left| hat{cal{O}} right| psi_s rangle ds = mbox{Tr} left( hat{rho} hat{mathcal{O}} right) ,

    where rho looks like a partition function, with n-1 funny-looking terms added to the hamiltonian

    hat{rho} = frac{1}{Z} mbox{exp} left( beta hat{H} + sum_{i=2}^n mu_i hat{F}_i right) .

    The last time Sean blogged thermodynamics, it was about Boltzmann brains. Maybe these are quantum Boltzmann brains.

  18. Name (required) says:

    displaystyle{ langle langle hat{mathcal{O}} rangle rangle = lim_{t rightarrow infty} frac{1}{t} int_0^t langle psi_s left| hat{cal{O}} right| psi_s rangle ds = mbox{Tr} left( hat{rho} hat{mathcal{O}} right) , }

    $latex displaystyle{ hat{rho} = frac{1}{Z} mbox{exp} left( beta hat{H} + sum_{i=2}^n mu_i hat{F}_i right) .}

  19. Name (required) says:

    Eureka, it worked!

    displaystyle langle langle hat{mathcal{O}} rangle rangle = lim_{t rightarrow infty} frac{1}{t} int_0^t langle psi_s left| hat{cal{O}} right| psi_s rangle ds = mbox{Tr} left( hat{rho} hat{mathcal{O}} right) ,

    displaystyle hat{rho} = frac{1}{Z} mbox{exp} left( beta hat{H} + sum_{i=2}^n mu_i hat{F}_i right) .

  20. TomR says:

    The electic field of a charge falls of like
    exp(-r/lambda)/r^2, where lambda is the so-called Debye screening length of the plasma.

    The electric field of a charge falls off like e^{-r/lambda}/r^2 where lambda is the so-called Debye screening length of the plasma

  21. TomR says:

    The electic field of a charge falls of like
    exp(-r/lambda)/r^2, where lambda is the so-called Debye screening length of the plasma.

    The electric field of a charge falls off like dfrac{e^{-r/lambda}}{r^2} where lambda is the so-called Debye screening length of the plasma