5

I have an enumerate like this

\begin{enumerate}
\item this is item 1 in \ref{SectionName1}
\item this is item 2 in \ref{SectionName2}
\end{enumerate}

\section{AAA}
\label{SectionName1}
text
\section{BBB}
\label{SectionName2}
text

This generates something like this:

1 this is item 1 in 1.2
2 this is item 2 in 1.3

AAA
text
BBB
text

The links in the enumerate are 1.2 and 1.3. But what I want to do is something different. I want to make the entire item into a link to a section instead of just the section's number. For example:

1 this is item 1
2 this is item 2

AAA
text
BBB
text

I want that whenever I click on the item's text ("this is item 1" and "this is item 2") to redirect me to the section.

Does anyone know how to do that?

  • 5
    Are you after producing a table of contents? – user11232 Dec 5 '12 at 13:53
  • @HarishKumar yes .. I already found an answer but thank you very much for your interest in the question .... the answer is below and it's already marked as the correct answer – morcillo Dec 6 '12 at 13:07
4

I assume you have loaded hyperref. Then \hyperref helps. It supports an optional argument with a label name:

\begin{enumerate}
\item \hyperref[SectionName1]{this is item 1}
\item \hyperref[SectionName2]{this is item 2}
\end{enumerate}

\section{AAA}
\label{SectionName1}
text
\section{BBB}
\label{SectionName2}
text

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.