7

Whenever I cite an online source in my text I encounter strange whitespace. For instance this reference:

@ONLINE{factsheet,
author = {Rachel Gill},
title = {Muscular dystrophy: how could stem cells help?},
url = {http://www.eurostemcell.org/factsheet/muscular-dystrophy-how-could-stem-cells-help},
note = {Last updated: 3 Mar 2016, (Used 12/4/2016)},
}

results in this pdf: So much whitespace

Does anyone know what causes this to happen?

Thanks for your time!

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • 2
    this isn't a bibtex problem. the usual url formatting doesn't allow breaks at hyphens, so the entire last part is forced onto a line by itself, and since the block is justified, the only way to make that happen is to stretch the spaces. it is possible to tell the process to allow breaks at hyphens, but for cases where there is only one hyphen in a url, that could easily lead to confusion. (i'm sure this must be documented in the url package manual: texdoc url, but i'm not anywhere that i can check it.) – barbara beeton May 10 '16 at 13:12
  • 1
    There is no sensible breakpoint in the url and as your bibliography seems to set \sloppy latex stretch the other spaces. Allow e.g. breaks at hyphen with \usepackage[hyphen]{url}. Or set the bibliography raggedright. – Ulrike Fischer May 10 '16 at 13:13
  • Which bibliography style do you employ? – Mico May 10 '16 at 15:02

1 Answers1

12

(Too long for a comment, hence posted as an answer.)

I recommend you load the URL package with the options hyphens, spaces, and obeyspaces:

\usepackage[hyphens,spaces,obeyspaces]{url}

If you load the hyperref package as well, be sure to load it after url.

Mico
  • 506,678