Knowledge Base: Including Mathematics in Posts 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:

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

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:

[latex]x = {-b \pm \sqrt{b^2-4ac} \over 2a}[/latex]

Note that you can use the [latex]code[/latex] 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:

[latex]_{~~55}^{137}\rm Cs[/latex]

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


Users who have liked this post:

  • avatar
  • avatar

Author: John Walker

Founder of, Autodesk, Inc., and Marinchip Systems. Author of The Hacker's Diet. Creator of

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. 


    Users who have liked this comment:

    • avatar
  2. @10Cents:

    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) [latex]\Lambda[/latex] 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 [latex]\Lambda[/latex]  does not change over time.  This is a reply to a light-hearted comment, not a paper on ArXiV.)


    Users who have liked this comment:

    • avatar
  3. @John Walker, asking for a friend, are you anticipating a high need for the ability to properly typeset mathematical notations in posts?  Curious … and a little nervous.


    Users who have liked this comment:

    • avatar

Leave a Reply