# Cross-referencing list items

List items of numbered lists (enumerate) can be cross-referenced using the standard \label{} and \ref{} command pair. Cross-referencing description items is not supported by default, but can be done with a few additional lines of code in the preamble.

Enumerate
Ordered or numbered lists are cross-referenced with the label-ref command pair similar to figures, tables or chapters. The label can either be place right after \item or after the item’s text. The cross-reference \ref{} works within and outside the list as shown in the example below.

\documentclass[11pt]{article}
\usepackage{hyperref}
\begin{document}
\begin{enumerate}
\item \label{itm:first} This is a numbered item
\item Another numbered item \label{itm:second}
\item \label{itm:third} Same as \ref{itm:first}
\end{enumerate}
Cross-referencing items \ref{itm:second} and \ref{itm:third}.
\end{document}

Cross-referencing numbered items in lists (enumerate).

Loading the hyperref package, automatically adds links to cross-references and allows navigation to list items by clicking the reference.

Description
By default, items in a description can’t be cross-referenced. LaTeX would just use the number of the section/chapter. SX has a solution with a few lines of additional code in the preamble.

\documentclass[11pt]{article}
\usepackage{enumitem, hyperref}
\makeatletter
\def\namedlabel#1#2{\begingroup
#2%
\def\@currentlabel{#2}%
\phantomsection\label{#1}\endgroup
}
\makeatother
\begin{document}
\begin{description}[style=multiline, labelwidth=1.5cm]
\item[\namedlabel{itm:rule1}{Rule 1}] Everything is easy with \LaTeX
\item[\namedlabel{itm:rule2}{Rule 2}] Sometimes it is not that easy\\
$\to$ \ref{itm:rule1} applies
\end{description}
\end{document}

Cross-referencing description items

The code in the preamble defines a new command namedlabel which produces the name when cross-referencing the item. In the example, the enumitem package is loaded for a correct alignment of multiline items (see documentation for details)

Itemize
Cross-referencing items in unordered lists (bullet items) is not supported and wouldn’t make sense anyway, since individual items don’t have an unique identifier.

#### 5 Responses to “Cross-referencing list items”

• Sebastian H.

Great, just what I needed. Thanks!

• sarvesh

Dear Bob, I want to put different logo in thesis provided by iisc banglore. But i could not able to do the desired changes in the style file(iisclogo.sty) of it which i found on http://http://etd.ncsi.iisc.ernet.in/instructions/templates.htm (in Style Files for LATEX template)
How do i make changes in it so that i replaced the existing logo with another one.
i would be very thankful to you if you help me in that.

with regards
sarvesh

• tom

Hi Sarvesh,

As you already pointed out, the logo is in the style file “iisclogo.sty” in text form. Just remove the command \iisclogotrue or change it to false. Then add your own logo.

Good luck,
Tom.

• Siempre Indeciso

Hi,

I’ve 3 depths of nesting, and I want it to look as
1. —
1.1 —
1.1.1 — label{XX}

my problem is that when I make reference to 1.1.1 (label XXX) I get the label “1(1)1″. I mean I write ref{XX} and I get “1(1)1″

It must be really easy, but I do not know how to do it.

Thanks.

• tom

Hi!

I suggest using the enumitem package rather than the enumerate package, as it provides more flexibility. Here is an example:

\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate]{label*=\arabic*.}
\begin{document}
\begin{enumerate}
\item First level
\begin{enumerate}
\item Second level
\begin{enumerate}
\item Third level \label{itm:thirdlvl}
\end{enumerate}
\end{enumerate}
\end{enumerate}
Reference to item \ref{itm:thirdlvl}
\end{document}

Best, Tom.