# Hypertext Help with LaTeX

Math Formulas

There are four environments that put LaTeX in math mode:

All four of these environments are typeset in math
mode, using a math italic font and LaTeX
ideas about spacing in math mode. (See also math
fonts and styles.)
The math environment is for formulas that
appear right in the text. The displaymath, eqnarray, and equation
environments are for formulas that apppear on their own line(s).
The math environment can be used in both paragraph and LR mode, but
displaymath, eqnarray, and equation environments can be used only
in paragraph mode.

The math environment may be specified, as with all environments, by
`\begin{math} math equation \end{math}`

However, it is used so often that it has two equivalent shorter forms:
`\( math equation \)`

or just
`$ math equation $`

In LaTeX2e one can also use
`\ensuremath{math equation}`

For example,
Subscripts and
superscripts can only be used in math
mode. To include these in running text one could use:

`The formula for water is H$_2$O.
If the hypotenuse is $c$, then $c^2=a^2+b^2$.`

Note that it is standard to use math mode for letters, such as the
the `$c$` above, which are math variables.
Long sequences in the math environment may be broken over multiple lines
with a `\\` command.

## Related topics

Back to the Table of Contents

Last updated: Rolf Jansen & Brian Josephson 23 Sep 2011.