1

I am using the tufte-book class and I noticed a weird behavior of the footnotes. Here is the setting, there is a line of text with a footnote on it and the last word wraps to the next line, then:

  • If I try to make the last word a link with \href, the link will have a hit box that spans the whole width of the text below the first line.
  • If I try to color the last word, all of the footnote will be colored. (This was resolved here)

Here is a minimal example with a screenshot (you can't see my cursor, but it was hovering right below 'will') of the behavior on my pdf viewer.

\documentclass{tufte-book}
\begin{document}

There\footnote{This is a footnote} will be a long link \href{https://tex.stackexchange.com}{here is a very long link that breaks over to the next line}. \end{document}

enter image description here

1 Answers1

1

You can try the following patch. It assumes that you use pdflatex and it requires a current texsystem. The command used is quite new.

\documentclass{tufte-book}
\usepackage{etoolbox}
\makeatletter
\patchcmd\@addmarginpar{\hb@xt@}{\pdfrunninglinkoff\hb@xt@}{}{\fail}
\apptocmd\@addmarginpar{\pdfrunninglinkon}{}{\fail}
\makeatother

\begin{document} \hypersetup{pdfborder=1 1 1,urlbordercolor=red} % to show the link There\footnote{This is a footnote} will be a long link \href{https://tex.stackexchange.com}{here is a very long link that breaks over to the next line}. \end{document}

Output without the patch

enter image description here

Output with the patch

enter image description here

Ulrike Fischer
  • 327,261