Long URLs need to be broken at the end of a line. Here's a topic about that. That topic suggests adding the hyphens option to the URL package, and also to define


I've done both, but it still doesn't work. Below is a copy of an example. Any ideas?

\documentclass[10pt, a4paper]{article}





This is a test. Kurzweil says technology increases exponentially (\url{http://www.kurzweilai.net/the-law-of-accelerating-returns}).


EDIT: I am using latex and then dvipdf to compile.

  • It works fine for me without any special considerations. It splits at http://|split|www.----- Mar 6, 2013 at 19:30
  • I use latex and then dvipdf if that matters. I cannot understand why it would work for some and not others.
    – user5371
    Mar 6, 2013 at 20:03
  • oh goodness. yep, that's it. ... that is weird. I would put your build pattern in the question, since it seems to be relevant. Mar 6, 2013 at 20:10
  • 1
    dvips/ps2pdf produces the same result. It may be that pdflatex is the only one that works here. The DVI also is messed up; so there has got to be some rationale for this behavior (although it looks like a lucky bug in pdflatex). Mar 6, 2013 at 20:13
  • Yes, I got it to work with pdflatex. Thank you very much, if you want to post that as a solution I could accept it. Odd though, I only ever noticed the difference when dealing with images before.
    – user5371
    Mar 6, 2013 at 20:17

4 Answers 4


I'm not sure what is causing the problem in the first place, but pdflatex gives the desired output without any fuss whatsoever. The issue seems to be reproducible only with a latex dvipdf or latex dvips ps2pdf build pattern. The DVI produced by latex exhibits this issue (viewed under xdvi), so it is no wonder that the trailing build processes fail.

A better solution must yet exist, but using pdflatex in the first place circumvents the issue for the most part. (The hyphenation patterns leave much to be desired.)

latex output: (DVI screenshot viewed under xvdi; the red line is the page edge) latex output

pdflatex output: pdflatex output


I finally found a solution, that might be of interest to all the ones having problems with displaying long URLs in LaTeX: I had a little chat with Vilar (the maintainer of the breakurl-package) and he was able to extend the breaking possibilities of his package they way I suggested.

Therefore the new option anythingbreaks in the newest version does the links look good as they keep in range of the textborder.

See for yourself:

Completely without:


Standard behavior:



option anythingbreaks

Look also at my question here: https://tex.stackexchange.com/a/108001/28200


One can fix this by loading the package breakurl after hyperref (which should also be loaded later in the preamble):


With this addition, on the given test file, the .dvi breaks right after http://www., as it does in the .pdf made with dvipdf.


This isn't an automated solution, but I currently use a macro that manually breaks URLs up:




Kurzweil says technology increases exponentially (\url{http://www.kurzweilai.net/the-law-of-accelerating-returns}).

Kurzweil says technology increases exponentially (\brokenurl{http://www.kurzweilai}{.net/the-law-of-accelerating-returns}).

Kurzweil says technology increases exponentially (\brokenurlwithoutpar{http://www.kurzweilai}{.net/the-law-of-accelerating-returns}).



This "solution" of mine is an occasional last resort, when nothing else helps. Yes, it's obvious, it's not deep, and it doesn't use any tricks - but every so often it's the only thing that seems to work. Note the difference between \brokenurl (with \par\nopagebreak) and \brokenurlwithoutpar (with \\*); when you set something like \parindent0pt, the two behave nearly the same (it's in fact hard to construct an example where their right-alignment behavior is different). Now it occurs to me that defining the macro with \par\nopagebreak\noindent instead of just \par\nopagebreak would avoid any need for \parindent0pt, but then, depending on the context you're in (say, a bibliography), you might intentionally want an indented continuation of a broken URL, to make it clear that the item is a continuation of the previous line; it depends very much on the formatting and style.

Note that my method works smoothly even if you break within words in arbitrary places (eg, \brokenurl{http://www.kurz}{weilai.net/...}).

You must log in to answer this question.