# Including Mathematics in Topics and Replies

SCANALYST supports MathJax, which permits including beautifully typeset mathematics in topics and replies. For example, here is Einstein’s gravitational field equation:

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 topic composition window I wrote:

$$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 double dollar signs, which must be written on lines by themselves, indicate the text they enclose is mathematical notation 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 double dollar signs cause the math to be typeset to appear on a line by itself in large type. If single dollar signs are used, 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 MathJax 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.)

MathJax mathematics only works within paragraphs written in the default Markdown mark-up language. If a paragraph contains any HTML mark-up, it will not be recognised. You can use this if for some reason you have text containing dollar signs that might be misinterpreted: just wrap the text in <span> </span> and it won’t be treated as mathematics.

4 Likes