0

Please consider this MWE:

\documentclass[paper=a6,fontsize=11pt]{scrbook}
\usepackage{lipsum}
\usepackage{hyperref}
\begin{document}
\chapter{My Chapter}
\lipsum[2] \url{https://example.com/}
\end{document}

Using pdflatex, this results in:

The running hyperlink includes the current page footer and next page header

Where the boxes for the current page footer and next page header are part of the running link.

This is similar to Why is there an extra link box for long URLs when using hyperref and lineno?, and since I'm using pdflatex, it looks like I should use \pdfrunninglinkoff before the footer box and \pdfrunninglinkon after the header box, but how can I find the correct boxes to patch?

cabohah
  • 11,455
rmolina
  • 183
  • 3
    in a current LaTeX you can use \DocumentMetadata{testphase=new-or-1} see https://tex.stackexchange.com/a/578405/2388 (it doesn't catch everything, if you have footnotes that split over pages you can still get such links.) – Ulrike Fischer Dec 31 '23 at 14:47
  • 3
    I would also try very hard not to break urls over pages, if only to make them more readable. This will not be easy since you still need line breaks. – John Kormylo Dec 31 '23 at 15:22
  • 3
    BTW: The problem is independent from KOMA-Script. It happens, e.g., also with \documentclass[a5paper]{book} \usepackage{lipsum} \usepackage{hyperref} \begin{document} \chapter{My Chapter} \lipsum[11]\par \lipsum[11] \url{https://example.com/somewhere/here/or/there} \end{document} – cabohah Jan 01 '24 at 12:06
  • Thank you. \DocumentMetadata{testphase=new-or-1} worked in my document. The old xpatch solution from https://tex.stackexchange.com/a/578405/2388 worked too. – rmolina Jan 02 '24 at 14:22

0 Answers0