While following Manual hyphenation in text part of \href, I wondered how TeXLive handles \href hyperlinks with line breaks in its text part if the parts before and after the break end up on separate pages. The PDF document should then contain:
- the part of the hyperlink text before the line break (clickable)
- the footer of the first page (non-clickable)
- the header of the second page (non-clickable)
- the part of the hyperlink text after the line break (clickable)
The following document illustrates this:
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\noindent A\vadjust{\vfill\break} \href{http://a.co}{very \hfill\break long} hyperlink
\end{document}
I tried it out in Overleaf, with TeXLive 2021-06-01, and found that the result depends on the compiler:
| Compiler | Treatment of clickable parts | Space at the right of first line | Page footer and header |
|---|---|---|---|
| LaTeX | placed in an extra \hbox |
no line-breaking possible | no page-breaking possible |
| pdfLaTeX and LuaLaTeX | enclosed in in \pdfstartlink and \pdfendlink |
clickable | whole lines clickable |
| XeLaTeX | enclosed in pdf:bann and pdf:eann |
not clickable | only the page number clickable |
I learned from the comments to the other question that versions of TeXLive newer than 2021-06-01 do not make the footer/header clickable, and would be interested how these enclose the clickable parts (again, using the different compilers). At the moment, Overleaf does not offer these TeXLive versions.