Skip to main content
v2026.11,858 entries · CC-BY 4.0
LAC HealthMedical Supply Distributor100,000+ medical supplies. 48-hour critical dispatch.Ships from 8 regional U.S. hubs. Net-30 terms for verified institutional accounts.Shop lac.us CodeCASRAIlac.us

Equation Label in LaTeX: \label, \eqref, \tag and align Lines

Label equations in LaTeX with \label and \eqref, number each align line, use \tag and subequations, and fix ?? references.

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

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Equation Label in LaTeX: \label, \eqref, \tag and align Lines

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →