2

Consider the following code:

\documentclass{article}
\usepackage{lipsum}
\usepackage{hyperref}
\newcommand{\veryn}[1]{\ifnum\numexpr#1 > 0
    very/\veryn{#1-1}%
\fi
}
\edef\foo{\noexpand\url{this/is/a/\veryn{200}long/url/spanning/multiple/lines}}
\begin{document}
    \lipsum[1-2]\footnote{\lipsum[1]}
    \lipsum[3]\footnote{\foo}
    \lipsum[4]
\end{document}

The first page looks normal as expected in pdflatex: First page The second page, however, highlights the main text of the page as a link: Second page

Why does this happen? (Is it a bug in hyperref that should be reported? (Where?)) Is there a way to avoid this?

  • 3
    it is not a hyperref bug, but a deficiency of the pdflatex (and also luatex) primitive. It could be avoided if the output routine would add another box level around the footnote, but I don't know if this is possible without affecting the page layout. – Ulrike Fischer Mar 18 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.