Succumbing to LaTeX

by Sean

Update: The post below was written back when CV was on its own. Here on the new Discover site, the way to put something into Latex is to start with

$latex

and end with a simple

$

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. (Amazingly, InMotion Hosting already had LaTeX installed on our server. Yay for them!)

So now it’s easy to include equations; they should even be available in comments. All you have to do is type [tex], then your LaTeX commands, then [/tex]. So for example

[tex]R_{\mu\nu}-\frac{1}{2}Rg_{\mu\nu}=8\pi G T_{\mu\nu}[/tex]

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.

But now I should get back to work. So to keep you thinking, here are a couple of equations from the stuff I’m thinking about and hopefully will explain soon:

\displaystyle \langle\langle \hat{\mathcal O}\rangle\rangle =\lim_{t \rightarrow \infty}\frac{1}{t}\int^t_0 \langle \psi_s|\hat{\mathcal O}|\psi_s\rangle ds = \rm{tr}(\hat\rho \hat{\mathcal O})\,,

\displaystyle \hat\rho = \frac{1}{Z} \exp{\left(-\beta \hat{H} - \sum^n_{i=2} \mu_i \hat{F}_i\right)}\,.

Kind of beautiful, in an austere way, don’t you think?

submit to reddit

January 22nd, 2008 8:27 PM
in Cosmic Variance | 200 comments | RSS feed | Trackback >

