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. Mike M Avatar
    Mike M

    $latex {rm H}_2{rm SO}_4$, Professor. And $latex sqrt{pi}/$latex to your good lady wife.

  2. Mike M Avatar
    Mike M

    $latex {rm H}_2{rm SO}_4$, Professor. And $latex sqrt{pi}$ to your good lady wife.

  3. […] Filed under: General — Tags: General — theoreticalperson @ 1:49 am Ever since Cosmic Variance enabled LaTeX, I have to admit I’ve been extremely jealous. It is almost contradictory to […]

  4. A Student Avatar
    A Student

    $latex mid Z_{1} mid$

  5. A Student Avatar
    A Student

    $latex |Z_{1}|$

  6. A Student Avatar
    A Student

    $latex P(A cup B)[tex]

  7. A Student Avatar
    A Student

    $latex P(A cup B)$

  8. A Student Avatar
    A Student

    $latex P(AcupB)$

  9. A Student Avatar
    A Student

    $latex P(Acup B)$

  10. Brad Avatar
    Brad

    $latex i hbar frac{partial boldsymbol{Psi}}{partial t} = Big[ – frac{hbar^2}{2m} nabla^2 + V Big] boldsymbol{Psi} $

    It worked in Wikipedia:Sandbox, let’s see if it works here.

  11. Brad Avatar
    Brad

    Oh, right…

    $latex i hbar frac{partial boldsymbol{Psi}}{partial t} = Big[ – frac{hbar^2}{2m} nabla^2 + V Big] boldsymbol{Psi} displaystyle $

  12. Brad Avatar
    Brad

    Oh well, it looks squished.

  13. andy.s Avatar
    andy.s

    $latex LaTeX$

  14. andy.s Avatar
    andy.s

    I look forward to it Sean. But I bet you’d sell more if you explained it all to your dog.

    Also: re entropy.

    Consider a muon. Before it decays is structureless and just like a stable particle in terms of properties, but when it decays there is then more complexity in the universe than before etc – how can entropy be coherently defined for such entities

    Not sure if entropy would increase in this reaction. Muon decay goes like $latex mu^- to nu_mu + W^- to nu_mu + e^- + bar{nu_e}$. That reaction should be reversible, and in chemistry, IIRC, a reversible reaction does not increase entropy. I don’t know, maybe it’s different with particles.

  15. notaquant Avatar
    notaquant

    $latex frac{partialpsi}{partial t}(t,x)=-frac{partial^2psi}{partial x^2}(t,x)+V(t,x)psi(t,x)$

  16. asdfhgh Avatar
    asdfhgh

    | psi rangle

  17. asdfhgh Avatar
    asdfhgh

    $latex | psi rangle $

  18. notaquant Avatar
    notaquant

    $latex
    ihbarfrac{partialpsi}{partial t}(t,x)=-frac{hbar^2}{2m}nabla^2psi(t,x)+V(t,x)psi(t,x)
    $

  19. notaquant Avatar
    notaquant

     ihbarfrac{partialpsi}{partial t}(t,x)=-frac{hbar^2}{2m}nabla^2psi(t,x)+V(t,x)psi(t,x)

  20. macho Avatar
    macho

    adding a link:

  21. Google News
  • macho Avatar
    macho

    $latex cm^3$

  • macho Avatar
    macho

    $latex GeV/cm^3$

  • More posts