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:
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
.
Note the forward slash in the closing [/tex]! TeX-like commands use backslashes, but html-like commands use forward slashes.
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:
Kind of beautiful, in an austere way, don’t you think?
Okay, here goes nothing:
Success!
[ tex] e_i\pi=-1 [ /tex]
[tex] e^{\PI i} = -1 [\tex]
Shouldn’t have any spaces between the “[” and the “tex” or “\tex”.
And it’s \pi, not \PI.
This has to be the most fabulously geeky comment thread, EVAH!
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
Julianne, don’t you mean
?
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?
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.
Oh yeah, first try. I’m a winner.
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?
…and utter gobbledygook to physics and maths illiterates like me
Have fun.
I see your density matrices and raise you a unitary operator, stuff that I am thinking about
[tex]i\frac{\partial}{\partial t} U(t,t’) = H_I(t)U(t,t’)[\tex]
[tex]\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.
[tex]\epsilon_{123}=1[\tex] Trying again
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.
Forward slashes on the closing /tex, guys.
Precision counts!
And yes, the first example is Einstein’s equation of general relativity.
[tex] det\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = -1 {\tex]
sucks.
[tex] det\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = -1 [\tex]
sucks.
Sean, this is fabulous! I’ve been looking for a host that has [tex]\LaTeX[\tex] installed. InMotion may be exactly what I’ve been looking for and may prompt a server switch in the very near future.
Huh, I think I got the ending tag wrong (it’s counterintuitive). It should have been
.
Its hard not to type the $, \( or \[
“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!!
[tex]W^{h^{e^{e^{e^{e^{e^{e^{e^{e^{e^{e^e}}}}}}}}}}}[\tex]
[tex]W_{h_{o_{o_{o_{o_{o_{o_{o_{o_{o_{o_o}}}}}}}}}}}[\tex]
[tex]\epsilon_{123}=1[\tex] Now this should work
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.
Hmm, seems to evaluate as inline LaTeX for some reason. Maybe it’s the html tags?
No, still no good. Excuse the debugging,
Hmm, looks like Sean’s thinking about the long-term time averages of certain quantities in quantum statistical mechanics. I wonder why?
second try…
[tex]\begin{displaystyle} \frac{1}{\pi} \int_0^\pi \cos \left( n t - x \sin t \right) dt \end{displaymath}{/tex]
third try…
It’s really just “\displaystyle”; e.g.
(tex)\sum_{n=0}^\infty(/tex)
(with square brackets instead of parentheses) gives
while
(tex)\displaystyle \sum_{n=0}^\infty(/tex)
gives
Oh well.
Apparently he’s relating the long-term time average of a pure-state expectation value in the limit
, with the instantaneous exp. value of a mixed state
where
looks like a partition function, with n-1 funny-looking terms added to the hamiltonian
The last time Sean blogged thermodynamics, it was about Boltzmann brains. Maybe these are quantum Boltzmann brains.
[tex]\displaystyle{ \hat{\rho} = \frac{1}{Z} \mbox{exp} \left( \beta \hat{H} + \sum_{i=2}^n \mu_i \hat{F}_i \right) .}
Eureka, it worked!
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
where
is the so-called Debye screening length of the plasma
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
where
is the so-called Debye screening length of the plasma
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).
The essence of the pure density operator formalism: States are operators instead of vectors. Example:
. Example: 
Let
be an operator that squares to 1. Then
is (an opeartor and is also) an eigenstate of
with eigenvalue
. Example, spin 1/2 in the X direction has the operator:


and therefore the density matrix state corresponding to it is:
If it passes this, that’s pretty good…
Hmm. ampersands sort of don’t work in the definition of arrays, they get an extra “amp;” .
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.
Very nifty.
[Unparseable or potentially dangerous latex formula. Error 5 : 501x140]
Well, it worked in my term paper… ah, well.
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)
Did not work… Sorry!
[…] 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 […]
A limerick:
2nd try:
A limerick:
And of course I get the formatting right but screw up the formula.
Hmm… not sure I know how this works, but…

Try again…

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 \partial_t\vec{v}+[\nabla\cdot\vec{v}]=-\frac{1}{\rho}\nabla\vec{p}-\vec{g}-\nu\nabla^2 \vec{v}^2](/latexrender/pictures/60bfceb0262b8ace2c88231a860be903.gif)
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?
Let [tex]\epsilon
[tex]Let \epsilon
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.
Re #71 & #74:
http://www.mackichan.com
It’s commercial, but its <bad french accent> very nice </bad french accent>
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.
Damn, what this blog needs is a preview button…
wrt feed (sorry slow to get back to this), on bloglines, I’m sub’d to: http://cosmicvariance.com/?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.
Frank Oswalt wins.
Christina, it seems to work with
http://cosmicvariance.com/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.
I see no equations using IE 7.0. There is a javascript error: Line 56, ‘document.getElementById(..) is null or not an object’
Sorry, I think that was my fault — tried to mess with a preview plugin, and mistakenly deactivated the latex plugin. Should be okay now.
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.
Yep it’s working for me now.
OK lets give it a try see if I can get some Dirac Notation:
[Unparseable or potentially dangerous latex formula. Error 2 ]
Oh well I’ll try again later.
oh, good times…
Emulation is the sincerest form of flattery:
I also do “The rain in Spain falls mainly on the plain” quite well.
[Unparseable or potentially dangerous latex formula. Error 2 ]
Er… oops…
[Unparseable or potentially dangerous latex formula. Error 2 ]
Hmmm… doesn’t like square brackets…
[Unparseable or potentially dangerous latex formula. Error 2 ]
[Unparseable or potentially dangerous latex formula. Error 2 ]
So, I think it may be the dfrac command, Andy
[tex]P_{avg}[\tex]
still practicing
cool
with the action
I’m seeing all sorts of familiar and unfamiliar maths here! Hey, is that a Lie bracket?
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. . . .
Sean, I vote for Christian (#57) winning the thread. For the obvious reason.
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.
For the pedantic, let’s make that Hamiltonian explicitly time dependent
I discovered latex on wordpress recently, so I’ve been going latex crazy on my website.
Electrical theory
So, as you say in your book, covariant derivative of
is:
I think, but I suppose I don’t remenber index placement really.
(anyway, I was just trying latex
)
Mmm,
should be down… :S
Now, the real question is, can we use LaTeX to write a Hamiltonian for the Quantum of Solace?
Quadratic thingy, try 1
Cool!
Whoo hoo! Worked first time!
Previews are for wussies!
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.
I meant to say:
here goes…
[tex]\begin{tabular}{ll} 1 2\\ 1 2\end{tabular}
[tex]\begin{tabular}{ll} 1 2\\ 1 2\end{tabular}[\tex]
[tex]\texbf{feel free to axe the above ones if things have become cluttered.}[/tex
That would have been a lot more impressive had it worked.
Okay, so much for that. Sorry about the big white splotches, you might want to get rid of them. Congrats on getting the latex!
Can’t resist..
[Unparseable or potentially dangerous latex formula. Error 5 : 545x24]
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?
It looks like everyone forgot or overlooked my question at #9, LMK if you have an answer, tx
[tex]E=\frac{n^2\pi^2\hbar^2}{2mL^2}[\tex]
hehe. I’m plagiarizing!
I’ll try your formula Seth:
[tex]\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[tex]
“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

I’ll try your formula Seth:
[Unparseable or potentially dangerous latex formula. Error 5 : 545x24]
“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

Let’s give Seth’s formula another try:
[tex]\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]
OOps, made a trivial error, let’s try again:
[Unparseable or potentially dangerous latex formula. Error 5 : 545x24]
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:
[Unparseable or potentially dangerous latex formula. Error 5 : 545x24]
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…):
[Unparseable or potentially dangerous latex formula. Error 5 : 545x24]
Does it work?
Hey, it works! (I broke the entire formula into multiple pieces of [ tex ] and [ /tex ].
[Unparseable or potentially dangerous latex formula. Error 1 ]
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}
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
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.
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.
Also see Latex Spoken here for further examination
Excellent! Now I can submit the proof that girls are evil:
Shouldn’t that be plus or minus evil?
Nope, it’s +evil, he made a slight error in the formatting, it should be
[tex]U=0[\tex]
Bah

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.)
I must say, Sean, the Google Ads sidebar comes up with some interesting associations from the repeated use of the word “Latex”.