Make a reference to a page containing a certain sentence? [duplicate]

Possible Duplicate:
When do I need invoke \phantomsection?
Incorrect link produced by hyperref

I want to reference a page containing a certain sentence. If I add a label to the sentence and use \pageref{ref}, then this refers/links to the page containing the section title. Is there anyway to force the reference to stay near the sentence in which it is placed?

-
you need to define an acnchor for the label. try to use \phantomsection before the \label{sentence} –  Martin H Jun 20 '12 at 8:56
Thanks, this works perfectly. I didn't know about \phantomsection. If you formulate it as an answer, I can mark it as an answer. –  nvcleemp Jun 20 '12 at 9:12
add comment

marked as duplicate by Ignasi, lockstep, barbara beeton, Marco Daniel, Stefan Kottwitz♦Jun 25 '12 at 10:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

As explained here \phantomsection is required by hyperref to find an anchor to jumpt to. Chapters, sections, figures, tables, and other environments set this automatically, but for random labels you need to write \phantomsection\label{mylabel}.

-
add comment