[texhax] Hyperref pointer misses the correct page

Ulrike Fischer news3 at nililand.de
Thu Jul 5 19:34:15 CEST 2012

Am Thu, 5 Jul 2012 15:16:10 +1200 schrieb Alan T Litchfield:

> Hi all, and particularly the hyperref package maintainers.
>
> With Uwe's help, my previous issues have have resolved nicely. However,
> in the process I have found a new problem. I shall try to summarise:
>
> 1. Create a standard label in a document.
> 2. Somewhere earlier in the document, a pageref is entered that points
> at the label created.
> 3. PDFLaTeX the document and page reference is created correctly (p. 106)
> page 104 and not 106.

> Your help will be appreciated

Use \phantomsection to create an anchor when there isn't a "natural"
one:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\section{A}\label{A}

\newpage
blub\label{B}

\newpage
blub\phantomsection\label{C}

\newpage

\pageref{A}, \pageref{B}, \pageref{C}

\end{document}

--
Ulrike Fischer