How to Align Equations in LaTeX
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.
Not sure it worked on your document? Paste it into LetX and compile it, free and in the browser.
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.
Related LaTeX fixes
Browse all LaTeX problems & fixes, or start with the LaTeX guide.
Learn the topic properly
Try the fix in LetX
Open the editor, paste your code, and compile in seconds to see the error clear. Free, in your browser.
Open LetX Free