How to Add Line Breaks in LaTeX Equations (amsmath Guide)

Updated Tested on TeX Live 2025 (pdfLaTeX), Oct 2026 7 min read

Quick answer

To break a long equation in LaTeX, load amsmath and use an environment that accepts a double backslash: multline for one long equation, split inside equation for aligned lines under one number, or align for several aligned equations. A double backslash inside a plain equation environment is ignored, so the formula stays on one line.

Long formulas that overflow the margin are the most common LaTeX maths problem. The fix is choosing the right amsmath environment, not adding \\ to equation.

What you’ll learn

All examples need \usepackage{amsmath} in the preamble. They compile the same with pdfLaTeX, XeLaTeX and LuaLaTeX, locally or on Overleaf.

Why a double backslash doesn’t work in equation

The equation environment typesets exactly one line. A \\ inside it is ignored, so this stays on a single line:

\begin{equation}
a^2 + b^2 = c^2 \\
+ d^2
\end{equation}

The output is a^2 + b^2 = c^2 + d^2 on one line with number (1). To get two lines under the same number, wrap the content in split:

\begin{equation}
\begin{split}
a^2 + b^2 = c^2 \\
+ d^2
\end{split}
\end{equation}

Equation broken into two lines with split: the first line a squared plus b squared equals c squared, the second line plus d squared right-aligned below it, with a single number (1) on the right

Without an &, split right-aligns every line. Add & to choose the alignment point, as in the split section below.

Break one long equation with multline

Use this when a single equation is too long and there is no natural alignment point.

\begin{multline}
a + b + c + d + e = \\
x + y + z
\end{multline}

multline output: the first line a plus b plus c plus d plus e equals is flush left, the second line x plus y plus z is flush right with equation number (1)

Result: the first line is flush left, the last line is flush right, and any middle lines are centred. The equation gets one number, on the last line.

  • multline never breaks lines for you; each \\ is a break you choose.
  • Break before a binary operator such as +, and start the next line with it.
  • multline* removes the number.

Align steps under one number with split

Use this for a derivation where each line continues the previous one and the whole block needs one number.

\begin{equation}
\begin{split}
E &= mc^2 \\
&= m \cdot (3 \times 10^8)^2 \\
&= 9 \times 10^{16} \cdot m
\end{split}
\end{equation}

split inside equation: three lines aligned at the equals signs, E equals m c squared, equals m times 3 times 10 to the 8 squared, equals 9 times 10 to the 16 times m, with one equation number (1) on the right

Result: the lines align at &, and the single number sits to the right, vertically centred on the block.

  • split must sit inside equation (or another display such as equation*).
  • Use one & per line.
  • For several columns or a block that isn’t the whole display, use aligned instead.

Align several equations with align

Use this for a system of equations or a list of results, each with its own number.

\begin{align}
x_1 + y_1 &= z_1 \\
x_2 + y_2 &= z_2
\end{align}

align environment output: two equations aligned at the equals sign, x1 plus y1 equals z1 and x2 plus y2 equals z2, numbered (1) and (2)

Result: every line is aligned at & and gets its own number.

  • Put \notag (or \nonumber) on a line to skip its number.
  • Use align* to remove all numbers.
  • Add text between lines without breaking the alignment with \intertext{...}:
\begin{align}
f(x) &= (x+1)^2 \\
\intertext{and after expanding,}
&= x^2 + 2x + 1
\end{align}

Center lines with gather

Use this when you have several short equations that should be centred, not aligned.

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

Result: each line is centred and numbered. gather* removes the numbers.

aligned for one number on an aligned block

aligned works like align but goes inside equation, so the block gets one number:

\begin{equation}
\begin{aligned}
x + y &= 5 \\
2x - y &= 1 \\
3x + 4y &= 9
\end{aligned}
\end{equation}

Prefer this to an array with rl columns. In array, the = sits in a separate column and loses its normal spacing:

array with rl columns: x plus y, 2x minus y and 3x plus 4y right-aligned in one column, with equals 5, equals 1 and equals 9 in a second column after a visible gap

An array{rcl} puts = in its own centred column, which works but spaces it more widely than align:

\[
\begin{array}{rcl}
a + b + c &=& d + e + f \\
& & {}+ g + h
\end{array}
\]

array with rcl columns: a plus b plus c equals d plus e plus f on the first line, and plus g plus h on the second line under the right-hand side

cases for piecewise functions

cases (also from amsmath) breaks a definition into one line per condition:

\[
f(x) =
\begin{cases}
x^2 & \text{if } x < 0 \\
2x + 1 & \text{if } 0 \leq x < 3 \\
9 & \text{if } x \geq 3
\end{cases}
\]

Automatic breaks with breqn

The breqn package’s dmath environment chooses line breaks for you:

\usepackage{breqn}
...
\begin{dmath}
y = a_1 x + a_2 x^2 + a_3 x^3 + a_4 x^4 + a_5 x^5 + a_6 x^6 + a_7 x^7 + a_8 x^8
\end{dmath}

It is handy for very long sums, but it changes how maths is processed. Load it after your other maths packages and check the output.

Which environment should you use?

EnvironmentAlignmentNumberingUse it for
multlineFirst line left, last right, middle centredOne numberA single equation too long for one line
split (inside equation)At &One number for the blockA derivation under one number
alignAt &One per line (\notag to skip)Systems and lists of equations
aligned (inside equation)At &One for the blockAn aligned block inside another display
gatherEach line centredOne per lineSeveral short, unrelated equations
casesValues and conditions in two columnsFollows the outer displayPiecewise definitions
multlined (mathtools)Like multlineFollows the outer displayA multline layout inside equation or align
dmath (breqn)AutomaticOne numberVery long formulas you don’t want to break by hand

Overleaf’s guide to aligning equations with amsmath has more examples.

Break long inline equations

Use this when a formula inside a paragraph runs past the margin.

TeX can already break inline maths after a relation such as = and after a binary operator such as +. If a formula still overflows, it has no such points where a break is needed.

  • Insert \allowbreak where a break is acceptable: $x_1 x_2 x_3 \allowbreak x_4 x_5$.
  • Split the formula into two $...$ pieces at a natural point.
  • If it’s long enough to need several breaks, move it to display maths with \[ ... \]:
The equation
\[
y = mx + b + \sqrt{a^2 + b^2 + c^2 + d^2 + e^2 + f^2}
\]
is crucial.

Paragraph text The equation, then the formula y equals m x plus b plus the square root of a squared through f squared centred on its own line, then is crucial

Use \[ ... \] rather than $$ ... $$. The double-dollar form is plain TeX; in LaTeX it gives inconsistent spacing and ignores options such as fleqn.

Spacing commands inside equations

Spacing commands adjust the gaps inside a line; they don’t break it.

CommandSpaceExample use
\!Negative thin space (tightens)\int\!\!\int
\,Thin spacef(x)\,dx
\:Medium spaceBetween grouped terms
\;Thick spaceBefore a condition
\quad1 emBetween an equation and a note
\qquad2 emBetween two equations on one line
\hspace{10pt}Exactly the given lengthMatching a style guide
\[
A = B \quad \text{(where $B$ is a constant)} \quad C = D + E
\]

Display with A equals B, a quad space, the note where B is a constant, another quad space, then C equals D plus E

\[
A = B + \hspace{10pt} C
\]

A equals B plus C with a visibly wider 10-point gap between the plus sign and C

Common errors

  • \\ ignored, everything on one line: you used \\ in equation. Switch to split, multline or align.
  • Environment multline undefined (or align, split): add \usepackage{amsmath} to the preamble.
  • Misplaced alignment tab character &: you used & in equation, which doesn’t align. Remove it or switch to align or split.
  • Extra alignment tab has been changed to \cr: too many & on a line, for example two in split or any in multline. split allows one & per line; use align for several columns.
  • Number on every line when you wanted one: use split or aligned inside equation instead of align.

The amsmath package documentation covers every environment in detail.

If you need these equations outside LaTeX, you can convert LaTeX equations to editable Word equations or render LaTeX equations in Google Docs. The same environments also work in Jupyter notebooks. More formatting help is in the LaTeX guides.

Frequently asked questions

Why does \\ not break the line inside an equation environment?

The equation environment holds a single line, so LaTeX ignores \\ there. Wrap the content in split, or use multline or align instead.

How do I number only one line of an align environment?

Add \notag before the \\ of each line that should not get a number. To remove all numbers, use align* instead.

Can LaTeX break long equations automatically?

Not in display maths with amsmath; you choose the break points. The breqn package and its dmath environment can choose breaks automatically.

How do I break a long inline equation?

TeX already breaks inline maths after relations such as = and binary operators such as +. To allow a break elsewhere, insert \allowbreak at that point.

What is the difference between align and aligned?

align is a standalone display that numbers every line. aligned goes inside equation or another display, so the whole block gets a single number.