# Underline long url and linebreak

I have a long url which I want to appear blue and underlined. Furthermore it must linebreak if the url is to long for a single line.

\documentclass[a4paper,10pt]{article}
\usepackage[hyphenbreaks]{breakurl}
\begin{document}
\underline{\href{http://www.atmel.com/Images/Atmel-11121-32-bit-Cortex-A5-Microcontroller\_SAMA5D3\_Datasheet.pdf}{http://www.atmel.com/Images/Atmel-11121-32-bit-Cortex-A5-Microcontroller\_SAMA5D3\_Datasheet.pdf}}
\end{document}}


The line-breaking is easy. The problem is when you want to have line-breaking and underlining. I tried what is described here: Is it possible to have italic and bold text, and linebreaks under the \underline{text} command?. The soul package also works but does not give really good results, meaning sometimes the underline is gone for a small part of the url and it gives often an extra space at the end of the url.

As far as I know, the most closer you can get to what you want is:

\documentclass[a4paper,10pt]{article}
\usepackage{hyperref}
\begin{document}

\url{http://www.atmel.com/Images/Atmel-11121-32-bit-Cortex-A5-Microcontroller\_SAMA5D3\_Datasheet.pdf}

text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text

\end{document}


However, clearly there is a problem regarding the underline and the line width. You can see through the multiple "text" that the underline stops at the end of line, instead of following the url size. I suggest you to not use underline. Try to use a colored link instead.