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.

LaTeX
\begin{align}
  2x + 3 &= 11 \\
      2x &= 8 \\
       x &= 4
\end{align}
OutputThree steps of solving 2x plus 3 equals 11, aligned at the equals signs and numbered 1 to 3.

Needs \usepackage{amsmath} in the preamble.

Full document you can compile
example.tex
\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.

LaTeX
\begin{align*}
  f(x) &= x^2 + 2x + 1 \\
       &= (x + 1)^2
\end{align*}
Outputf of x equals x squared plus 2x plus 1 equals x plus 1 squared, aligned and unnumbered.

Needs \usepackage{amsmath} in the preamble.

Full document you can compile
example.tex
\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.

LaTeX
\begin{equation}
  \left\{
  \begin{aligned}
    x + y &= 10 \\
    x - y &= 2
  \end{aligned}
  \right.
\end{equation}
OutputA system of two equations, x plus y equals 10 and x minus y equals 2, with a left brace and one number.

Needs \usepackage{amsmath} in the preamble.

Full document you can compile
example.tex
\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.

LaTeX
\begin{align}
  a &= b + c   &  d &= e - f \\
  g &= h       &  k &= m n
\end{align}
OutputTwo columns of equations side by side, each column aligned at its equals signs.

Needs \usepackage{amsmath} in the preamble.

Full document you can compile
example.tex
\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.

LaTeX
\begin{align}
  y &= mx + b \\
\intertext{and, after moving $b$ to the left,}
  y - b &= mx
\end{align}
Outputy equals mx plus b, then the text "and, after moving b to the left,", then y minus b equals mx, still aligned.

Needs \usepackage{amsmath} in the preamble.

Full document you can compile
example.tex
\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.

Text drafted with AI from the amsmath documentation; every example compiled with TeX Live 2026; checked by Cem Demir. See the editorial policy.