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. Hal S Avatar
    Hal S

    $latex P_{avg}=dfrac{Delta m}{Delta t} c^2=dfrac{Delta p}{Delta x} c^2$

  2. Hal S Avatar
    Hal S

    cool

  3. Lawrence B. Crowell Avatar
    Lawrence B. Crowell

    $latex partial_apartial^aphi~=~-m^2phi~+~g^2phi^3 F_{ab}F^{ab}$
    with the action
    $latex
    S~simeq~ int d^4x Big(frac{1}{2}|nablaphi|^2~+~phi^2big(sqrt{-g}kappa R~+~frac{1}{2}m^2~-~frac{g^2}{4}phi^2 F_{ab}F^{ab}big)Big),$

  4. Freiddie Avatar

    I’m seeing all sorts of familiar and unfamiliar maths here! Hey, is that a Lie bracket?

  5. Blake Stacey Avatar

    Dang it, now I feel really guilty I didn’t finish my next SUSY QM post today. I find it’s actually harder to write the prose in between the equations than the equations themselves. . . .

    $latex {Q, Q^dag} = mathcal{H},$

    $latex {Q, Q} = {Q^dag, Q^dag} = Z.$

  6. agm Avatar
    agm

    Sean, I vote for Christian (#57) winning the thread. For the obvious reason.

  7. James Gallagher Avatar

    $latex ihbarfrac{partial}{partial t}left|Psi(t)right>=Hleft|Psi(t)right>$

    OK, but you do need a previewer.

    LatexRender is cool in its quirky way, slightly naive, limited and won’t be the future, but hey, it’s fun.

    You wouldn’t get the superstring guys using it though. 😉

  8. James Gallagher Avatar

    For the pedantic, let’s make that Hamiltonian explicitly time dependent

    $latex ihbarfrac{partial}{partial t}left|Psi(t)right>=H(t)left|Psi(t)right>$

  9. aatish Avatar

    $latex sum_{n=1}^{infty}n = -frac{1}{12}$, therefore physics is crazy!

    I discovered latex on wordpress recently, so I’ve been going latex crazy on my website.

  10. Hal S Avatar
    Hal S

    Electrical theory

  11. Ghiret Avatar
    Ghiret

    So, as you say in your book, covariant derivative of $latex V ^mu $ is:

    $latex nabla _{nu}V^mu = partial _nu V^mu+Gamma^mu^{sigmanu}V^sigma$

    I think, but I suppose I don’t remenber index placement really.

    (anyway, I was just trying latex 🙂 )

  12. Ghiret Avatar
    Ghiret

    Mmm, $latex sigmamu$ should be down… :S

  13. James Nightshade Avatar
    James Nightshade

    $latex (x+y)^n=displaystyle sum_{k=0}^n left ( n atop k right ) x^{n-k}y^k$

  14. Blake Stacey Avatar

    Now, the real question is, can we use LaTeX to write a Hamiltonian for the Quantum of Solace?

  15. benji Avatar
    benji

    Quadratic thingy, try 1

    $latex x=dfrac{-bpmsqrt{b^2-4ac}}{2a}$

  16. benji Avatar
    benji

    Cool!

  17. andy.s Avatar
    andy.s

    $latex -frac{hbar^2}{2m}nabla^2Psi + VPsi = ihbarfrac{partial}{partial t}Psi$

  18. andy.s Avatar
    andy.s

    Whoo hoo! Worked first time!

    Previews are for wussies!

  19. Chris Avatar
    Chris

    You guys better worry whether Steven Hawking was right in his introduction to _A Brief History of Time_. He repeated advice given to him that for every equation used in the text, he would decrease his readership by 50%. By my estimates, the readership of this blog will soon be approximating the Planck Length.

  20. Count Iblis Avatar

    $latex displaystyle x^3 + p x + q = 0 Longrightarrow $

    $latex displaystyle sqrt[3]{sqrt{left(frac{p}{3}right)^3+left(frac{q}{2}right)^2} – frac{q}{2}} – sqrt[3]{sqrt{left(frac{p}{3}right)^3+left(frac{q}{2}right)^2} + frac{q}{2}}$

  21. Count Iblis Avatar

    I meant to say:

    $latex displaystyle x^3 + p x + q = 0 Longrightarrow$

    $latex displaystyle x = sqrt[3]{sqrt{left(frac{p}{3}right)^3+left(frac{q}{2}right)^2} – frac{q}{2}} – sqrt[3]{sqrt{left(frac{p}{3}right)^3+left(frac{q}{2}right)^2} + frac{q}{2}}$

  22. Brian Avatar
    Brian

    $latex displaystyle oint_s vec{B} cdot da$

    here goes…

  23. chris Avatar
    chris

    $latex begin{tabular}{ll}1 &21&2end{tabular}$

  24. chris Avatar
    chris

    $latex begin{tabular}{ll} 1 2 1 2end{tabular}

  25. chris Avatar
    chris

    $latex begin{tabular}{ll} 1 2 1 2end{tabular}[tex]