TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem with the line break of an URL. The URL can´t break correct and extends into the border. I´ve tried some things. Amongst others I loaded the package breakurl, but without any success. When I set the bibliography left-aligned there isn´t a problem. But I need it justified. Here is an example:



    author = {{Sun Microsystems}},
    title = {JavaSoft ships Java 1.0},
    year = {1996},
    month = {1},
    url = {http://findarticles.com/p/articles/mi_m0EIN/is_1996_Jan_23/ai_17853565/?tag=content;col1},
    urldate = {2011-03-02},
    sortname = {Sun},
    keywords = {www}

    author = {{Computer Weekly}},
    title = {Write once, run anywhere?},
    year = {2002},
    month = {5},
    url = {http://www.computerweekly.com/Articles/2002/05/02/186793/Write-once-runanywhere1.htm},
    urldate = {2011-03-02},
    sortname = {Computer},
    keywords = {www}


Test \cite{java02}
Test \cite{java96}


Does anyone have an idea?

share|improve this question
do not use package breakurl, when running pdflatex. hyperref does it anyway ... – Herbert Apr 12 '11 at 18:51
But without breakurl the problem is the same. Hyperref has an option breaklinks. But as far as i know this option doesn´t works. It will be set internally by the drivers. – MRae Apr 12 '11 at 19:01
I removed the {biblatex} tag because the problem at hand may also arise with other bibliography packages. – lockstep Apr 12 '11 at 19:43
A general hint that might be helpful whenever you're writing anything in English: For typing an apostrophe (as in can't), don't use the acute accent ´ (which is right of the sharp s ß, assuming you have a German keyboard), but instead the actual apostrophe ' by pressing shift + #. That'll give your LaTeX documents a way more professional look ;) – doncherry Apr 29 '11 at 9:00
There will be a new solution for this problem in the near future (already tested and it will be uploaded to CTAN soon). Look at my question here: tex.stackexchange.com/a/108001/28200 – DL6ER Apr 10 '13 at 20:18
up vote 18 down vote accepted

The first URL has a large unbreakable section (runanywhere1) which must either form the end of the second or the beginning of the third line (given the specific font size, margin etc. of the example) if one insists on justified text. An acceptable (?) solution may be obtained by adding e.g. \sloppy or \emergencystretch 1.5em before \printbibliography. enter image description here

share|improve this answer
Thanks for this answer. It is almost the same like the answer of Herbert and works too. – MRae Apr 12 '11 at 19:24

try it this way (without breakurl


enter image description here

or without \raggedright:

enter image description here

share|improve this answer
Okay, thanks for this answer. It works fine. – MRae Apr 12 '11 at 19:23
This is a good solution :) Thanks Herbert! – dingo_d Feb 7 '14 at 9:07

Your Answer


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.