200 Responses to “Succumbing to LaTeX”

  1. 1.   Sean Says:

    Okay, here goes nothing:

    \displaystyle \frac{d}{dx}e^x = e^x.
  2. 2.   Sean Says:

    Success!

  3. 3.   Sam Says:

    [ tex] e_i\pi=-1 [ /tex]

  4. 4.   Big Vlad Says:

    $latex e^{\PI i} = -1 [\tex]

  5. 5.   Sean Says:

    Shouldn’t have any spaces between the “[” and the “tex” or “\tex”.

  6. 6.   Sean Says:

    And it’s \pi, not \PI.

  7. 7.   Big Vlad Says:
     e^{\PI i} = -1
  8. 8.   Julianne Says:

    This has to be the most fabulously geeky comment thread, EVAH!

  9. 9.   Neil B. Says:

    Hi, I am still looking for good (and hopefully free) program to convert Word or maybe WPerfect to LaTex. The one I downloaded (Word2tex) seems unable to perform, likely because I just don’t get how to use all those wacky little files. I mean, I just want to rev up a simple click-to-start program (like any other Windows product) to take the Word doc and turn it into a LaTex document (and look at it to be sure it is right) without hassle, any help please? tx

  10. 10.   Sean Says:

    Julianne, don’t you mean \ \epsilon\nu\alpha\hbar?

  11. 11.   HB Says:
    \zeta(1/2+\pi^{-e}+i 10^{500} )=0
  12. 12.   Bob Munck Says:

    LaTeX. That’s so 20th century. The modern, up-to-date way to support equations is MathML; it’s what all the kids are using these days.

    To be honest, we tried for weeks to get MathML to work on one of the Space Elevator forums, and never succeeded. Your LaTeX renderer is somewhat of a kludge, but one can’t argue with the fact that it works.

    Did you know that one of the programming languages used by NASA for the Space Shuttle software, HAL/S, supported multiple-line statements containing 2-D equations?

  13. 13.   Christina Pikas Says:

    Not sure if it’s important, but it doesn’t seem to work in the feed. Reading the feed in bloglines, I just got the markup, not the equation.

  14. 14.   Sam Gralla Says:
    \nabla^c \nabla_c h_{ab} - 2 R^c{}_{ab}{}^d h_{cd} = - 16 \pi M \int_\gamma \delta_4(x,z(\tau))\,u^a(\tau)u^b(\tau)\,d\tau,
    \nabla^b h_{ab}=O(\mu^2)
  15. 15.   Sam Gralla Says:

    Oh yeah, first try. I’m a winner.

  16. 16.   Sean Says:

    Christina, really? It shows up okay for me, both in bloglines and in Google reader. Which feed are you using? Do you usually see images? (Because that’s all they are.) Do you have some weird background color?

  17. 17.   tacitus Says:

    Kind of beautiful, in an austere way, don’t you think?

    …and utter gobbledygook to physics and maths illiterates like me :)

    Have fun.

  18. 18.   Eugene Says:

    I see your density matrices and raise you a unitary operator, stuff that I am thinking about

    $latex i\frac{\partial}{\partial t} U(t,t’) = H_I(t)U(t,t’)[\tex]

  19. 19.   Freiddie Says:

    $latex \epsilon_123=1[\tex]
    Does it work?
    Does the first equation with the R_mu_nu in your blog post have anything to do with general relativity?
    And I haven’t got a clue what those “austerely beautiful” equations are, or mean.

  20. 20.   Freiddie Says:

    $latex \epsilon_{123}=1[\tex] Trying again

  21. 21.   Jerry Boetje Says:

    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. You could write a Kalman filter in 2 lines of code using the sub/superscript capability. Very cool. Thanks for reminding me of those days.

  22. 22.   Sean Says:

    Forward slashes on the closing /tex, guys.

    Precision counts!

    \epsilon_{123}=1

    And yes, the first example is Einstein’s equation of general relativity.

  23. 23.   Helge Says:

    $latex det\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = -1 {\tex]
    sucks.

  24. 24.   Helge Says:

    $latex det\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = -1 [\tex]
    sucks.

  25. 25.   Jim Says:

    Sean, this is fabulous! I’ve been looking for a host that has $latex \LaTeX[\tex] installed. InMotion may be exactly what I’ve been looking for and may prompt a server switch in the very near future.

  26. 26.   Jim Says:

    Huh, I think I got the ending tag wrong (it’s counterintuitive). It should have been \LaTeX.

  27. 27.   Brad Holden Says:
    i_{775} - z_{850} > 1.5

    Its hard not to type the $, \( or \[

  28. 28.   astropixie Says:

    “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!!

  29. 29.   seriously Says:

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

  30. 30.   seriously Says:
    W^{h^{e^{e^{e^{e^{e^{e^{e^{e^{e^{e^e}}}}}}}}}}} W_{h_{o_{o_{o_{o_{o_{o_{o_{o_{o_{o_o}}}}}}}}}}}
  31. 31.   Freiddie Says:
    \epsilon_123=1
  32. 32.   Freiddie Says:

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

  33. 33.   Freiddie Says:

    \epsilon_{123}=1 Now this must work!

  34. 34.   Bob Munck Says:

    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.

  35. 35.   Name (required) Says:
    \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) , \hat{\rho} = \frac{1}{Z} \mbox{exp} \left( \beta \hat{H} + \sum_{i=2}^n \mu_i \hat{F}_i \right) .
  36. 36.   Name (required) Says:

    Hmm, seems to evaluate as inline LaTeX for some reason. Maybe it’s the html tags?

    \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) , \hat{\rho} = \frac{1}{Z} \mbox{exp} \left( \beta \hat{H} + \sum_{i=2}^n \mu_i \hat{F}_i \right) .
  37. 37.   Name (required) Says:

    No, still no good. Excuse the debugging,

    \frac{1}{2} \int_0^{\infty}
  38. 38.   Name (required) Says:
    \frac{0}{0}
  39. 39.   efp Says:
    \pi \approx \ln 6^{\ln 5^{\ln 4^{\ln 3^{\ln 2}}}}
  40. 40.   Brendon Brewer Says:

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

  41. 41.   Sam Says:
     e_{\pi i}=-1

    second try…

  42. 42.   Name (required) Says:
    \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]

  43. 43.   Sam Says:
     e^{\pi i}=-1

    third try…

  44. 44.   Sean Says:

    It’s really just “\displaystyle”; e.g.

    (tex)\sum_{n=0}^\infty(/tex)

    (with square brackets instead of parentheses) gives

     \sum_{n=0}^\infty

    while

    (tex)\displaystyle \sum_{n=0}^\infty(/tex)

    gives

    \displaystyle \sum_{n=0}^\infty
  45. 45.   Name (required) Says:

    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 t\rightarrow \infty, with the instantaneous exp. value of a mixed state

    \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 \rho looks like a partition function, with n-1 funny-looking terms added to the hamiltonian

    \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.

  46. 46.   Name (required) Says:
    \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) .}

  47. 47.   Name (required) Says:

    Eureka, it worked!

    \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) , \displaystyle \hat{\rho} = \frac{1}{Z} \mbox{exp} \left( \beta \hat{H} + \sum_{i=2}^n \mu_i \hat{F}_i \right) .
  48. 48.   TomR Says:

    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 e^{-r/\lambda}/r^2 where \lambda is the so-called Debye screening length of the plasma

  49. 49.   TomR Says:

    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 \dfrac{e^{-r/\lambda}}{r^2} where \lambda is the so-called Debye screening length of the plasma

  50. 50.   Eric Says:
    S=-\frac{T}{2}\int d^2\zeta \sqrt{-\gamma} \gamma^{ab} h_{ab}
  51. 51.   Brendon Brewer Says:

    Apparently he’s relating the long-term time average of a pure-state expectation value in the limit t\rightarrow \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).

  52. 52.   Carl Brannen Says:

    The essence of the pure density operator formalism: States are operators instead of vectors. Example: |a\rangle \to \rho_a = |a\rangle \langle a|. Example: \psi(x) \to \rho(x,x') = \psi^*(x')\psi(x)

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

    If it passes this, that’s pretty good…

  53. 53.   Carl Brannen Says:

    Hmm. ampersands sort of don’t work in the definition of arrays, they get an extra “amp;” .

  54. 54.   Aristotle Pagaltzis Says:

    Regarding preview, may I recommend the AJAX Comment Preview plugin? It’s the best preview function I’ve seen anywhere, and easy to set up.

  55. 55.   Jason Says:

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

  56. 56.   Jason Says:

    Well, it worked in my term paper… ah, well.

  57. 57.   Christian Says:
    \lim_{3\rightarrow4}\sqrt{3}=2
  58. 58.   tca Says:

    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_3\cr 2q_1q_2+2q_0q_3&2q_0^2-1+2q_2^2&2q_2q_3-2q_0q_1\cr
    2q_1q_3-2q_0q_2&2q_0q_1+2q_2q_3&2q_0^2-1+2q_3^2
    \end{matrix}
    \right)

  59. 59.   tca Says:

    Did not work… Sorry!

  60. 60.   LaTeX « Os Manos DALTON Says:

    [...] 23, 2008 Ora aqui está qualquer coisa de muito importante que acabei de descobrir através do Cosmic Variance: como escrever equações neste blog, e apenas em Wordpress, usando LaTeX… Fiquei [...]

  61. 61.   Mark Says:

    A limerick:

    \int_1^\sqrt{3} z^2\,dz \cross cos(\frac{3\pi}{9} = \ln\sqrt[3]{3}
  62. 62.   Mark Says:

    2nd try:

    A limerick:

    \int_1^{\sqrt{3}} z^2\,dz \cross cos(\frac{3\pi}{9}) = \ln\sqrt[3]{3}
  63. 63.   Mark Says:

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

    \int_1^{\sqrt[3]{3}} z^2\,dz cos(\frac{3\pi}{9}) = \ln\sqrt[3]{e}
  64. 64.   feg Says:
    e^{i*pi}+1=0
  65. 65.   andy Says:

    Hmm… not sure I know how this works, but…
    T = \left(\dfrac{L_\ast \left(1-A\right)}{ 16\pi\sigmaD^2 }\right)^\frac{1}{4}

  66. 66.   andy Says:

    Try again…
    T = \left(\dfrac{L_\ast \left(1-A\right)}{ 16\pi \sigma D^2 }\right)^\frac{1}{4}

  67. 67.   Joerg Says:
    \partial_t\vec{v}+[\nabla\cdot\vec{v}]=-\frac{1}{\rho}\nabla\vec{p}-\vec{g}-\nabla² \vec{v}²
  68. 68.   Joerg Says:

    Wow that wasn’t right
    \partial_t\vec{v}+[\nabla\cdot\vec{v}]=-\frac{1}{\rho}\nabla\vec{p}-\vec{g}-\nu\nabla^2 \vec{v}^2

  69. 69.   Count Iblis Says:
    \displaystyle\int_{0}^{\infty}\frac{x^{-p}}{1+x}dx=\frac{\pi}{\sin\left(\pi p\right)}
  70. 70.   Frank Oswalt Says:
    \frac{Love - 0}{No Limit}
  71. 71.   Erick Says:

    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?

  72. 72.   Navneeth Says:

    Let $latex \epsilon

  73. 73.   Navneeth Says:

    $latex Let \epsilon

  74. 74.   citrine Says:

    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.

  75. 75.   efp Says:

    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.

  76. 76.   efp Says:

    Damn, what this blog needs is a preview button… :(

  77. 77.   Christina Says:

    wrt feed (sorry slow to get back to this), on bloglines, I’m sub’d to: http://blogs.discovermagazine.com/cosmicvariance/?feed=rss2
    I do see the pictures, have just a white background… or actually gray for that one (every other item is gray). I can put a screenshot somewhere if that would be helpful.

  78. 78.   Sean Says:

    Frank Oswalt wins.

    Christina, it seems to work with

    http://blogs.discovermagazine.com/cosmicvariance/feed/rss

    Try switching to that one to see if it works.

    Sorry about the lack of preview; we used to have one, but it broke for some unknown reason. The AJAX preview is also seemingly incompatible with our theme.

  79. 79.   Dave Bacon Says:

    I see no equations using IE 7.0. There is a javascript error: Line 56, ‘document.getElementById(..) is null or not an object’

  80. 80.   Sean Says:

    Sorry, I think that was my fault — tried to mess with a preview plugin, and mistakenly deactivated the latex plugin. Should be okay now.

  81. 81.   chemicalscum Says:

    I see no equations using IE 7.0. There is a javascript error: Line 56, ‘document.getElementById(..) is null or not an object’

    I see no equations either on both FF 2.0.0.11 and IE6 on Windows. Haven’t yet tried it on a Linux box.

  82. 82.   chemicalscum Says:

    Yep it’s working for me now.

  83. 83.   Navneeth Says:
    \alpha\beta\gamma
  84. 84.   chemicalscum Says:

    OK lets give it a try see if I can get some Dirac Notation:

    $latex % define new matrix element, \ME command
    \newcommand{\ME}[3]{\ensuremath{\left \langle \left. #1
    \right. \right| #2 \left| \left. #3 \right. \right \rangle}}

    \ME{a}{M}{b}$

  85. 85.   chemicalscum Says:

    Oh well I’ll try again later.

  86. 86.   bswift Says:

    oh, good times…

  87. 87.   mollishka Says:
    \displaystyle \theta_{E}^{2} = \frac{4GM}{c^2}\frac{D_{LS}}{D_{L}D_{S}}
  88. 88.   MedallionOfFerret Says:

    Emulation is the sincerest form of flattery:

    \displaystyle \langle\langle \hat{\mathcal O}\rangle\rangle =\lim_{t \rightarrow \infty}\frac{1}{t}\int^t_0 \langle \psi_s|\hat{\mathcal O}|\psi_s\rangle ds = \rm{tr}(\hat\rho \hat{\mathcal O})\,, \displaystyle \hat\rho = \frac{1}{Z} \exp{\left(-\beta \hat{H} - \sum^n_{i=2} \mu_i \hat{F}_i\right)}\,.
  89. 89.   MedallionOfFerret Says:

    I also do “The rain in Spain falls mainly on the plain” quite well.

  90. 90.   andy Says:
    \left[\dfrac{abc}{def}\right]
  91. 91.   andy Says:

    Er… oops…

  92. 92.   andy Says:
    \left\[\dfrac{abc}{def}\right\]
  93. 93.   andy Says:

    Hmmm… doesn’t like square brackets…

    \[ \dfrac{abc}{def} \]
    \left \[ \dfrac{abc}{def} \right \]
  94. 94.   Count Iblis Says:
    \left[A,B\right]=AB - BA
  95. 95.   Count Iblis Says:

    So, I think it may be the dfrac command, Andy :)

  96. 96.   Hal S Says:
    P_{\a\v\g}
  97. 97.   Hal S Says:

    $latex P_{avg}[\tex]

  98. 98.   Hal S Says:
    P_{avg}
  99. 99.   Hal S Says:
    P_{avg}=\frac{\Deltam}{\Deltat}c^2=\frac{\Deltap}{\Deltax}c^2
  100. 100.   Hal S Says:

    still practicing

    \drac{\Delta t}
  101. 101.   Hal S Says:
    P_{avg}=\dfrac{\Delta m}{\Delta t} c^2=\dfrac{\Delta p}{\Delta x} c^2
  102. 102.   Hal S Says:

    cool

  103. 103.   Lawrence B. Crowell Says:

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

  104. 104.   Freiddie Says:

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

  105. 105.   Blake Stacey Says:

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

    \{Q, Q^\dag\} = \mathcal{H}, \{Q, Q\} = \{Q^\dag, Q^\dag\} = Z.
  106. 106.   agm Says:

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

  107. 107.   James Gallagher Says:
    i\hbar\frac{\partial}{\partial t}\left|\Psi(t)\right>=H\left|\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. ;)

  108. 108.   James Gallagher Says:

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

    i\hbar\frac{\partial}{\partial t}\left|\Psi(t)\right>=H(t)\left|\Psi(t)\right>
  109. 109.   aatish Says:

    \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.

  110. 110.   Hal S Says:

    Electrical theory

  111. 111.   Ghiret Says:

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

    \nabla _{\nu}V^\mu = \partial _\nu V^\mu+\Gamma^\mu^{\sigma\nu}V^\sigma

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

    (anyway, I was just trying latex :) )

  112. 112.   Ghiret Says:

    Mmm, \sigma\mu should be down… :S

  113. 113.   James Nightshade Says:
    (x+y)^n=\displaystyle \sum_{k=0}^n \left ( n \atop k \right ) x^{n-k}y^k
  114. 114.   Blake Stacey Says:

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

  115. 115.   benji Says:

    Quadratic thingy, try 1

    x=\dfrac{-b\pm\sqrt{b^2-4ac}}{2a}
  116. 116.   benji Says:

    Cool!

  117. 117.   andy.s Says:
    -\frac{\hbar^2}{2m}\nabla^2\Psi + V\Psi = i\hbar\frac{\partial}{\partial t}\Psi
  118. 118.   andy.s Says:

    Whoo hoo! Worked first time!

    Previews are for wussies!

  119. 119.   Chris Says:

    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.

  120. 120.   Count Iblis Says:
    \displaystyle x^3 + p x + q = 0 \Longrightarrow \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}}
  121. 121.   Count Iblis Says:

    I meant to say:

    \displaystyle x^3 + p x + q = 0 \Longrightarrow \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}}
  122. 122.   Brian Says:
    \displaystyle \oint_s \vec{B} \cdot \da

    here goes…

  123. 123.   chris Says:
    \begin{tabular}{ll}1 &2\\1&2\end{tabular}
  124. 124.   chris Says:

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

  125. 125.   chris Says:

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

  126. 126.   chris Says:
    \left( \begin{tabular}{ll} 1 2\\ 1 2\end{tabular}\right)
  127. 127.   chris Says:
    \begin{tabular}{ll} 1 \left( \begin{tabular}{ll}1 2 \\ 1 2 \end{tabular}\right) \\ 1 2\end{tabular}
  128. 128.   chris Says:
    \left(\begin{tabular}{ll} 1 \left( \begin{tabular}{ll}1 2 \\ 1 2 \end{tabular}\right) \\ 1 2\end{tabular}\right)
  129. 129.   chris Says:

    < ![CDATA[latex]\texbf{feel free to axe the above ones if things have become cluttered.}[/latex]>

  130. 130.   chris Says:
    \texbf{feel free to axe the above ones if things have become cluttered.}
  131. 131.   chris Says:
    \textbf{\sigma}=\right\{ \left( \begin{tabular}{ll}0 1// 1 0\end{tabular}\right) ,\left( \begin{tabular}{ll}0 -i// i 0\end{tabular}\right) , \left( \begin{tabular}{ll}1 0// -1 0\end{tabular}\right) \right\}
  132. 132.   chris Says:

    That would have been a lot more impressive had it worked. :(

  133. 133.   chris Says:
    \textbf{\sigma}=\right( \left( \begin{tabular}{ll}0 1\\ 1 0\end{tabular}\right) ,\left( \begin{tabular}{ll}0 -i \\ i 0\end{tabular}\right) , \left( \begin{tabular}{ll}1 0\\ -1 0\end{tabular}\right) \right)
  134. 134.   chris Says:

    Okay, so much for that. Sorry about the big white splotches, you might want to get rid of them. Congrats on getting the latex!

  135. 135.   Seth Says:

    Can’t resist..

    \sigma(p(P)p(P) \to Y + X) = \int_0^1dx_1\int_0^1dx_2f_1(x_1)f_2(x_2)\sigma(q_1(x_1P)q_2(x_2P) \to Y)
  136. 136.   Seth Says:

    Err… that was:

    \sigma(p(P)p(P) \to Y + X) = \int_0^1dx_1\int_0^1dx_2f_1(x_1)f_2(x_2)\sigma(q_1(x_1P)q_2(x_2P) \to Y)

    What’s wrong?

  137. 137.   Neil B. Says:

    It looks like everyone forgot or overlooked my question at #9, LMK if you have an answer, tx

  138. 138.   Brian Drell Says:

    $latex E=\frac{n^2\pi^2\hbar^2}{2mL^2}[\tex]

  139. 139.   glenn Says:
    R_{\mu\nu}-\frac{1}{2}Rg_{\mu\nu}=8\pi G T_{\mu\nu}

    hehe. I’m plagiarizing!

  140. 140.   James Gallagher Says:

    I’ll try your formula Seth:

    \sigma(p(P)p(P) \to Y + X) = \int_0^1dx_1\int_0^1dx_2f_1(x_1)f_2(x_2)\sigma(q_1(x_1P)q_2(x_2P) \to Ylatex

    “Potentially dangerous”, wow, these days you just don’t know where you are safe.

    Chris, I like your recent contributions, ala G Lissi, you’ve created a Theory of Nothing :)

  141. 141.   James Gallagher Says:

    I’ll try your formula Seth:

    \sigma(p(P)p(P) \to Y + X) = \int_0^1dx_1\int_0^1dx_2f_1(x_1)f_2(x_2)\sigma(q_1(x_1P)q_2(x_2P) \to Y

    “Potentially dangerous”, wow, these days you just don’t know where you are safe.

    Chris, I like your recent contributions, ala G Lissi, you’ve created a Theory of Nothing :)

  142. 142.   Count Iblis Says:

    Let’s give Seth’s formula another try:

    $latex \sigma(p(P)p(P) \rightarrow Y + X) = \int_0^1dx_1\int_0^1dx_2f_1(x_1)f_2(x_2)\sigma(q_1(x_1P)q_2(x_2P) \rightarrow Y[\tex]

  143. 143.   Count Iblis Says:

    OOps, made a trivial error, let’s try again:

    \sigma(p(P)p(P) \rightarrow Y + X) = \int_0^1dx_1\int_0^1dx_2f_1(x_1)f_2(x_2)\sigma(q_1(x_1P)q_2(x_2P) \rightarrow Y
  144. 144.   Count Iblis Says:

    The software they use at Physicsforums does not complain, so perhaps here we need to care about the delimeters being closed properly… let’s try again:

    \sigma(p(P)p(P) \to Y + X) = \int_0^1dx_1\int_0^1dx_2f_1(x_1)f_2(x_2)\sigma(q_1(x_1P)q_2(x_2P) \to  Y)
  145. 145.   Freiddie Says:

    I tried parsing the formula in Wikipedia – works fine,
    but I’m not sure it’ll work here.
    This is what you have been trying, right?
    \sigma(p(P)p(P) \rightarrow Y + X) = \int_0^1dx_1\int_0^1dx_2f_1(x_1)f_2(x_2)\sigma(q_1(x_1P)q_2(x_2P) \rightarrow Y
    Now, here’s the formula (may not work…):
    \sigma(p(P)p(P) \rightarrow Y + X) = \int_0^1dx_1\int_0^1dx_2f_1(x_1)f_2(x_2)\sigma(q_1(x_1P)q_2(x_2P) \rightarrow Y
    Does it work?

  146. 146.   Freiddie Says:
    \sigma(p(P)p(P) \rightarrow Y + X)[latex] = \int_0^1dx_1[/latex]\int_0^1dx_2f_1(x_1)f_2(x_2)[latex]\sigma(q_1(x_1P)q_2(x_2P)[/latex] \rightarrow Y
  147. 147.   Freiddie Says:

    Hey, it works! (I broke the entire formula into multiple pieces of [ tex ] and [ /tex ].

  148. 148.   C Says:

    $latex \psset{unit=0.5cm}
    \begin{pspicture}(-4,-0.5)(4,8)
    \psgrid[subgriddiv=0,griddots=5,gridlabels=7pt](-4,-0.5)(4,8)
    \psline[linewidth=1pt]{->}(-4,0)(+4,0)
    \psline[linewidth=1pt]{->}(0,-0.5)(0,8)
    \psplot[plotstyle=curve,linewidth=0.5pt]{-4}{0.9}{10 x exp}% postscript function
    \rput[l](1,7.5){$10^x$}
    \psplot[plotstyle=curve,linecolor=red,linewidth=0.5pt]{-4}{3}{2 x exp}% postscript function
    \rput[l](2.2,7.5){\color{blue}$e^x$}
    \psplot[plotstyle=curve,linecolor=blue,linewidth=0.5pt]{-4}{2.05}{2.7183 x exp}% postscript function
    \rput[l](3.2,7.5){\color{red}$2^x$}
    \rput(4,8.5){\color{white}change\normalcolor}
    \rput(-4,-1){\color{white}bounding box\normalcolor}
    \end{pspicture}
    $

  149. 149.   C Says:

    Not quite working properly…maybe some packages need to be installed? For example, see http://sixthform.info/steve/wordpress/?p=24. Also, it would be nice to have the javascript option, where clicking on the equation brings up the latex code that generated it.

    \psset{unit=0.5cm}
    \begin{pspicture}(-4,-0.5)(4,8)
    \psgrid[subgriddiv=0,griddots=5,gridlabels=7pt](-4,-0.5)(4,8)
    \psline[linewidth=1pt]{->}(-4,0)(+4,0)
    \psline[linewidth=1pt]{->}(0,-0.5)(0,8)
    \psplot[plotstyle=curve,linewidth=0.5pt]{-4}{0.9}{10 x exp}% postscript function
    \rput[l](1,7.5){$10^x$}
    \psplot[plotstyle=curve,linecolor=red,linewidth=0.5pt]{-4}{3}{2 x exp}% postscript function
    \rput[l](2.2,7.5){\color{blue}$e^x$}
    \psplot[plotstyle=curve,linecolor=blue,linewidth=0.5pt]{-4}{2.05}{2.7183 x exp}% postscript function
    \rput[l](3.2,7.5){\color{red}$2^x$}
    \rput(4,8.5){\color{white}change\normalcolor}
    \rput(-4,-1){\color{white}bounding box\normalcolor}
    \end{pspicture}

  150. 150.   Count Iblis Says:

    C, isn’t there anything to render postscript directly? Then we could all just compile the latex code (including possible eps figures) to postscript and copy and paste that on this blog :)

  151. 151.   Freiddie Says:

    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.

  152. 152.   Plato Says:

    In Clifford’s Sandbox here are some tools for people to use. Carl helps quite a bit there. And, someone else mentioned mouse overs help too.

  153. 153.   Plato Says:

    Also see Latex Spoken here for further examination

  154. 154.   Jason Says:

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

    \mathrm{girls} = \mathrm{time}\times\mathrm{money}
    \mathrm{time} = \mathrm{money}
    \mathrm{girls} = \mathrm{money}^2
    \mathrm{money} = \sqrt{\mathrm{evil}}
    \mathrm{girls} = \sqrt{\mathrm{evil}^2} = \mathrm{evil}
  155. 155.   Sean Says:

    Shouldn’t that be plus or minus evil?

  156. 156.   James Gallagher Says:

    Nope, it’s +evil, he made a slight error in the formatting, it should be

    \mathrm{girls} = \sqrt{\mathrm{evil}}^2
  157. 157.   Hal S Says:
     \langle \rangle
  158. 158.   Eugene Says:

    $latex U=0[\tex]

  159. 159.   Eugene Says:

    Bah
    U=0

  160. 160.   Hal S Says:
     \dfrac{h \nu}{e^{\frac{h \nu}{k T}}-1}
  161. 161.   Hal S Says:
     1…
  162. 162.   Hal S Says:
    \int \dfrac{\delta E}{T}\
  163. 163.   Seth Says:

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

  164. 164.   andy.s Says:

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

  165. 165.   fishcake Says:
    \oint
  166. 166.   andy.s Says:
    \pi^+ = \frac{\bar{u}u - \bar{d}d}{\sqrt{2}}
  167. 167.   nuno Says:
    -\frac{\hbar}{2m}\psi+V(x)\psi=i\hbar\frac{dH}{dt}
  168. 168.   nuno Says:
    -\frac{\hbar^2}{2m}\nabla^2\psi+V(x)\psi=i\hbar\frac{dH}{dt}
  169. 169.   Traums Says:
    19  = 1 x 2^4 + 0 x 2^3 + 0 x 2^2 + 1 x 2^1 + 1 x 2^0
  170. 170.   Traums Says:
    19  = 1 * 2^4 + 0 * 2^3 + 0 * 2^2 + 1 * 2^1 + 1 * 2^0
  171. 171.   andy.s Says:

    test post:

    |\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,
    U(t, t) = I

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

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

    Getting the derivative gives you:
    |\dot{\Psi}\rangle = \Omega |\Psi\rangle

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

    \langle \Psi |\dot{\Psi}\rangle = \langle \Psi |\Omega |\Psi\rangle

    Adding the complex conjugate,

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

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

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

    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. |\Psi)\rangle always has some weird units like length^-1/2, and naturally |\dot{\Psi)}\rangle would be length^-1/2 s^-1. That means that \Omega will have units of s^-1 or frequency.
    Lucky we called it \Omega then.

    So i\Omega 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 \hbar to get:

    i\hbar|\dot{\Psi)}\rangle = i \hbar\Omega |\Psi)\rangle

    Which is just the Schroedinger equation, with i\hbar\Omega identified with the Hamiltonian.

  172. 172.   andy.s Says:

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

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

  173. 173.   andy.s Says:
    U(t, t+\delta t) = I + \delta t \Omega + (\delta t)^2 (whatever) |\Psi(t+\delta t)\rangle = (I + \delta t \Omega + (\delta t)^2(whatever) ) |\Psi(t)\rangle
  174. 174.   Proteus Says:
    G(k,i\omega)=\int\frac{-1}{\pi}\frac{G^{''}(k,\omega_1)}{i\omega-\omega_1}
  175. 175.   Proteus Says:

    $latex G(k,i\omega)=-\int\frac{1}{\pi}\frac{Im(G(k\omega_1))}{i\omega-\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].

  176. 176.   Mike M Says:

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

  177. 177.   Mike M Says:

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

  178. 178.   Wearing LaTeX « Standard Deviation Says:

    [...] 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 [...]

  179. 179.   A Student Says:
    \mid Z_{1} \mid
  180. 180.   A Student Says:
    |Z_{1}|
  181. 181.   A Student Says:

    $latex P(A \cup B)[\tex]

  182. 182.   A Student Says:
    P(A \cup B)
  183. 183.   A Student Says:
    P(A\cupB)
  184. 184.   A Student Says:
    P(A\cup B)
  185. 185.   Brad Says:
    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.

  186. 186.   Brad Says:

    Oh, right…

    i \hbar \frac{\partial \boldsymbol{\Psi}}{\partial t} = \Big[ - \frac{\hbar^2}{2m} \nabla^2 + V \Big] \boldsymbol{\Psi} \displaystyle
  187. 187.   Brad Says:

    Oh well, it looks squished.

  188. 188.   andy.s Says:
    \LaTeX
  189. 189.   andy.s Says:

    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 \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.

  190. 190.   notaquant Says:
    \frac{\partial\psi}{\partial t}(t,x)=-\frac{\partial^2\psi}{\partial x^2}(t,x)+V(t,x)\psi(t,x)
  191. 191.   asdfhgh Says:

    [tex]| \psi \rangle[/tex]

  192. 192.   asdfhgh Says:
    | \psi \rangle
  193. 193.   hmm Says:

    [tex]R_{\mu\nu}-\frac{1}{2}Rg_{\mu\nu}=8\pi G T_{\mu\nu}[/tex]

  194. 194.   notaquant Says:

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

  195. 195.   notaquant Says:

    [tex]
    i\hbar\frac{\partial\psi}{\partial t}(t,x)=-\frac{\hbar^2}{2m}\nabla^2\psi(t,x)+V(t,x)\psi(t,x)
    [/tex]

  196. 196.   Successful Researcher: How to Become One Says:

    Just a test: E=m c^2

  197. 197.   macho Says:

    adding a link:

  198. Google News
  • 198.   macho Says:
    cm^3
  • 199.   macho Says:
    GeV/cm^3
  • 200.   chi Says:

    [tex]xinmathbb{R}[/tex]