Test case (pdflatex): ``` \documentclass{article} \usepackage{fancyhdr} \pagestyle{fancy} \usepackage{hyperref} \newtheorem{thm}{Theorem} \textheight60pt \begin{document} 1\\2\\3\\4\\5\\6 \begin{thm}\label{th} Theorem text. \end{thm} Ref to Theorem \ref{th}. \end{document} ``` Checked with recent versions, each fails since 7.00w, 7.00v (and previous versions) are OK. (Perhaps since Feb 13, 2023 [new thm implementation]?)