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?

  • 1
    do not use package breakurl, when running pdflatex. hyperref does it anyway ... – user2478 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
  • 1
    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 – MrD Apr 10 '13 at 20:18

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

  • 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 \usepackage[hyphenbreaks]{breakurl})


Output, nicely spaced URLs with raggedright

or without \raggedright:

Output, nicely fittet URLs without raggedright

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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