# underline with hyperref

I try to underline my links. So far, I tried to use the solution in this post but it doesn't seem to work. I also try with \underline inside the \href but the result isn't great. Here is the code I use:

\documentclass[a4paper]{paper}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lipsum}

\usepackage{hyperref}
\hypersetup{
citecolor=black,
urlcolor=blue,
allbordercolors={0 0 0},
pdfborderstyle={/S/U/W 1}]{hyperref},
}

\begin{document}

\end{document}


I would like to have something like that :

Is there an easy solution ?

The pdfborderstyle doesn't work for two reasons:

• You moved the settings into \hypersetup but didn't remove the {hyperref}. If you look in the log you find a warning about it:
Package hyperref Warning: Invalid value {/S/U/W 1}]{hyperref}'
(hyperref)                for option pdfborderstyle'.

• hyperref is the opinion that coloring a link and adding a border is too much. So as soon as you use the colorlinks option it will disable the border at begin document. If you really want both you have to reset the border later.

This here works if you have a pdf viewer which supports this border style:

\documentclass[a4paper]{paper}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage{xcolor}