Posted: Feb 20, 2012 4:59 am

Math styles

Symbols can be displayed in one the following styles: \displaystyle{} (for standalone equations), \textstyle{} (for equations in a sentence), \scriptstyle{} (for e.g. sub- and superscripts), and \scriptscriptstyle{} (for e.g. subsub- and supersuperscripts). Latex scales sub- and superscripts automatically, but occasionally the explicit commands \scriptstyle{} and \scriptscriptstyle{} are handy in other situations.

Text and Symbol size

The above styles define relative symbol sizes, which depend on the environment in which they are used. Latex also allows to manually change text font sizes, with the \tiny{}, \scriptsize{}, \small{}, \normalsize{}, \large{}, \Large{}, \LARGE{}, \huge{}, and \Huge{} commands. Surprisingly, MathJax also allows the use of these commands inside formulae.

Text boxes

Normal text can be written inside \text{}. Alternatively, there is the \mbox{} environment, which is almost the same as \text{}. However, unlike the \text{} command, text inside an \mbox{} does not scale when it is part of a sub- or superscript. Math symbols can be used inside a box by putting it between \$ signs; unfortunately MathJax doesn't seem to allow any commands inside a textbox.

\fbox{} is similar to \mbox, but draws a frame around the text.

A more general command to draw frames is \boxed{}, which can be used around any formula.

Unfortunately, MathJax does not support more advanced text boxes, like \makebox{} and \parbox{}. This makes it difficult to write multi-line text; possible tricks are stacking text, or using arrays (see below)

Stacking symbols and text

There are various ways to stack two lines of symbols or text on top of each other. The \substack{} command was used before, but there's also the slightly different { \atop } command.

The size of the symbols is automatically decreased; to change these sizes to normal, put the symbols inside \displaystyle{}. With the \underset{}{} and \overset{}{} commands, you can put smaller-sized symbols or text below/above a normal line:

A similar command is \stackrel{}{}, which puts normal-sized symbols/text on top of a normal line.

\stackrel might help to define new symbols. For instance, MathJax does not support the Angstrom symbol, so we could create one as follows:

This doesn't look very pretty. Fortunately, there's the \mathring{} command, which I forgot to mention among the accents:

I've mentioned the fraction command \frac{}{} before, but the related \tfrac{}{} and \dfrac{}{} are also worth pointing out: they set the font size to small and normal, respectively: