[texhax] Hyperref pointer misses the correct page

Alan T Litchfield alan at alphabyte.co.nz
Thu Jul 5 23:37:46 CEST 2012


Hi Ulrike,

Thank goodness it was so simple.

I have changed the minimal example I posted earlier for future 
generations to illustrate how phantomsection works.

Thank you.
Alan

On 6/07/12 5:34 AM, Ulrike Fischer wrote:
> 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)
>> 4. hyperref is loaded and links are created, but the hyperlink points to
>> 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}
>
>

-- 
AlphaByte
PO Box 1941, Auckland
http://www.alphabyte.co.nz


-------------- next part --------------
A non-text attachment was scrubbed...
Name: hypertextCounterPhantom.tex
Type: application/x-tex
Size: 14900 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20120706/9bcd5872/attachment.tex>


More information about the texhax mailing list