Posted: Feb 20, 2012 7:00 am
by Pulsar
[math]

Colors

MathJax allows different colors, with the command \color{color}{text} (this syntax is different from standard Latex). I don't know which colors are permitted, but all of these work, and probably more:

[math]

Arrays

The \begin{array}{} \end{array} environment is very useful to create content in several rows and columns. Each column can be left-, right- or center- aligned, which has to be specified with l,r,c respectively inside the brackets following \begin{array}. For example, \begin{array}{l r c} starts an array with three columns; column 1 is left-aligned, column 2 is right-aligned and column 3 is center-aligned. Columns are separated with the ampersand & symbol, and a row is ended by a linebreak \\. Two common examples are

[math]

and matrices

[math]

In fact, these examples are so common that Latex contains special commands for them: the first example can be written with the \begin{cases} \end{cases} environment, which also takes care of the initial left bracket (and notice that the lines are slightly closer to each other). No column format specification is needed: cases always defines two left-aligned columns.

[math]

Matrices can be defined with the \begin{pmatrix} \end{pmatrix} environment, which includes the parentheses, and defines every column as center-aligned:

[math]

Apart from pmatrix, there are also matrix, bmatrix, vmatrix, Bmatrix, Vmatrix, and smallmatrix.

[math]

With the array environment, one can simulate multi-line text:

[math]

This example also contains the \textit{} and \textbf{} commands, to write italics and bold text.

Finally, the array environment can serve to create a simple table. One can add vertical lines by adding | symbols in the column format header, and horizontal lines with the \hline command inside the array.

[math]

-------------------------------------------------------------------------

I think I have now covered most of the Latex formatting that is currently possible with MathJax.

A full overview of Latex commands supported by MathJax can be found here:

http://www.mathjax.org/docs/1.1/tex.html#supported-latex-commands

If you have any comments, questions or additions, feel free to post!