Hi,
I am using pdflatex and in my document (documentclass{report}) I see that the link generated by hyperref in accordance with ~pageref{label} for a diagram is one less that the actual page number on which the diagram appears. This discrepacny exists in only one chapter of the whole document. In the previous chapter, the page number displayed is correct for the link. I have done a google search without much luck.
Any suggestions on how to resolve this?
Graphics, Figures & Tables ⇒ hyperref, pageref and label
NEW: TikZ book now 40% off at Amazon.com for a short time.
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
hyperref, pageref and label
I'm confused: do you mean that you have a cross-reference to the same label that shows up with two different page numbers in different chapters? That isn't possible (though see below for an instance of how it could arise temporarily).In the previous chapter, the page number displayed is correct for the link.
Without an example, I can't be sure, but try the following:
* Make sure the \label command comes right after the command that produces the number. I've had problems with \ref and \pageref pointing to a section number when I wanted them to point to a table caption, for example, but I'd put the \label statement inside the caption command instead of after it.
* Make sure you run LaTeX twice to resolve the page numbers to their final states. If you add text, it will mess up the page numbers in all subsequent cross references until the second LaTeX run.
* If you mean the page number as it appears in the table of contents, then be advised to run LaTeX a THIRD time to catch the cross-references in the table of contents. They'll be wrong until then. If you're ever in doubt, run LaTeX again; it never hurts.
If you suspect hyperref, try commenting it out for a while---it may help you track down the error. Just delete your .aux file first so you don't get "I don't know what \[random hyperref command] is" errors.
Re: hyperref, pageref and label
try \phantomsection
see http://tex.stackexchange.com/questions/ ... st-section
see http://tex.stackexchange.com/questions/ ... st-section