5

When using the tufte-book or tufte-handout document class, if a sidenote or marginnote is placed on a line that ends with a hyperlink which continues onto the next line (i.e. the hyperlink breaks over the end of the line), then the sidenote/marginnote takes on the coloring of the link.

The MWE below shows this behavior. Shortening the long links so that they no longer break onto the next line removes the coloration from the corresponding marginal material.

\documentclass{tufte-book}
\hypersetup{colorlinks}

\begin{document}

Here is my label.\label{label}

This\sidenote{this is colored} \hyperref[label]{is a very very very very long link that breaks onto the next line}.

This\sidenote{this is not} \hyperref[label]{is a short link}.

This\marginnote{this is colored} \hyperref[label]{is a very very very very long link that breaks onto the next line}.

This\marginnote{this is not} \hyperref[label]{is a short link}.

\end{document}

tufte-latex and hyperref colored marginalia

How can I prevent marginal material from taking on the link color in this situation?

hakona
  • 53
  • 5
  • Did you try this with another document class? –  Sep 06 '14 at 08:42
  • Thank you! I'm not sure how I would implement this in another document class since the \sidenote and \marginnote commands are provided by tufte-latex. The sidenotes package provides similar functionality, but I do not believe it is loaded by the tufte-latex document classes. – hakona Sep 06 '14 at 08:52
  • Why do you not load sidenotes package directly. I think it can be used independently from the class ? –  Sep 06 '14 at 09:40
  • If I change the document class to article and load hyperref and sidenotes the problem does not occur. However, that might be a separate issue since I don't know if the \sidenote command provided by tufte-latex is the same as the one provided by the sidenotes package as tufte-latex predates sidenotes. – hakona Sep 06 '14 at 09:40

1 Answers1

6

The described behavior looks like a bug. As a workaround you can set the color for the side- and marginnotes explicitly:

\documentclass{tufte-book}
\hypersetup{colorlinks}

\setsidenotefont{\color{black}\footnotesize}   <-- set the color and font here
\setmarginnotefont{\color{black}\footnotesize} <-- and here

\begin{document}

Here is my label.\label{label}

This\sidenote{this is colored} \hyperref[label]{is a very very very very long link that breaks onto the next line}.

This\sidenote{this is not} \hyperref[label]{is a short link}.

This\marginnote{this is colored} \hyperref[label]{is a very very very very long link that breaks onto the next line}.

This\marginnote{this is not} \hyperref[label]{is a short link}.

\end{document}

This gives you plain black side- and marginnotes:

enter image description here

DG'
  • 21,727