Aligning equations
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
Lining equations up
- When you show working, readers like the
=signs to line up. Thealign*environment does this:
\begin{align*}
y &= 2(x + 3) \\
y &= 2x + 6
\end{align*}
- The
&marks where to align (just before each=), and\\ends each line.
Numbered or not
align*(with the star) gives no equation numbers.- Drop the star —
align— and LaTeX numbers each line(1),(2), … for you to refer to.
Matrices
amsmathalso gives matrices.bmatrixdraws square brackets:
\[
\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}
\]
- Again
&separates columns and\\separates rows — the same idea as alignment.
Show the two steps lined up at the = sign. Put them in an align* environment, with & just before each = and \\ between the lines.
Click Run to compile and preview the PDF.