-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
\pageref link target goes to wrong page #206
Comments
P.S. Thanks to Nicola for explaining this problem to me. |
Yes that is known. \pageref uses the information that are set by the label, and the label refer to the last destination you set. While theoretically pageref could jump to a page, this is not really reliable as the data a label can store is a bit restricted and currently doesn't include the name of the page destination or the abspage, also such a link would always jump to the top of the page and not to the place of the label. So if you set a label somewhere in the middle of some text \label{text2} you should also set an anchor with There should be perhaps a |
Sure, I surmised it was a known bug.
It is disconcerting that a \pageref link goes to some page other than
what is printed. If LaTeX can print the right page number, it seems
strange that it cannot link to the right page. Much better to go to the
top of the correct page than some other previous location, seems to me.
Anyway, I suggest that 1) there be a recommended amelioration (doesn't
\phantomsection have other side effects? Not that I know anything about
it), and 2) that that be part of the \pageref documentation. Instead of
leaving to users to notice/debug. --thanks, karl.
|
Karl is correct. The documentation needs a few extra lines, especially at \phantomsection page 23, reproduced below. https://mirrors.nic.cz/tex-archive/macros/latex/contrib/hyperref/doc/hyperref-doc.pdf#page=23 \phantomsection \cleardoublepage My experience one year ago was the same. There is no specific info in the referenced ctan PDF about \ref and \pageref and what happens to the hyperlinks after pdflatex makes the PDF. I would like to see one sentence added that explains briefly what an "anchor" does in a PDF and why \phantomsection\label{...} is sometimes required to produce targets for \hyperref. Fischer's idea for command \pagelabel is relevant. The suggestion could be in the documentation as a common user-defined macro. In 2020, the same macro fixed my hyperlinks to hundreds of delayed proofs in a textbook of 1300 pages. |
@ggustaf There is some explanation about destinations in 4.4 Creating targets. Apart from this: The documentation has grown over 30 years, and there are many places where it could be improved. If you want to help, make a pull request with a suggested change. |
THANK YOU SO MUCH! |
Bug description in text.
The text was updated successfully, but these errors were encountered: