0

I thought the problem from Hyperref phrase with pagebreak also makes footnotes hyperlinked, How do I forbid pagebreaks inside urls without forbidding linebreaks? and Page breaks in hyperlinks seems to be kind of fixed by the solution explained in https://tex.stackexchange.com/a/578405/128042.

But when the page-break is interrupted by a footnote the following code still results in the footnote being falsely linked (both for TeXLive 2021 and TeXLive 2022 in Overleaf):

Check the code and the resulting pdf in Overleaf: https://www.overleaf.com/read/brdtdxcgkzbw

\documentclass[]{article}
\usepackage{hyperref}
\usepackage{color,xpatch,fancyhdr}
\pagestyle{fancy}
\makeatletter
%patches for texlive 2021/current miktex
\xpatchcmd\@outputpage{\vfil\color@hbox}{\vfil\pdfrunninglinkoff\color@hbox}{}{\fail}
\xpatchcmd\@outputpage{{\@thehead}\color@endbox}{{\@thehead}\color@endbox\pdfrunninglinkon}{}{\fail}
\xpatchcmd\@outputpage{\footskip\color@hbox\normalcolor}{\footskip\color@hbox\normalcolor\pdfrunninglinkoff}{}{\fail}
\xpatchcmd\@outputpage{{\@thefoot}\color@endbox}{{\@thefoot}\pdfrunninglinkon\color@endbox}{}{\fail}
\makeatother
\begin{document}

A\footnote{AaAaAa}

B

C\label{c}

\vspace{410pt}

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbb \hyperref[c]{Ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc cccccccc cccccccccccc cccccccccc ccccccccccccccccc ccccccccccccccccc ccccccccccccccccc ccccccccccccccccc ccccccccccccccccc ccccccccccccccccc } \end{document}

Jakob
  • 993

0 Answers0