\pageref link target goes to wrong page
Open
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 205
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
Bug description in text.
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\section{First page section}
First page text.
\newpage
Second page text, with label text2.\label{text2}
\newpage
Third page text, with pageref to text2: page \pageref{text2}.
It is correctly printed as 2, but the hyperlink goes to page 1, since
that is where the last section was. This seems like wrong behavior for
*page*ref.
This is with current (10sep21) pdflatex-dev, although I doubt the
particular versions make a difference.
\end{document}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the LaTeX reproducer in the issue and run it with pdflatex-dev to confirm that \pageref{text2} displays page 2 but links to page 1. Trace how hyperref creates the page reference target for the label after the section break. Done means the link for text2 targets the second page while retaining the displayed value 2.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- latex
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100