Written and maintained by CASRAI Editorial Board
Last updated
To start a new line inside a LaTeX equation, put a double backslash (\\) where the line should break, and use an amsmath environment that accepts line breaks. Which environment you pick depends on whether you have one long equation or several equations, and whether you want equation numbers.
What it is used for in research
Long derivations, multi-step proofs and systems of equations rarely fit on one line of a manuscript. Overleaf’s documentation states that “the double backslash works as a newline character” in these environments, and the amsmath package supplies the environments that make the break look right. If your paper is mathematical, see also the conventions for mathematics papers and the end-of-proof symbol in LaTeX.
Which environment to use
Use the table to pick the environment first; the steps below show each one.
| Situation | Environment | Behaviour (per Overleaf) |
|---|---|---|
| One equation, steps aligned in columns | split inside equation |
Breaks and aligns an equation “just as if the parts of the equation were in a table” |
| One equation too long for a line | multline |
Break points are set with a double backslash; the first part is left-aligned and the last part right-aligned |
Several equations aligned at = |
align |
& marks where the equations are vertically aligned |
| Several equations, centred, no alignment | gather |
Centres consecutive equations |
Install or access (official source only)
The environments on this page come from the amsmath package. CTAN describes amsmath as “the principal package in the AMS-LaTeX distribution”, maintained by The LaTeX Project Team under the LPPL 1.3c licence, with a user guide (amsldoc.pdf) on its CTAN page. Load it in the preamble:
\usepackage{amsmath}
Overleaf’s documentation shows the same line in its examples, and notes that the starred form equation* is provided by amsmath.
Step-by-step: add a new line in an equation
1. One equation, split across lines with alignment (split)
- Load
amsmathin the preamble. - Open an
equationenvironment and putsplitinside it. - Mark the alignment point in each line with
&, and end every line except the last with a double backslash.
\begin{equation}
\begin{split}
A & = \frac{\pi r^2}{2} \\
& = \frac{1}{2} \pi r^2
\end{split}
\end{equation}
2. One very long equation (multline)
- Use
multline(ormultline*for no number). - Insert a double backslash at each point where the equation may be broken.
\begin{multline*}
p(x) = 3x^6 + 14x^5y + 590x^4y^2 + 19x^3y^3\\
- 12x^2y^4 - 12xy^5 + 2y^6 - a^3b^3
\end{multline*}
3. Several equations aligned (align)
Put & before the character you want aligned, such as =, and end each row with a double backslash.
\begin{align*}
2x - 5y &= 8 \\
3x + 9y &= -12
\end{align*}
4. Several equations centred (gather)
\begin{gather*}
2x - 5y = 8 \\
3x^2 + 9y = 3a + c
\end{gather*}
Numbering equations: equation, starred forms and \label
Equation numbering in LaTeX is controlled by the environment name. Overleaf’s documentation says you have to wrap an equation in the equation environment for it to be numbered and use equation* otherwise. The same asterisk toggles numbering in the others: multline*, align* and gather* are unnumbered, while the forms without an asterisk are numbered. When numbering is on in align, you can label each row individually.
To refer to a numbered equation, add a label inside the environment and cite it with \ref:
\begin{equation}
\label{eu_eqn}
e^{\pi i} + 1 = 0
\end{equation}
The equation \ref{eu_eqn} is the Euler identity.
Begin equation and matrices
\begin{equation} opens a numbered display equation and \end{equation} closes it. Matrices go inside any of these environments; see how to write a matrix in LaTeX for the matrix syntax.
Output and how to read it
- split: one equation number for the whole block; lines align at the
&. - multline: first line flush left, last line flush right, as described in Overleaf’s documentation.
- align: the equations line up vertically at the
&; with numbering on, each row can carry its own label. - gather: each equation centred, no alignment between them.
Troubleshooting
- The equation has no number. Check for an asterisk on the environment name (
equation*,align*, and so on); the starred forms are unnumbered. - I want a number and have an asterisk. Remove the asterisk, as Overleaf’s documentation describes.
- A starred equation or an environment such as
alignis not recognised. Confirm that\usepackage{amsmath}is in the preamble;equation*is provided by amsmath. - A double backslash in a plain
equation. Usesplitinsideequationfor an aligned break, ormultlinefor a long single equation, as in the steps above. - Working in the browser. If you use Overleaf, what Overleaf is and collaborative LaTeX writing in Overleaf explain the project workflow.
Alternatives to a plain equation environment
| Instead of | Use | Source |
|---|---|---|
| Breaking one numbered equation by hand | split inside equation |
Overleaf, Aligning equations with amsmath |
| A single over-long line | multline / multline* |
Overleaf, Aligning equations with amsmath |
Separate equation blocks for related equations |
align / gather |
Overleaf, Aligning equations with amsmath |
FAQ
How do I put a new line in a LaTeX equation?
Insert a double backslash at the break point inside an amsmath environment such as split, multline, align or gather.
How do I number equations in LaTeX?
Use the equation environment (or the unstarred form of multline, align or gather). Add an asterisk to suppress the number.
How do I label and cross-reference an equation number?
Put \label{name} inside the environment and write \ref{name} in the text.
How do I write a matrix in an equation?
See the matrix in LaTeX guide.
Sources (official docs)
- Overleaf, Aligning equations with amsmath, checked 2026-10-29.
- Overleaf, Mathematical expressions, checked 2026-10-29.
- CTAN, amsmath package, checked 2026-10-29.








