The numbers [1], [2], [3] running down the bibliography of a LaTeX document are produced by the fourth-level counter of enumerate. Rather than define a counter of its own, thebibliography in article.cls simply writes \usecounter{enumiv} and borrows the deepest level of a numbered list. That is how far into the skeleton of a document the list machinery reaches. This page works through enumerate in order: the counters enumi to enumiv that hold the numbers, the \theenumi family that turns them into text, how \label and \ref point at a single item, and how to carry numbering across a break in the list.
The numbers live in counters, not in the environment: enumi to enumiv
enumerate does not hold the numbers itself. latex.ltx defines four ordinary LaTeX counters — enumi, enumii, enumiii, enumiv — and the environment merely picks one according to its current depth. The work splits into three layers: \begin{enumerate} calls \usecounter, which resets the counter to zero; \item advances it by one with \refstepcounter before typesetting the entry; and the \theenumi family turns the resulting value into text. Keeping that order in mind makes the later oddity — writing 4 when you want the list to start at 5 — read as obvious rather than arbitrary.
| Level | Counter | Default format | Head-of-line label | Output |
|---|---|---|---|---|
enumi | 1 | \theenumi = \arabic{enumi} | \labelenumi = \theenumi. | 1. |
enumii | 2 | \theenumii = \alph{enumii} | \labelenumii = (\theenumii) | (a) |
enumiii | 3 | \theenumiii = \roman{enumiii} | \labelenumiii = \theenumiii. | i. |
enumiv | 4 | \theenumiv = \Alph{enumiv} | \labelenumiv = \theenumiv. | A. |
Confusing the third and fourth columns of that table will cost you later. \theenumi decides how the number itself is written; \labelenumi decides the ornament placed at the head of the line. Level 2 makes the difference plain: \theenumii says only a, and it is \labelenumii that adds the parentheses. Change \theenumi when you want a different style of number, and \labelenumi when you want different punctuation around it. Five commands turn a count into characters — \arabic (1, 2, 3), \alph (a, b, c), \Alph (A, B, C), \roman (i, ii, iii) and \Roman (I, II, III) — and any of them works on any counter.
% style of the number itself
\renewcommand{\theenumi}{\Roman{enumi}}
% punctuation around it: I) II) instead of I. II.
\renewcommand{\labelenumi}{\theenumi)}Pointing at an item with \label and \ref — and why the reference does not match the label
Put \label{key} at the start of an \item’s body and \ref{key} will print that entry’s number from anywhere in the document. The \refstepcounter that \item uses to advance the number also records “the currently referenceable thing is this entry”, which is what binds the \label to the \item immediately before it. That is why the reference follows automatically when you reorder the steps. Values travel through the .aux file, so on the run in which you add a new \label the number is not yet settled: you have to compile twice. With hyperref loaded, the same reference becomes a clickable link. When you want the page an item sits on rather than its number, \pageref{key} takes the same key.
\begin{enumerate}
\item Bring the sample to room temperature
\item \label{step:weigh} Record the weight
\item Add solvent and stir
\end{enumerate}
Use the value from step~\ref{step:weigh} in the yield calculation.Here is behaviour that catches everyone off guard: referencing a nested item gives a different string from the label you can see on the line. A second-level entry is typeset as “(a)” yet \ref returns 2a; a third-level one shows “i.” but references as 2(a)i. This is not a bug — a prefix command called \p@enumii is at work. article.cls defines \p@enumii as \theenumi, and the string a reference returns is assembled as prefix + \theenum…. \labelenumii, which builds the head-of-line label, plays no part in referencing at all, which is exactly why the parentheses it adds never show up in the reference.
| Level | Number seen on the line | String \ref returns | Prefix definition |
|---|---|---|---|
enumi | 2. | 2 | no prefix |
enumii | (a) | 2a | \p@enumii = \theenumi |
enumiii | i. | 2(a)i | \p@enumiii = \theenumi(\theenumii) |
enumiv | A. | 2(a)iA | \p@enumiv = \p@enumiii\theenumiii |
The design makes sense in itself: a bare “a” would leave the reader wondering which parent item’s (a) was meant. Still, “2a” often clashes with a document’s house style. To drop the parent and return a plain a, define \renewcommand{\p@enumii}{}; to separate it as “2.1”, use \renewcommand{\p@enumii}{\theenumi.}. What you must not do here is reach for \theenumii — changing that also rewrites the head-of-line label to “2.1” and wrecks the look of the list. When only the reference needs fixing, \p@enum… is the command to touch.
Continuing the numbering after a break: why you write 4 to start at 5
If an explanatory paragraph or a figure interrupts a procedure and you close the list, the next enumerate restarts at 1 — inevitably, because the \usecounter called by \begin{enumerate} zeroes the counter every time the environment is entered. To carry the numbering on, reset the value with \setcounter immediately after opening the list. This is where the three-layer order from earlier pays off: \item advances the counter before typesetting the entry, so to begin at 5 you set 4. Subtracting one is not folk magic; it is the direct consequence of \refstepcounter running first.
\newcounter{savedstep}
\begin{enumerate}
\item first
\item second
\end{enumerate}
\setcounter{savedstep}{\value{enumi}}
An interrupting paragraph.
\begin{enumerate}
\setcounter{enumi}{\value{savedstep}}
\item this one is numbered 3
\end{enumerate}The idiom is reliable because enumi keeps its final value after \end{enumerate}. Stash it in a counter of your own right after the list closes and the numbering survives any number of intervening paragraphs and figures. For deeper levels, treat enumii, enumiii and enumiv the same way. That said, rather than write the boilerplate every time, load enumitem: \begin{enumerate}[resume] picks up where the previous list stopped, and \begin{enumerate}[start=7] begins at 7 — with start= there is no “subtract one”. For a long procedural document it is worth loading enumitem from the outset.
When numbering earns its place, and when it misleads
You do not choose enumerate because numbers look tidy. A number is a contract with the reader: it declares that order, priority, or reference actually means something here. Number a set of unordered items and readers will read chronology or importance into them, asserting something the writer never intended. Conversely, in a genuine procedure the numbers are what let a reader say “go back to step 3”. And that reference should be delegated to \label and \ref rather than typed into the prose as a literal “3”: hand-typed numbers all turn into lies the moment one item is inserted.
- Use
enumeratefor procedures, chronology and priority. The reader being able to say “back to number 3” is the only reason to number at all. - Use
itemizefor unordered conditions and properties. Numbering them asserts a ranking or a sequence you did not mean. - Always
\labelan item you will refer to. A number typed into the prose goes wrong the moment one entry is added. - Check what
\refreturns for nested items. The line reads “(a)” but the reference comes back as2a. - Carry the numbering across a break. Plain LaTeX does it with
\setcounter;enumitemdoes it withresume.