Succumbing to LaTeX

Written by

in

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.

Comments

200 responses to “Succumbing to LaTeX”

  1. Brad Holden Avatar
    Brad Holden

    $latex i_{775} – z_{850} > 1.5$

    Its hard not to type the $, ( or [

  2. astropixie Avatar

    “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 Avatar
    seriously

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

  4. seriously Avatar
    seriously

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

  5. Freiddie Avatar

    $latex epsilon_123=1$

  6. Freiddie Avatar

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

  7. Freiddie Avatar

    $latex epsilon_{123}=1$ Now this must work!

  8. Bob Munck Avatar
    Bob Munck

    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.

  9. Sean Avatar

    Okay, here goes nothing:

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

  10. Name (required) Avatar
    Name (required)

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

  11. Name (required) Avatar
    Name (required)

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

  12. Name (required) Avatar
    Name (required)

    No, still no good. Excuse the debugging,

    $latex frac{1}{2}$

    $latex int_0^{infty}$

  13. Name (required) Avatar
    Name (required)

    $latex frac{0}{0}$

  14. efp Avatar
    efp

    $latex pi approx ln 6^{ln 5^{ln 4^{ln 3^{ln 2}}}}$

  15. Brendon Brewer Avatar

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

  16. Sam Avatar
    Sam

    $latex e_{pi i}=-1 $

    second try…

  17. Name (required) Avatar
    Name (required)

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

  18. Sam Avatar
    Sam

    $latex e^{pi i}=-1 $

    third try…

  19. Sean Avatar

    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$

  20. Name (required) Avatar
    Name (required)

    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.

  21. Name (required) Avatar
    Name (required)

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

  22. Name (required) Avatar
    Name (required)

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

  23. TomR Avatar
    TomR

    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

  24. TomR Avatar
    TomR

    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

  25. Eric Avatar
    Eric

    $latex S=-frac{T}{2}int d^2zeta sqrt{-gamma} gamma^{ab} h_{ab}$