How-to

How to Align Equations in LaTeX

The fix

To align equations in LaTeX, load \usepackage{amsmath} and use the align environment. Place an & immediately before the character you want aligned (usually =) on every line, and end each line with \\. Use align* to suppress equation numbers.

Example

\usepackage{amsmath}
\begin{align}
  (a+b)^2 &= a^2 + 2ab + b^2 \\
          &= a^2 + b^2 + 2ab
\end{align}

Frequently asked questions

What is the difference between align and align*?

align numbers every line; align* produces no equation numbers. Suppress a single line inside align with \nonumber or \notag before the \\.

My equation is one line — should I use align?

For a single equation use equation (numbered) or \[ ... \] (unnumbered). Use align only when you have multiple lines to align.

How do I align at more than one point?

Columns in align come in (align, gap) pairs, so extra & pairs add alignment points: a &= b &= c aligns at both equals signs.

Try the fix in LetX

Open the editor, paste your code, and compile in 1 second to see the error clear — free, in your browser.

Open LetX Free