hyperref icon indicating copy to clipboard operation
hyperref copied to clipboard

Shaded boxes around links

Open Fontanapink opened this issue 5 years ago • 4 comments

Instead of having hyperref color links with a box or changing the color of the text, it would be awesome to have a shaded area around links like this:

image

Fontanapink avatar Feb 07 '20 16:02 Fontanapink

the pdf specification doesn't knows an easy way to do this. One could use a \colorbox but this would disable line breaks in the link and also prevent spaces to stretch. An appeareance dictionary wouldn't work in all pdfviewers and would prevent line breaks too.

u-fischer avatar Feb 07 '20 19:02 u-fischer

One could use a \colorbox but this would disable line breaks in the link

@u-fischer soul's \hl wouldn't have this problem:

\documentclass{article}
\usepackage{xcolor}
\usepackage{soul}
\begin{document}
\hl{test test test test test test test test test test test test test test test
  test test test test test test test test test test test test test}
\end{document}

test

dbitouze avatar Feb 07 '20 19:02 dbitouze

@dbitouze yes you can use it e.g in \href. But I wouldn't want to try to combine this e.g. with \url.

u-fischer avatar Feb 07 '20 19:02 u-fischer

Exactly. I need links to be highlighted like that. Better yet if shaded instead of highlighted.

Fontanapink avatar Feb 11 '20 20:02 Fontanapink