# Gaps between words in bibliography [closed]

I am getting awkward gaps in the bibliography while citing online news articles.

@MISC{DHLHYBRID,
author =       { Kastrenakes, Jacob},
title =        {{UPS} has a delivery truck that can launch a drone},
editor =       {theverge.com},
month =        {February},
year =         {2017},
url = {https://www.theverge.com/2017/2/21/14691062/ups-drone-delivery-truck-test-completed-video},
note = {\emph{https://www.theverge.com/2017/2/21/14691062/ups-drone-delivery-truck-test-completed-video} {[Online; posted 21-February-2017]}},


It looks like this

I see huge gaps before UPS and before and after "J" in author's name.

A normal bibliography looks like this:

## closed as unclear what you're asking by Troy, Stefan Pinnow, CarLaTeX, Bobyandbob, Johannes_BAug 21 '18 at 8:53

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• your biblioraphy style should generate \url{http....} so the url will linebreak but you have provided no usable example to allow anyone to reproduce the problem – David Carlisle Jun 20 '18 at 21:57
• But it's a fair bet 'tex-core' is not the right tag. @DavidCarlisle Biblatex handles URLs badly by default for me, though usually it lets them spill off the page rather than leaving gaps. Does it do better by default for you? – cfr Jun 20 '18 at 22:31
• You appear to be putting the URL into note as well as url, and it appears to be the note field which is typesetting it. But you don't use \url there, so obviously, it isn't handled properly. However, Biblatex handles url fields OK(ish), so it is not obvious why you've blocked that and pushed note. Are you actually using Biblatex at all? – cfr Jun 20 '18 at 22:34
• I am using sharelatex, I believe the bibliography would be same in that as well. – bhawesh sah Jun 21 '18 at 1:14
• I am using natbib, sorry for the confusion. – bhawesh sah Jun 21 '18 at 1:24

You should (a) replace the \emph in the note by \url and (b) load the url package. In your particular case passing the hyphens option to the url package, so allowing breaks in the url at hyhens, gives best results.

\documentclass{article}

\usepackage{natbib}
\usepackage[hyphens]{url}

\begin{document}
\cite{DHLHYBRID}
\bibliographystyle{abbrvnat}
\bibliography{test}
\end{document}


with test.bib

@Misc{DHLHYBRID,
author =   {Kastrenakes, Jacob},
title =    {{UPS} has a delivery truck that can launch a drone},
editor =   {theverge.com},
month =    {February},
year =     2017,
note =
{\url{https://www.theverge.com/2017/2/21/14691062/ups-drone-delivery-truck-test-completed-video}
{[Online; posted 21-February-2017]}}
}


The large spaces your saw in your original example are the result of LaTeX trying to stretch as much as possible to fill up the first line as it fails to find good break points later in the paragraph. The \url command that natbib styles provide is usually just \texttt which does not allow such breaks. The \url command from the url package (or from hyperef) allows breaking of non-word objects such as url's across lines, and thus gives more options for how LaTeX can break up the paragraph. Seeing the documentation of the url package for further options, including ways to change the font used for the url.

Note that you could alternatively use the url field as follows in test.bib:

@Misc{DHLHYBRID,
author =   {Kastrenakes, Jacob},
title =    {{UPS} has a delivery truck that can launch a drone},
editor =   {theverge.com},
month =    {February},
year =     2017,
url =
{https://www.theverge.com/2017/2/21/14691062/ups-drone-delivery-truck-test-completed-video},
note =     {[Online; posted 21-February-2017]}
}


but now the url will be proceeded by URL and you will still need to load the url` package to get good spacing.