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. “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!!

  2. $latex 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]

  3. $latex W^{h^{e^{e^{e^{e^{e^{e^{e^{e^{e^{e^e}}}}}}}}}}}$

    $latex W_{h_{o_{o_{o_{o_{o_{o_{o_{o_{o_{o_o}}}}}}}}}}}$

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

  5. $latex 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 hat{rho} = frac{1}{Z} mbox{exp} left( beta hat{H} + sum_{i=2}^n mu_i hat{F}_i right) . $

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

    $latex 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 hat{rho} = frac{1}{Z} mbox{exp} left( beta hat{H} + sum_{i=2}^n mu_i hat{F}_i right) . $

  7. $latex 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]

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

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

    (with square brackets instead of parentheses) gives

    $latex sum_{n=0}^infty$

    while

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

    gives

    $latex displaystyle sum_{n=0}^infty$

  9. 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 $latex trightarrow infty$, with the instantaneous exp. value of a mixed state

    $latex 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 $latex rho$ looks like a partition function, with n-1 funny-looking terms added to the hamiltonian

    $latex 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.

  10. $latex 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) .}

  11. Eureka, it worked!

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

  12. 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 $latex e^{-r/lambda}/r^2 $ where $latex lambda$ is the so-called Debye screening length of the plasma

  13. 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 $latex dfrac{e^{-r/lambda}}{r^2} $ where $latex lambda$ is the so-called Debye screening length of the plasma

Comments are closed.

Scroll to Top