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. If you want to see the code (provided the equation is rendered correctly), simply look at the tooltip that appears when you move your mouse over the equation.

  2. Excellent! Now I can submit the proof that girls are evil:

    $latex mathrm{girls} = mathrm{time}timesmathrm{money}$
    $latex mathrm{time} = mathrm{money}$
    $latex mathrm{girls} = mathrm{money}^2$
    $latex mathrm{money} = sqrt{mathrm{evil}}$
    $latex mathrm{girls} = sqrt{mathrm{evil}^2} = mathrm{evil}$

  3. So I guess it was just the length of my formula that made it dangerous. Not an ideal feature, but then again that’s probably not a formula you’d write out in a blog entry. (It’s really more comprehensible when explained in words anyway.)

  4. I must say, Sean, the Google Ads sidebar comes up with some interesting associations from the repeated use of the word “Latex”.

  5. test post:

    $latex |Psi(t^prime)rangle = U(t, t^prime) |Psi(t)rangle $
    meaning the wave function at a future t’ is some operator times the wave function at t – the operator depends on t and t’.

    Obviously,
    $latex U(t, t) = I $

    So in the infinitesimal region around t, U is probably something like,
    $latex U(t, t+delta t) = I + delta t Omega + (delta t)^2 (whatever) $

    That makes
    $latex |Psi(t+delta t)rangle = (I + delta t Omega + (delta t)^2)(whatever) ) |Psi(t)rangle $

    Getting the derivative gives you:
    $latex |dot{Psi}rangle = Omega |Psirangle $

    Big whoop right? We had some operator U that we didn’t know anything about, now we have some operator $latex Omega$ that we don’t know anything about. But hit it on the left with $latex langle Psi |$ and you get:

    $latex langle Psi |dot{Psi}rangle = langle Psi |Omega |Psirangle $

    Adding the complex conjugate,

    $latex langle Psi |dot{Psi}rangle + langle dot{Psi} |Psirangle = frac{partial}{partial t}langle Psi |Psirangle = 0 = langle Psi |Omega +Omega^dagger|Psirangle $

    Which implies that $latex Omega^dagger = -Omega$.
    Cool. So $latex Omega$ is anti-hermitian.

    But we like Hermitian operators, so let’s multiply both sides by i. This gets us

    $latex i|dot{Psi)}rangle = i Omega |Psi)rangle $

    That makes the operator on the right side Hermitian. That’s where the “i” in the Schroedinger equation comes from.

    Next is the units. $latex |Psi)rangle $ always has some weird units like length^-1/2, and naturally $latex |dot{Psi)}rangle$ would be length^-1/2 s^-1. That means that $latex Omega$ will have units of s^-1 or frequency.
    Lucky we called it $latex Omega$ then.

    So $latex iOmega$ is Hermitian and has units of frequency, so it must be some kind of frequency observable. Well, the energy levels of atoms are always associated with absorption and emission frequencies so we can get the operator to have energy units by multiplying both sides by $latex hbar$ to get:

    $latex ihbar|dot{Psi)}rangle = i hbarOmega |Psi)rangle $

    Which is just the Schroedinger equation, with $latex ihbarOmega$ identified with the Hamiltonian.

  6. next try:
    $latex |Psi(t^prime)rangle = U(t, t^prime) |Psi(t)rangle $
    $latex U(t, t) = I $
    $latex U(t, t+delta t) = I + delta t Omega + (delta t)^2 (whatever) $
    $latex |Psi(t+delta t)rangle = (I + delta t Omega + (delta t)^2(whatever) ) |Psi(t)rangle $
    $latex |dot{Psi}rangle = Omega |Psirangle $
    $latex langle Psi |dot{Psi}rangle = langle Psi |Omega |Psirangle $
    $latex langle Psi |dot{Psi}rangle + langle dot{Psi} |Psirangle = frac{partial}{partial t}langle Psi |Psirangle = 0 = langle Psi |Omega +Omega^dagger|Psirangle $

    Which implies that $latex Omega^dagger = -Omega$.
    $latex i|dot{Psi}rangle = i Omega |Psirangle $
    Next is the units. $latex |Psirangle $ always has some weird units like length^-1/2, and naturally $latex |dot{Psi}rangle$ would be length^-1/2 s^-1. That means that $latex Omega$ will have units of s^-1 or frequency.
    Lucky we called it $latex Omega$ then.
    $latex ihbar|dot{Psi}rangle = i hbarOmega |Psirangle $

  7. $latex U(t, t+delta t) = I + delta t Omega + (delta t)^2 (whatever) $

    $latex |Psi(t+delta t)rangle = (I + delta t Omega + (delta t)^2(whatever) ) |Psi(t)rangle $

  8. $latex G(k,iomega)=-intfrac{1}{pi}frac{Im(G(komega_1))}{iomega-omega_1}[tex]

    i think the blog needs a preview function; probably true in general. soon our productivity can $latex mathrm{Productivity}rightarrow 0[tex].

Comments are closed.

Scroll to Top