Written and maintained by CASRAI Editorial Board
Last updated
Short answer: put \label{eq:name} inside the equation environment, after the math and before the closing \end, then cite it with \eqref{eq:name}, which adds the parentheses for you. In align, put one \label on each line you want to cite. This guide is for researchers who write papers or theses in LaTeX and need equation numbers that stay correct as the text changes. Checked against the amsmath User’s Guide (v2.1, revised 2020-02-18) and Overleaf’s documentation on 2026-11-08.
What equation labels are used for in research
Hard-typed numbers such as "Equation 4" break the moment an equation is added or moved. A label attaches a name to an equation’s counter, so every reference updates on the next compile. Journals, theses and grant documents that number their displayed equations rely on this. For labels on figures, tables and sections, see the broader guide to cross-referencing with \label and \ref in LaTeX; this page is specific to equations.
Install or access
The numbering and tagging commands below (\tag, \notag, \eqref, subequations, \numberwithin) come from the amsmath package, documented in the AMS / LaTeX Project User’s Guide for the amsmath Package and distributed in CTAN’s macros/latex/required area. Load it in your preamble:
\usepackage{amsmath}
Plain \label and \ref work in the equation environment without amsmath. You can compile locally with a TeX distribution such as MiKTeX (open source, for Windows, Mac and Linux, per miktex.org, read 2026-11-08) or in an online editor such as Overleaf.
Step by step: label and cite an equation
1. Label a single equation
Place \label inside the environment. Overleaf’s documentation uses this pattern:
\begin{equation} \label{eq:1}
\sum_{i=0}^{\infty} a_i x^i
\end{equation}
Equation \ref{eq:1} is a typical power series.
Compile again after adding a label so the reference resolves. Using a prefix such as eq: in label names is a convention, not a requirement; it keeps equation labels distinguishable from figure and section labels.
2. Cite with \eqref so the parentheses are added
The amsmath guide describes \eqref as supplying the parentheses automatically: if \ref{abc} produces 3.2, then \eqref{abc} produces (3.2), with the parentheses set in upright type whatever the surrounding style.
As shown in \eqref{eq:1}, the series converges for small x.
3. Label each line in align
When numbering is allowed, Overleaf’s alignment documentation says you can label each row individually. Every unstarred amsmath display environment except split numbers each line automatically with LaTeX’s equation counter, so put a \label at the end of each line you intend to cite. See aligned equations in LaTeX for layout inside a single number, and line breaks in equations for splitting long expressions.
\begin{align}
a &= b + c \label{eq:first} \\
d &= e + f \label{eq:second}
\end{align}
4. Suppress or replace a number
Per the amsmath guide, put \notag before the end of a line to suppress its number; it should not be used outside a display environment because it disturbs the numbering. To override a number, use \tag{...} with text of your own, such as * or ii. \tag* typesets the text literally without adding parentheses. Both also work inside unnumbered (starred) alignment structures. A tag can reuse another display’s number with \tag{\ref{label}modifier}; with hyperref, the guide says to use \ref*.
\begin{equation}
x = y + z \tag{A1} \label{eq:custom}
\end{equation}
5. Number sub-equations (4.9a, 4.9b)
Wrap related equations in subequations. If the preceding equation was (4.8), the group is numbered (4.9a), (4.9b) and so on. The guide warns that a \label placed immediately after \begin{subequations} produces a reference to the parent number 4.9, not 4.9a. Put labels inside the individual equations to reference the lettered ones.
\begin{subequations}
\label{eq:group} % refers to the parent number
\begin{align}
a &= b \label{eq:sub-a} \\
c &= d \label{eq:sub-b}
\end{align}
\end{subequations}
6. Number equations by section
Add \numberwithin{equation}{section} to the preamble so equations are numbered (1.1), (1.2), (2.1) and so on. The amsmath guide notes the command applies to any counter.
Output and how to read it
| You write | Typeset result | Source |
|---|---|---|
\ref{abc} |
3.2 | amsmath guide, 3.11.2 |
\eqref{abc} |
(3.2), upright parentheses | amsmath guide, 3.11.2 |
\tag{ii} |
(ii) | amsmath guide |
\tag*{ii} |
ii (no parentheses) | amsmath guide |
\notag at the end of an aligned line |
no number on that line | amsmath guide |
subequations after (4.8) |
(4.9a), (4.9b) | amsmath guide, 3.11.3 |
Troubleshooting
| Symptom | Likely cause and fix |
|---|---|
| Reference shows ?? | The label has not been recorded yet or the name is misspelled. Compile again and compare the names. |
| Reference to a sub-equation shows 4.9 not 4.9a | The label sits directly after \begin{subequations}. Move it into the lettered equation. |
Numbering is disturbed after \notag |
The amsmath guide says \notag must only be used inside a display environment. |
| Parentheses in a bold section heading look wrong | The guide describes a workaround for bold headings: use (\ref{...}) instead of \eqref (3.11.4). |
Free alternatives and where to compile
| Option | What the vendor says |
|---|---|
| MiKTeX | An implementation of TeX/LaTeX and related programs; open source; installs on Windows, Mac and Linux (miktex.org/about, read 2026-11-08). |
| Overleaf | Online LaTeX editor whose learning pages document the \label, \ref and align labelling used above. See also collaborative writing in LaTeX and Overleaf. |
FAQ
How do I label an equation in LaTeX?
Insert \label{eq:name} inside the equation environment and cite it with \ref{eq:name} or \eqref{eq:name}.
Can I label every line of an align block?
Yes. Each numbered line can carry its own \label; use \notag on lines that should not be numbered.
What is the difference between \ref and \eqref?
\eqref adds the parentheses automatically; \ref gives the bare number.
Can I use my own label text instead of a number?
Yes, with \tag{...}, or \tag*{...} to omit the parentheses.
Where do I label theorems?
Theorem-like environments have their own counters; see theorem environments in LaTeX.
Sources
- AMS / LaTeX Project, User’s Guide for the amsmath Package, version 2.1 (2020-02-18): mirrors.ctan.org/macros/latex/required/amsmath/amsldoc.pdf, read 2026-11-08.
- Overleaf, Cross referencing sections, equations and floats, read 2026-11-08.
- Overleaf, Aligning equations with amsmath, read 2026-11-08.
- MiKTeX, About, read 2026-11-08.







