Possible Duplicate:
Incorrect target of \label link produced by hyperref

Labeling and linking in LaTeX confuses me.

I have something like the following:

\section{main section}
 %lots of text
%more text

I want to be able to link to the second label, but it seems those labels are associated with the previous document element (in this case a main section)

So something like:

\hyperref[SomethingDescribedButNotDocumentElement]{link to 2nd label}

But this jumps up to the sec:mainsection label.

  • How do I link to an arbitrary section of my document (which may be not described by section or figure etc)?
  • 1
    maybe you want to use \pageref instead of \ref? – cmhughes Jan 16 '13 at 22:25
  • is there another section or do you have 2 labels in the same section? – Rico Jan 16 '13 at 22:29
  • 1
    there are some good ideas in this question: When do I need to invoke \phantomsection?. – barbara beeton Jan 16 '13 at 22:40
  • @Timebandit this would not be a problem if I did not have two labels in the same section/subsection/etc – enderland Jan 16 '13 at 22:43
  • 1
    @enderland It is not really a mistake to ask something that has been here before, as long as you don't mind getting it closed. – yo' Jan 16 '13 at 22:50

You can generate a new anchor by \phantomsection. The syntax of \hyperref with optional argument can be used to link an arbitrary text to this location:


  • Perfect! This is exactly what I needed. – enderland Jan 16 '13 at 22:42
  • 3
    It is not a bad question. However, we all know that it has been asked many times here. In my opinion, instead of answering it, the duplicate should be found and the question closed. – yo' Jan 16 '13 at 22:46

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