Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
5  
Are you after producing a table of contents? –  Harish Kumar 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
add comment

1 Answer 1

up vote 4 down vote accepted

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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