15

The usual solution to fix lines that overflow is to rewrite it. However, that hardly works with bibliography entries that experience the same problem.

So what can I do to fix it? I can't rewrite anything since the information needs to be "as-is". I can't provide a minimal example because if I take the entry that overflows in my document, then the problem fixes itself as the font, font size and margins change.

EDIT

Even though I've accepted an answer, please submit more answers if you have a good approach for addressing this issue. Maybe it can assist someone else who have the same problem and don't want to resort to using "ragged right".

gablin
  • 17,006

4 Answers4

12

try:

\begingroup
\sloppy
%\RaggedRight %% needs package ragged2e
\bibliographystyle{...}
\bibliography{..}
\endgroup

or similiar, if you are using biblatex. It is always a good idea to set the bibliography ragged right if you have a lot of urls, which should always be set with \url{...} (needs the package of the same name)

  • Using RaggedRight fixed the problem nicely, and it doesn't look out of place even though the rest of the document text is justified. – gablin Feb 14 '12 at 09:27
6

Your options, ordered by the amount of work involved, are:

  1. accept the overfulls and do nothing (if they aren't that bad that might be preferable)
  2. Typeset the bibliography with ragged right (either using ragged2e package or just plain \raggedright)
  3. Alternatively (same amount of work) set the bibliography somewhat loose, by increasing \tolerance and setting an \emergencystretch. Avoid \sloppy if possible as this will likely result in a few extremely bad lines, instead of a somewhat more loosely setting.
  4. Edit your bib file(s) and include explicit hyphen possibilities (i.e., \-) in places where you want a break that is not taken. This should be non-destructive in other situations but depending on the reason for your overfull lines it may not solve the problem. You could also try adding something like \linebreak[3] in certain places if you want to have a break being taken slightly earlier.
  5. Wait until you are fully finished writing your text. Then take the .bbl file and edit it by adding hard \linebreak or even \newline commands into it. However, make sure that you save a copy of the changed file in case you forget and regenerate it from the BibTeX sources.
Salvioner
  • 483
5

I've had such problems due to lack of hyphenation: the bibliography item was French, while my language setting was English. I fixed this by adding a \hyphenation entry for the word that wouldn't break. Of course this only works for this specific issue.

Jaap Eldering
  • 1,760
  • 15
  • 20
0

Simply adding

\usepackage{url}

did fully solve the problem for me (I use Elsevier Article (elsarticle) Template).

Before: enter image description here

After: enter image description here

Inspired by the answer of user2478.

DEner
  • 3