# Knowledge Base: Including Mathematics in Posts

Ratburger.org supports MathJax, which permits including beautifully typeset mathematics in posts and comments (but not, at present, in group posts or comments).  For example, here is Einstein’s gravitational field equation:

$$\displaystyle R_{\mu\nu} – \frac{1}{2}g_{\mu\nu}R + \Lambda g_{\mu\nu}= \frac{8\pi G}{c^4}T_{\mu\nu}$$

To display this, in the post composition window I wrote:

$\displaystyle R_{\mu\nu} – \frac{1}{2}g_{\mu\nu}R+ \Lambda g_{\mu\nu} = \frac{8\pi G}{c^4}T_{\mu\nu}$

where the text within square brackets are WordPress “shortcodes” which indicate the text they enclose is mathematical notation written in the LaTeX document preparation language.  For information on how to write mathematics in LaTeX, see chapter 3 of The Not So Short Introduction to $$\LaTeX 2_\epsilon$$ [PDF].

The “\displaystyle” in the equation definition above causes it to be typeset to appear on a line by itself in large type.  If omitted, the equation is set in in-line style, suitable for inclusion in a line of text.  For example, here is the quadratic equation $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$ which was specified by the code:

$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$

Note that you can use the $code$ facility for simple things like superscripts and subscripts, as in $$_{~~55}^{137}\rm Cs$$ for the isotope of Cæsium with atomic number 55 and weight 137, produced with:

$_{~~55}^{137}\rm Cs$

(The tildes are to right-justify the atomic number, as chemists do.)

4+

## Author: John Walker

Founder of Ratburger.org, Autodesk, Inc., and Marinchip Systems. Author of The Hacker's Diet. Creator of www.fourmilab.ch.

## 7 thoughts on “Knowledge Base: Including Mathematics in Posts”

1. It’s nice to see the field equations so nicely set but they should include the cosmological constant. Einstein was right about that after all.

1+
2. It’s nice to see the field equations so nicely set but they should include the cosmological constant.

Fixed it!

0

3. What is the cosmological constant? I am asking for a “friend”.

0

4. What is the cosmological constant? I am asking for a “friend”.

Gravitation is like The Force, or duct tape: it has a light side (photons and baryonic matter) and a dark side (dark matter), and it binds the universe together.

The cosmological constant (dark energy) $\Lambda$ in the equation in the original post is like WD-40: it causes everything to slippy-slide away from one another.

(Note to physicists: I’m aware there are many other potential explanations for the observed acceleration in expansion of the universe other than Einstein’s cosmological constant, and there are insufficient data to conclude $\Lambda$  does not change over time.  This is a reply to a light-hearted comment, not a paper on ArXiV.)

2+
5. @John Walker, asking for a friend, are you anticipating a high need for the ability to properly typeset mathematical notations in Ratburger.org posts?  Curious … and a little nervous.

2+
6. Only in the footnotes.

The Devil is in the footnotes.

1+
7. @MJBubba, will I be safe from the Devil if I only read books without footnotes?

0