Succumbing to LaTeX

By Sean Carroll | January 22, 2008 8:27 pm

Update: The post below was written back when CV was on its own. Here on the 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_{munu}-frac{1}{2}Rg_{munu}=8pi G T_{munu}[/tex]

should produce

$latex R_{munu}-frac{1}{2}Rg_{munu}=8pi G T_{munu}$.

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:

$latex displaystyle langlelangle hat{mathcal O}ranglerangle =lim_{t rightarrow infty}frac{1}{t}int^t_0 langle psi_s|hat{mathcal O}|psi_srangle ds = rm{tr}(hatrho hat{mathcal O}),, $

$latex displaystyle hatrho = frac{1}{Z} exp{left(-beta hat{H} – sum^n_{i=2} mu_i hat{F}_iright)},.$

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

CATEGORIZED UNDER: Cosmic Variance
  • http://blogs.discovermagazine.com/cosmicvariance/sean/ Sean

    Okay, here goes nothing:

    $latex displaystyle frac{d}{dx}e^x = e^x$.

  • http://blogs.discovermagazine.com/cosmicvariance/sean/ Sean

    Success!

  • Sam

    [ tex] e_ipi=-1 [ /tex]

  • Big Vlad

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

  • http://blogs.discovermagazine.com/cosmicvariance/sean/ Sean

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

  • http://blogs.discovermagazine.com/cosmicvariance/sean/ Sean

    And it’s pi, not PI.

  • Big Vlad

    $latex e^{PI i} = -1 $

  • http://blogs.discovermagazine.com/cosmicvariance/julianne Julianne

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

  • http://tyrannogenius.blogspot.com Neil B.

    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

  • http://blogs.discovermagazine.com/cosmicvariance/sean/ Sean

    Julianne, don’t you mean $latex epsilonnualphahbar$?

  • HB

    $latex zeta(1/2+pi^{-e}+i 10^{500} )=0$

  • Bob Munck

    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?

  • http://christinaslibraryrant.blogspot.com Christina Pikas

    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.

  • Sam Gralla

    $latex 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),dtau,$
    $latex nabla^b h_{ab}=O(mu^2)$

  • Sam Gralla

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

  • http://blogs.discovermagazine.com/cosmicvariance/sean/ Sean

    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?

  • tacitus

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

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

    Have fun.

  • Eugene

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

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

  • http://freiddy.blogspot.com Freiddie

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

  • http://freiddy.blogspot.com Freiddie

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

  • Jerry Boetje

    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.

  • http://blogs.discovermagazine.com/cosmicvariance/sean/ Sean

    Forward slashes on the closing /tex, guys.

    Precision counts!

    $latex epsilon_{123}=1$

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

  • Helge

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

  • Helge

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

  • http://shamuswrites.com Jim

    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.

  • http://shamuswrites.com Jim

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

  • Brad Holden

    $latex i_{775} – z_{850} > 1.5$

    Its hard not to type the $, ( or [

  • http://www.amandabauer.blogspot.com/ astropixie

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

  • seriously

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

  • seriously

    $latex W^{h^{e^{e^{e^{e^{e^{e^{e^{e^{e^{e^e}}}}}}}}}}}$

    $latex W_{h_{o_{o_{o_{o_{o_{o_{o_{o_{o_{o_o}}}}}}}}}}}$

  • http://freiddy.blogspot.com Freiddie

    $latex epsilon_123=1$

  • http://freiddy.blogspot.com Freiddie

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

  • http://freiddy.blogspot.com Freiddie

    $latex epsilon_{123}=1$ Now this must work!

  • Bob Munck

    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.

  • Name (required)

    $latex 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 hat{rho} = frac{1}{Z} mbox{exp} left( beta hat{H} + sum_{i=2}^n mu_i hat{F}_i right) . $

  • Name (required)

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

    $latex 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 hat{rho} = frac{1}{Z} mbox{exp} left( beta hat{H} + sum_{i=2}^n mu_i hat{F}_i right) . $

  • Name (required)

    No, still no good. Excuse the debugging,

    $latex frac{1}{2}$

    $latex int_0^{infty}$

  • Name (required)

    $latex frac{0}{0}$

  • efp

    $latex pi approx ln 6^{ln 5^{ln 4^{ln 3^{ln 2}}}}$

  • http://www.physics.usyd.edu.au/~brewer/ Brendon Brewer

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

  • Sam

    $latex e_{pi i}=-1 $

    second try…

  • Name (required)

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

  • Sam

    $latex e^{pi i}=-1 $

    third try…

  • http://blogs.discovermagazine.com/cosmicvariance/sean/ Sean

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

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

    (with square brackets instead of parentheses) gives

    $latex sum_{n=0}^infty$

    while

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

    gives

    $latex displaystyle sum_{n=0}^infty$

  • Name (required)

    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 $latex trightarrow infty$, with the instantaneous exp. value of a mixed state

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

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

  • Name (required)

    $latex 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) .}

  • Name (required)

    Eureka, it worked!

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

  • TomR

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

  • TomR

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

  • Eric

    $latex S=-frac{T}{2}int d^2zeta sqrt{-gamma} gamma^{ab} h_{ab}$

  • http://www.physics.usyd.edu.au/~brewer/ Brendon Brewer

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

  • http://carlbrannen.wordpress.com/ Carl Brannen

    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&1\1&0end{array}right)$
    and therefore the density matrix state corresponding to it is:
    $latex rho_X = 0.5left(begin{array}{cc}1&1\1&1end{array}right)$

    If it passes this, that’s pretty good…

  • http://carlbrannen.wordpress.com/ Carl Brannen

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

  • http://plasmasturm.org/ Aristotle Pagaltzis

    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.

  • Jason

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

  • Jason

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

  • Christian

    $latex lim_{3rightarrow4}sqrt{3}=2$

  • http://www.diale.org/w3log tca

    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)

  • http://www.diale.org/w3log tca

    Did not work… Sorry!

  • Pingback: LaTeX « Os Manos DALTON

  • Mark

    A limerick:

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

  • Mark

    2nd try:

    A limerick:

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

  • Mark

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

  • feg

    $latex e^{i*pi}+1=0$

  • andy

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

  • andy

    Try again…
    $latex T = left(dfrac{L_ast left(1-Aright)}{ 16pi sigma D^2 }right)^frac{1}{4}$

  • http://www.timeblog.net Joerg

    $latex partial_tvec{v}+[nablacdotvec{v}]=-frac{1}{rho}nablavec{p}-vec{g}-nabla² vec{v}²$

  • http://www.timeblog.net Joerg

    Wow that wasn’t right
    $latex partial_tvec{v}+[nablacdotvec{v}]=-frac{1}{rho}nablavec{p}-vec{g}-nunabla^2 vec{v}^2$

  • Count Iblis

    $latex displaystyleint_{0}^{infty}frac{x^{-p}}{1+x}dx=frac{pi}{sinleft(pi pright)}$

  • Frank Oswalt

    $latex frac{Love – 0}{No Limit}$

  • Erick

    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?

  • Navneeth

    Let $latex epsilon

  • Navneeth

    $latex Let epsilon

  • citrine

    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.

  • efp

    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.

  • efp

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

  • Christina

    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.

  • http://blogs.discovermagazine.com/cosmicvariance/sean/ Sean

    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.

  • http://scienceblogs.com/pontiff Dave Bacon

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

  • http://blogs.discovermagazine.com/cosmicvariance/sean/ Sean

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

  • chemicalscum

    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.

  • chemicalscum

    Yep it’s working for me now.

  • Navneeth

    $latex alphabetagamma$

  • chemicalscum

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

  • chemicalscum

    Oh well I’ll try again later.

  • bswift

    oh, good times…

  • http://mollishka.blogspot.com mollishka

    $latex displaystyle theta_{E}^{2} = frac{4GM}{c^2}frac{D_{LS}}{D_{L}D_{S}}$

  • MedallionOfFerret

    Emulation is the sincerest form of flattery:

    $latex displaystyle langlelangle hat{mathcal O}ranglerangle =lim_{t rightarrow infty}frac{1}{t}int^t_0 langle psi_s|hat{mathcal O}|psi_srangle ds = rm{tr}(hatrho hat{mathcal O}),,$

    $latex displaystyle hatrho = frac{1}{Z} exp{left(-beta hat{H} – sum^n_{i=2} mu_i hat{F}_iright)},.$

  • MedallionOfFerret

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

  • andy

    $latex left[dfrac{abc}{def}right]$

  • andy

    Er… oops…

  • andy

    $latex left[dfrac{abc}{def}right]$

  • andy

    Hmmm… doesn’t like square brackets…

    $latex [ dfrac{abc}{def} ] $
    $latex left [ dfrac{abc}{def} right ] $

  • Count Iblis

    $latex left[A,Bright]=AB – BA$

  • Count Iblis

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

  • Hal S

    $latex P_{avg}$

  • Hal S

    $latex P_{avg}[tex]

  • Hal S

    $latex P_{avg}$

  • Hal S

    $latex P_{avg}=frac{Deltam}{Deltat}c^2=frac{Deltap}{Deltax}c^2$

  • Hal S

    still practicing

    $latex drac{Delta t}$

  • Hal S

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

  • Hal S

    cool

  • 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),$

  • http://freiddy.blogspot.com Freiddie

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

  • http://www.sunclipse.org Blake Stacey

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

  • agm

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

  • http://www.bbc.co.uk/sn/ James Gallagher

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

  • http://www.bbc.co.uk/sn/ James Gallagher

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

  • http://gmunu.wordpress.com aatish

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

  • Hal S

    Electrical theory

  • 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 :) )

  • Ghiret

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

  • James Nightshade

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

  • http://www.sunclipse.org Blake Stacey

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

  • benji

    Quadratic thingy, try 1

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

  • benji

    Cool!

  • andy.s

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

  • andy.s

    Whoo hoo! Worked first time!

    Previews are for wussies!

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

  • http://countiblis.blogspot.com Count Iblis

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

  • http://countiblis.blogspot.com Count Iblis

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

  • Brian

    $latex displaystyle oint_s vec{B} cdot da$

    here goes…

  • chris

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

  • chris

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

  • chris

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

  • chris

    $latex left( begin{tabular}{ll} 1 2\ 1 2end{tabular}right) $

  • chris

    $latex begin{tabular}{ll} 1 left( begin{tabular}{ll}1 2 \ 1 2 end{tabular}right) \ 1 2end{tabular}$

  • chris

    $latex left(begin{tabular}{ll} 1 left( begin{tabular}{ll}1 2 \ 1 2 end{tabular}right) \ 1 2end{tabular}right)$

  • chris
  • chris

    $latex texbf{feel free to axe the above ones if things have become cluttered.}$

  • chris

    $latex textbf{sigma}=right{ left( begin{tabular}{ll}0 1// 1 0end{tabular}right) ,left( begin{tabular}{ll}0 -i// i 0end{tabular}right) , left( begin{tabular}{ll}1 0// -1 0end{tabular}right) right} $

  • chris

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

  • chris

    $latex textbf{sigma}=right( left( begin{tabular}{ll}0 1\ 1 0end{tabular}right) ,left( begin{tabular}{ll}0 -i \ i 0end{tabular}right) , left( begin{tabular}{ll}1 0\ -1 0end{tabular}right) right) $

  • chris

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

  • Seth

    Can’t resist..

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

  • Seth

    Err… that was:

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

    What’s wrong?

  • http://tyrannogenius.blogspot.com Neil B.

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

  • Brian Drell

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

  • glenn

    $latex R_{munu}-frac{1}{2}Rg_{munu}=8pi G T_{munu}$

    hehe. I’m plagiarizing!

  • http://www.bbc.co.uk/sn/ James Gallagher

    I’ll try your formula Seth:

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

    “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 :)

  • http://www.bbc.co.uk/sn/ James Gallagher

    I’ll try your formula Seth:

    $latex sigma(p(P)p(P) to Y + X) = int_0^1dx_1int_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 :)

  • Count Iblis

    Let’s give Seth’s formula another try:

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

  • Count Iblis

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

    $latex sigma(p(P)p(P) rightarrow Y + X) = int_0^1dx_1int_0^1dx_2f_1(x_1)f_2(x_2)sigma(q_1(x_1P)q_2(x_2P) rightarrow Y$

  • Count Iblis

    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:

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

  • http://freiddy.blogspot.com Freiddie

    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_1int_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…):
    $latex sigma(p(P)p(P) rightarrow Y + X) = int_0^1dx_1int_0^1dx_2f_1(x_1)f_2(x_2)sigma(q_1(x_1P)q_2(x_2P) rightarrow Y$
    Does it work?

  • http://freiddy.blogspot.com Freiddie

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

  • http://freiddy.blogspot.com Freiddie

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

  • C

    $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}changenormalcolor}
    rput(-4,-1){color{white}bounding boxnormalcolor}
    end{pspicture}
    $

  • C

    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}changenormalcolor}
    rput(-4,-1){color{white}bounding boxnormalcolor}
    end{pspicture}

  • Count Iblis

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

  • http://freiddy.blogspot.com Freiddie

    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.

  • http://eskesthai.blogspot.com/2008/01/wrapping-energetic-particles-to-cosmos.html Plato

    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.

  • http://eskesthai.blogspot.com/2008/01/wrapping-energetic-particles-to-cosmos.html Plato

    Also see Latex Spoken here for further examination

  • Jason

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

  • http://blogs.discovermagazine.com/cosmicvariance/sean/ Sean

    Shouldn’t that be plus or minus evil?

  • http://www.bbc.co.uk/sn/ James Gallagher

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

    $latex mathrm{girls} = sqrt{mathrm{evil}}^2$

  • Hal S

    $latex langle rangle $

  • Eugene

    $latex U=0[tex]

  • Eugene

    Bah
    $latex U=0$

  • Hal S

    $latex dfrac{h nu}{e^{frac{h nu}{k T}}-1}$

  • Hal S

    $latex 1… $

  • Hal S

    $latex int dfrac{delta E}{T} $

  • Seth

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

  • andy.s

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

  • fishcake

    $latex oint$

  • andy.s

    $latex pi^+ = frac{bar{u}u – bar{d}d}{sqrt{2}}$

  • nuno

    $latex -frac{hbar}{2m}psi+V(x)psi=ihbarfrac{dH}{dt}$

  • nuno

    $latex -frac{hbar^2}{2m}nabla^2psi+V(x)psi=ihbarfrac{dH}{dt}$

  • Traums

    $latex 19 = 1 x 2^4 + 0 x 2^3 + 0 x 2^2 + 1 x 2^1 + 1 x 2^0$

  • Traums

    $latex 19 = 1 * 2^4 + 0 * 2^3 + 0 * 2^2 + 1 * 2^1 + 1 * 2^0$

  • andy.s

    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.

  • andy.s

    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 $

  • andy.s

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

  • Proteus

    $latex G(k,iomega)=intfrac{-1}{pi}frac{G^{”}(k,omega_1)}{iomega-omega_1}$

  • Proteus

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

  • Mike M

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

  • Mike M

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

  • Pingback: Wearing LaTeX « Standard Deviation

  • A Student

    $latex mid Z_{1} mid$

  • A Student

    $latex |Z_{1}|$

  • A Student

    $latex P(A cup B)[tex]

  • A Student

    $latex P(A cup B)$

  • A Student

    $latex P(AcupB)$

  • A Student

    $latex P(Acup B)$

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

  • Brad

    Oh, right…

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

  • Brad

    Oh well, it looks squished.

  • andy.s

    $latex LaTeX$

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

  • notaquant

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

  • asdfhgh

    [tex]| psi rangle[/tex]

  • asdfhgh

    $latex | psi rangle $

  • hmm

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

  • notaquant

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

  • notaquant

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

  • http://aclinks.wordpress.com Successful Researcher: How to Become One

    Just a test: $latex E=m c^2$

  • macho

    adding a link:

  • Google News
  • macho

    $latex cm^3$

  • macho

    $latex GeV/cm^3$

  • chi

    [tex]xinmathbb{R}[/tex]

  • NEW ON DISCOVER
    OPEN
    CITIZEN SCIENCE
    ADVERTISEMENT

    Discover's Newsletter

    Sign up to get the latest science news delivered weekly right to your inbox!

    Cosmic Variance

    Random samplings from a universe of ideas.

    About Sean Carroll

    Sean Carroll is a Senior Research Associate in the Department of Physics at the California Institute of Technology. His research interests include theoretical aspects of cosmology, field theory, and gravitation. His most recent book is The Particle at the End of the Universe, about the Large Hadron Collider and the search for the Higgs boson. Here are some of his favorite blog posts, home page, and email: carroll [at] cosmicvariance.com .

    ADVERTISEMENT

    See More

    ADVERTISEMENT
    Collapse bottom bar
    +

    Login to your Account

    X
    E-mail address:
    Password:
    Remember me
    Forgot your password?
    No problem. Click here to have it e-mailed to you.

    Not Registered Yet?

    Register now for FREE. Registration only takes a few minutes to complete. Register now »