LaTeX Guide

LaTeX Align Equations

Five environments for multi-line math: align, align*, gather, split, equation. Pick by what you need (alignment? numbering? single-equation continuation?).

The decision tree

What you wantEnvironment
Single numbered equationequation
Single unnumbered equationequation* or \[ \]
Multiple aligned equations, numberedalign
Multiple aligned equations, unnumberedalign*
Multiple unrelated equations centeredgather
One long equation split across linesequation + split

align — the most useful one

\usepackage{amsmath}

\begin{align}
  a &= b + c \\
  d &= e + f + g \\
  h &= i
\end{align}

The & marks the alignment column (here, the equals signs). Each line ends with \\. The result has all three = signs vertically aligned, with each line numbered (1), (2), (3).

align* — same alignment, no numbers

\begin{align*}
  a &= b + c \\
  d &= e + f
\end{align*}

gather — center each, no alignment

\begin{gather}
  a = b + c \\
  d = e + f + g
\end{gather}

split — one long equation

\begin{equation}
\begin{split}
  f(x) &= a_0 + a_1 x + a_2 x^2 \\
       &\quad + a_3 x^3 + a_4 x^4 + a_5 x^5
\end{split}
\label{eq:expansion}
\end{equation}

Whole thing gets one equation number. Reference with \eqref{eq:expansion}.

Mixed numbering

\begin{align}
  a &= 1 \label{eq:first} \\
  b &= 2 \nonumber \\
  c &= 3 \label{eq:third}
\end{align}

Lines 1 and 3 get numbers. Line 2 has \nonumber so it's skipped.

Common mistakes

  • Forgetting amsmath. align, gather, split all need \usepackage{amsmath}.
  • Trailing \\ on the last line. Causes "Misplaced \noalign" error. Remove it.
  • Using eqnarray. Old, deprecated, looks worse than align. Use align.
  • Forgetting the &. Without &, align falls back to a single column with no alignment.
In Typst, alignment is & (no environments)
$
  a &= b + c \
  d &= e + f + g \
  h &= i
$

No \begin/\end, no package import. Just $ ... $ with & for alignment. Try TypeTeX free.

Try TypeTeX free

Frequently Asked Questions

How do I align equations in LaTeX?

Use the align environment from amsmath: \begin{align} a &= b + c \\ d &= e \end{align}. The ampersand & marks the alignment column — the equals signs (or whatever you align on) line up vertically. Each line ends with \\ except the last.

What's the difference between align and align*?

align numbers each line: (1), (2), (3). align* leaves them unnumbered. To suppress numbering on individual lines within align, use \nonumber or \notag at the end of that line.

How do I split a long single equation across multiple lines?

Use the split environment inside equation: \begin{equation} \begin{split} long expression that doesn't fit \\ continuation \end{split} \end{equation}. The whole thing gets one equation number. Use & to align the continuation.

What's gather and when do I use it?

gather centers each equation independently (no alignment column). Use it when you have multiple unrelated equations that don't need to align: \begin{gather} a = 1 \\ b = 2 \\ c = 3 \end{gather}. align is for related equations; gather is for a list of standalone equations.

How do I align on multiple symbols (not just =)?

Use multiple & in each line: \begin{align} a &= 1 &\quad b &= 2 \\ c &= 3 &\quad d &= 4 \end{align}. The first & aligns the first column, the second & aligns the second. \quad adds horizontal spacing between groups.

Why does my align environment break with 'Misplaced \noalign' error?

You probably used \\ at the end of the last line. The last \\ is unnecessary and causes the error. Remove it and the environment compiles cleanly.

How do I number some align lines but not others?

Use align (numbered by default), then add \nonumber or \notag at the end of lines you want unnumbered: a &= 1 \\ b &= 2 \nonumber \\ c &= 3. Lines 1 and 3 get numbers; line 2 doesn't.

How do I label equations for cross-referencing?

Add \label{eq:name} after \\ on the line you want to reference, then use \eqref{eq:name} in text: 'See equation~\eqref{eq:foo} for the result.' \eqref produces (1) automatically — better than \ref which gives just '1'.

Do I need to load amsmath?

Yes, for align, gather, split, eqref, and most multi-line environments. Add \usepackage{amsmath} to your preamble. Most modern LaTeX templates load it by default.

More LaTeX guides