Align in LaTeX
To align in LaTeX, load amsmath and write the equations inside align. Put & just before the sign you want lined up, usually =, and end every line except the last with \\. Each line gets its own number.
\begin{align}
2x + 3 &= 11 \\
2x &= 8 \\
x &= 4
\end{align}Needs \usepackage{amsmath} in the preamble.
Full document you can compile
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
2x + 3 &= 11 \\
2x &= 8 \\
x &= 4
\end{align}
\end{document}Where does the & go?
Before the relation sign: 2x &= 8. That way LaTeX keeps the right spacing around =. Placing it after, as 2x =& 8, squeezes the space on the right side. Every line needs its & at the same sign, or the lines drift apart.
How do you remove the equation numbers?
Use align* to number nothing, or keep align and add \notag on the lines that shouldn't be numbered. The star form suits a derivation where only the result matters.
\begin{align*}
f(x) &= x^2 + 2x + 1 \\
&= (x + 1)^2
\end{align*}Needs \usepackage{amsmath} in the preamble.
Full document you can compile
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
f(x) &= x^2 + 2x + 1 \\
&= (x + 1)^2
\end{align*}
\end{document}What is the difference between align and aligned?
align is a whole display and numbers each line. aligned is a block that goes inside another formula, such as equation, so the group gets one number and can sit next to a brace for a system of equations.
\begin{equation}
\left\{
\begin{aligned}
x + y &= 10 \\
x - y &= 2
\end{aligned}
\right.
\end{equation}Needs \usepackage{amsmath} in the preamble.
Full document you can compile
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\left\{
\begin{aligned}
x + y &= 10 \\
x - y &= 2
\end{aligned}
\right.
\end{equation}
\end{document}How do you align in LaTeX across several columns?
Use more & signs. In align, they alternate: the first marks an alignment point, the second starts a new column of equations, the third an alignment point in that column, and so on.
\begin{align}
a &= b + c & d &= e - f \\
g &= h & k &= m n
\end{align}Needs \usepackage{amsmath} in the preamble.
Full document you can compile
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
a &= b + c & d &= e - f \\
g &= h & k &= m n
\end{align}
\end{document}How do you add text between aligned lines?
\intertext{…} places a line of normal text between two lines of an align without breaking the alignment, so the equations below still line up with the ones above.
\begin{align}
y &= mx + b \\
\intertext{and, after moving $b$ to the left,}
y - b &= mx
\end{align}Needs \usepackage{amsmath} in the preamble.
Full document you can compile
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
y &= mx + b \\
\intertext{and, after moving $b$ to the left,}
y - b &= mx
\end{align}
\end{document}When is gather better than align?
When the equations are unrelated and should each be centered. gather takes no &; its lines are separated only by \\. For a grid of numbers rather than equations, write a matrix in LaTeX.
How do you break one long equation instead?
For a single equation that is too long for the line, split and multline work better; the equation line break guide compares them. The equation editor and the LaTeX to HTML converter both handle align and aligned.
Sources
- User’s Guide for the amsmath Package (CTAN), read Nov 28, 2026
Text drafted with AI from the amsmath documentation; every example compiled with TeX Live 2026; checked by Cem Demir. See the editorial policy.