Skip to content

theorem anchor on the wrong page #294

@u-fischer

Description

@u-fischer

The new patch of \@thm in hyperref tries to avoid that anchors gets lost (see e.g. issue #8) by delaying the anchor into the next para/begin hook.

This doesn't work if the theorem is near a page break and the header or footer issues a \par (e.g. in fancyhdr where \parbox is used).

\documentclass[12pt]{book}
\newtheorem{theorem}{theorem}
\newtheorem{proof}{proof}
\makeatletter
\def\@oddhead{\parbox[t]{\linewidth}{head}}

\usepackage{hyperref}
\AddToHook{cmd/Hy@theorem@refstepcounter/before}{\AddToHookNext{para/begin}{HERE IS THE THEOREM ANCHOR!! }}
\begin{document}

\vspace*{36\baselineskip} 

line\\ line\\ line
    \begin{theorem}
        theorem
    \end{theorem} 
\end{document}

Probably the only way to resolve this is to move the anchor into the \item itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions