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. Apparently he’s relating the long-term time average of a pure-state expectation value in the limit trightarrow infty, with the instantaneous exp. value of a mixed state

    Hmm, that sounds like an ergodic theorem. I don’t like ergodic theorems because they pretty much have zero relevance except in algorithm design (MCMC and stuff).

  2. The essence of the pure density operator formalism: States are operators instead of vectors. Example: $latex |arangle to rho_a = |arangle langle a|$. Example: $latex psi(x) to rho(x,x’) = psi^*(x’)psi(x)$

    Let $latex hat{S}$ be an operator that squares to 1. Then $latex (1pmhat{S})/2$ is (an opeartor and is also) an eigenstate of $latex hat{S}$ with eigenvalue $latex pm 1$. Example, spin 1/2 in the X direction has the operator:
    $latex hat{X} = left(begin{array}{cc}0&11&0end{array}right)$
    and therefore the density matrix state corresponding to it is:
    $latex rho_X = 0.5left(begin{array}{cc}1&11&1end{array}right)$

    If it passes this, that’s pretty good…

  3. Very nifty.

    $latex begin{displaymath}
    mathbf{A} =
    left( begin{array}{ccccc}
    1 & 0 & 0 & 0 &ddots
    d & -2d -a^2 & d & 0 & ddots
    0 & d & -2d -a^2 & d & ddots
    ddots & ddots & ddots & ddots & ddots
    hdots & 0 & 0 & 0 & 1
    end{array} right).
    end{displaymath}$

  4. You could simply use the Emacs Muse package for the “all in one” Emacs. It supports latex2png.

    Testing LaTeX in wordpress:

    [ tex]
    R=left(
    begin{matrix}
    2q_0^2-1+2q_1^2&2q_1q_2-2q_0q_3&2q_0q_2+2q_1q_3cr 2q_1q_2+2q_0q_3&2q_0^2-1+2q_2^2&2q_2q_3-2q_0q_1cr
    2q_1q_3-2q_0q_2&2q_0q_1+2q_2q_3&2q_0^2-1+2q_3^2
    end{matrix}
    right)

  5. Pingback: LaTeX « Os Manos DALTON

  6. And of course I get the formatting right but screw up the formula.

    $latex int_1^{sqrt[3]{3}} z^2,dz cos(frac{3pi}{9}) = lnsqrt[3]{e}$

  7. Hmm… not sure I know how this works, but…
    $latex T = left(dfrac{L_ast left(1-Aright)}{ 16pisigmaD^2 }right)^frac{1}{4}$

  8. How can I use Latex on Windows? I’ve downloaded the Windows thing but when the interface comes up, there’s nothing to do. You know, to start a new document and start typing with those sciencey fonts..what am I missing?

  9. Formatting LaTEX commands seeems cumbersome to me. I’d think typing the Standard Model Lagrangian would be a nightmare! Embarrassing confession – I typed two dissertations using the Word equations editor. I’m waiting for the point and click version of LaTEX – essentially a more versatile version of Word E.E.

  10. Re #71 & #74:

    http://www.mackichan.com

    It’s commercial, but its &ltbad french accent&gt very nice &lt/bad french accent&gt

    If anyone knows of a open source/cross-platform equivalent, I’m all ears. But don’t tell my Lyx, it doesn’t come close.

Comments are closed.

Scroll to Top