[texhax] pdfpages, geometry, hyperref - no page anchors
Ulrike Fischer
news3 at nililand.de
Fri Jun 25 09:19:48 CEST 2010
Am Thu, 24 Jun 2010 13:47:26 -0400 schrieb Lev Bishop:
> When I run pdflatex on this simple file:
> \documentclass{book}
> \usepackage{pdfpages}
> \usepackage[showframe]{geometry}
> \usepackage{hyperref}
> \begin{document}
> p1\newpage p2\newpage p3\newpage
> \hyperlink{page.1}{1}/\hyperlink{page.2}{2}/\hyperlink{page.3}{3}/
> \end{document}
>
> I get the warnings:
> pdfTeX warning (dest): name{page.3} has been referenced but does not
> exist, replaced by a fixed one
> pdfTeX warning (dest): name{page.2} has been referenced but does not
> exist, replaced by a fixed one
> pdfTeX warning (dest): name{page.1} has been referenced but does not
> exist, replaced by a fixed one
>
> If I remove \usepackage{pdfpages} or \usepackage{geometry} or even
> just the [showframe] option then everything is fine.
>
> Any ideas on what is going on here?
It's an \AtBeginDocument race, the package atbegshi (loaded by
pgfpages but also e.g. by hyperref) changes \shipout at
\AtBeginDocument, the showframe option of geometry does it too. And
this second definition wins and traps the anchors.
It works if you load pgfpages after geometry. Then the
atbegshi-definition is used which seems to give the correct frames
too (that means probably that geometry should better use the hooks
of atbegshi too instead of its own hook).
--
Ulrike Fischer
More information about the texhax
mailing list