[texhax] Bigly Hyperref Bug (MWE)

David Carlisle d.p.carlisle at gmail.com
Sun Mar 4 19:18:32 CET 2018


hi it would be best (least likely to get lost) if you could report this at
https://github.com/ho-tex/hyperref/issues
but handling links around split footnotes is tricky and depends a lot
on which back end you are using, the code for pdftex or latex+dvips or
xetx+xdvipdfmx are all different here,
so reporting cases where it does the wrong thing is useful but fixing
this area in general is quite hard, and

simplest workaround is probably not to allow footnotes to split:
\interfootnotelinepenalty=10000

On 4 March 2018 at 15:21, Douglas McKenna <doug at mathemaesthetics.com> wrote:
> 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
>
>
>
>
>
>
>
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
>
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org



More information about the texhax mailing list