[texhax] Bigly Hyperref Bug (MWE)

Douglas McKenna doug at mathemaesthetics.com
Sun Mar 4 16:21:37 CET 2018

All -

It seems there's a pretty crazy bug in hyperref with respect to creating multiple-page-spanning footnotes with interactive clickable links in an eventual PDF.  The bug arose because I've been working on a document with a lot of interactive links to make it easy for the reader to get to the internet pages that the document discusses and cites.  Because of the possibility that the PDF document might end up as evidence in a legal case, it might be printed.  The problem, though, is that \href{}{} links, if printed, won't show the URLs, just the (colored) link text that replaces the URL.

So my solution is to place a footnote on each clickable \href{}{} link in the text, and then to put the actual text of the URL into the footnote as a clickable link also using \href{}{}.  That way, all the cited URL information is still there in printed form, just tucked away in footnotes so as not to interfere with readability in the document's main text.  I suspect this is going to be an increasingly important thing to do in any legally important PDF document.

But URLs are getting very long these days and often need to be word-wrapped onto multiple lines, which \href{} accomplishes.  I discovered that when I put a long URL into a footnote, and the page-break machinery breaks the footnote into two parts (which happens only rarely), with the second portion of the URL placed in a continuation footnote on the next page, that >every line< in the body of the text on the second page becomes clickable (although not colored as a link so normally one doesn't notice), leading to the same internet location as in the footnote started on the previous page.  Also, the second line of the continued footnote is not colored as a link, although it is clickable as intended.  I also tried the strategy of using two \href{}{}s in the footnote, knowing that the second would end up on page two.  Same bug.

I've reproduced the bug in TeXLive 2014 and 2016, running under MacOS X.  Perhaps someone can verify the bug in 2017 or 2018 (beta).  Or is this a longstanding issue with hyperref?

The bug is sensitive to spaces in the source text, so I'm not including the MWE as text in this email message where it might get mangled.  Hence, very short text file enclosed, as well as the badly behaving output PDF file.  Click on any line on the second page.

Doug McKenna

-------------- next part --------------
A non-text attachment was scrubbed...
Name: HyperrefBugMWE.tex
Type: application/octet-stream
Size: 683 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20180304/0146c974/attachment-0001.obj>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: HyperrefBugMWE.pdf
Type: application/pdf
Size: 54519 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20180304/0146c974/attachment-0001.pdf>
-------------- next part --------------

More information about the texhax mailing list