# Clickable URLs: no click possible after the line break

I use \url to make an URL clickable. When the line breaks, the part of the URL after the line break is not clickable. Why, and how to fix it?

Demo:

\documentclass[11pt,letterpaper]{article}

\usepackage{url}
\begin{document}

blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah \url{http://google.com}
\end{document}


I observed this behavior with the built-in Google Chrome PDF Viewer and Sumatra PDF on Windows 7 SP1 x64 Ultimate.

hyperref does a better job at managing line-breaks in URLs:

\documentclass[11pt,letterpaper]{article}

\usepackage{hyperref}
\hypersetup{
%urlbordercolor = 1 1 1% Make URL link border white
}

\begin{document}

blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah \url{http://google.com}
\end{document}

\end{document}


You can remove the borders using the hidelinks option, or set the border colour for URLs specifically to white (1 1 1).

• It works great, thanks! As a positive side effect, it also made the URL clickable in Adobe Reader. Just a small typo: there should be no , after hidelinks (I cannot edit due to SE bitching about edit size) – Franck Dernoncourt Jan 4 '16 at 22:12
• @FranckDernoncourt: There is no real harm in leaving the , there, as a key-value setting allows for empty items in a list. – Werner Jan 4 '16 at 22:14
• Just to clarify, the url package does not make the link clickable, it only formats it and allow it to break in a sensible place. However, some pdf readers will parse the text and if a url is detected will allow the user to click on the link, but that link is not part of the pdf. hyperref on the other hand, does create clickable links and not only for urls but also for internal links such as references, toc, labels, etc... Additionally, hyperref will only allow to break links by default if the pdftex engine is used, if you are using latex>dvipdfm then you need the breaklinks option. – ArTourter Jan 5 '16 at 0:30
• @ArTourter: Great remark. Yes, the fact that .com is not seen as part of the URL is a misinterpretation of the reader. hyperref corrects this. – Werner Jan 5 '16 at 0:49