Environments
There are quite a lot of useful environments.
Align
\usepackage{amsmath}
\begin{align*}
2 + 2 &= 4 \\
4 &= 2 + 2
\end{align*}
The &
is the alignment character.
\[
\begin{align}
2 + 2 &= 4 \\
4 &= 2 + 2
\end{align}
\]
Array
This environment needs to be nested within a math environment, such as $$
.
\begin{array}{ccc}
2 &= &2 \\
4 &= &4
\end{array}
The &
divides the equation like slices.
The \(\{ccc\}\) means 3 characters which are centered.
Alternatively, we can write \(r\) for right and \(l\) for left.
\[
\begin{array}{ccc}
2 &= &2 \\
4 &= &4
\end{array}
\]
Center
It is used to center objects.
\begin{center}
\end{center}
Alternatively:
\centering