Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

References: Forcing linebreaks in \url

So, in a plain document with

\usepackage{url}
\begin{document}
You can find this at \url{very-long-url}.
\end{document}

the URL will be broken down, e.g. after slashes. When however \usepackage{hyperref} is in effect, breaks are inhibited. I tried adding \usepackage{breakurl} below hyperref, and while it does break URLs again, the colorful border that hyperref added is now very faint. How could this last issue be remedied?

share|improve this question
2  
are you running latex or pdflatex? –  Herbert Jan 10 '11 at 14:21
    
You can use \href{http://www.microsoft.com/msdn/csharp/blablabla.aspx}{How to cook} –  xport Jan 10 '11 at 15:15
1  
Try \usepackage[breaklinkes]{hyperref} –  Ma Ming Jan 11 '11 at 12:20
1  
\href{}{with link text} won't help because the URL is supposed to be visible in the book. –  user2859 Jan 19 '11 at 0:28
3  
\usepackage[breaklinks]{hyperref} fails to break the URL. –  user2859 Jan 19 '11 at 0:33
show 1 more comment

1 Answer

up vote 3 down vote accepted

You can reset the width on the border. The needed value depends on the resolution settings of dvips. E.g. with dvips -Ppdf a value of 100 is okay, without -Ppdf you can try 5.

\documentclass[a4paper,10pt]{article}

\usepackage{hyperref}
\usepackage{breakurl}
\hypersetup{pdfborder={0 0 100}}
\textwidth=3cm
\begin{document}
\url{long/long/long/long/long/long/blub/bla/bla}
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.