2

Say I have the following nested list:

\begin{enumerate}[label=\normalfont({\alph*})]
\item\label{itm:a} 
\item\label{itm:b} 
\begin{enumerate}[label=\normalfont({\roman*})]
\item\label{itm:i}
\item\label{itm:ii}
\item\label{itm:iii}
\end{enumerate}
\end{enumerate}

When I create this I get separate hyperlinks for b and i or ii or iii. How can I get it such that for example b(i) comes under one hyperlink?

1 Answers1

1

You don't mention it explicitly, but I assume you're using the enumitem package.

The following code should work for you; if you want the cross-reference to a second-level item to also include the "number" (here: letter!) of the higher-level item, you can do so by specifying the desired format explicitly via a ref= ... statement.

enter image description here

\documentclass{article}
\usepackage{enumitem,hyperref}
\hypersetup{colorlinks=true}
\setlength{\parindent}{0pt}  % just for this example
\begin{document}
\begin{enumerate}[label=\normalfont({\alph*})]
\item abc\label{itm:a}
\item def\label{itm:b}
   \begin{enumerate}[label=\normalfont({\roman*}),ref=\alph{enumi}({\roman*})]
   \item uno\label{itm:i}
   \item dos\label{itm:ii}
   \item tres\label{itm:iii}
   \end{enumerate}
\end{enumerate}

Here's a cross-reference to item \ref{itm:i}.

Here's another cross-reference, to \autoref{itm:iii}.
\end{document}
Mico
  • 506,678