[Tex/LaTex] References are printed with spaces between them

bibliographiesbibtexurls

Is it possible to better format this so that I can remove the huge spaces between words?

Code used:

\bibliographystyle{abbrv}  
\bibliography{library}

Code in .bib library:

@misc{marsrover,
author = {Greicius, Tony},
booktitle = {NASA},
file = {:Users/user/Library/Application Support/Zotero/Profiles/zotero/storage/index.html:html},
howpublished = {http://www.nasa.gov/mission\_pages/msl/index.html},
title = {{\{NASA\} - Mars Science Laboratory}},
url = {http://www.nasa.gov/mission\_pages/msl/index.html}
}

enter image description here


Is this due to 'justify' style of the document ? Maybe I can prevent justifying the bibliography ? My document starts like this :

\documentclass[12pt,a4paper]{report}
\usepackage[lmargin=3.81cm,tmargin=2.54cm,rmargin=2.54cm,bmargin=2.52cm]{geometry}
\linespread{1.5}

EDIT

I can confirm that it's due to 'justify' .. I added \raggedright just before the bibliography and the text flushes to the left now.

However I would like to keep it justified but without the spacing … Editing the margins is not efficient, anyone got an idea how to achieve this ?

Best Answer

The problem is that the field "howpublished" is not being recognised as a URL, so any of the methods that people have given to break the URL are not working. Load the url package and change your .bib item appropriately so that the \url is encoded in the .bib file as such:

@misc{marsrover,
    Author = {Greicius, Tony},
    Booktitle = {NASA},
    Howpublished = {\url{http://www.nasa.gov/mission\_pages/msl/index.html}},
    Title = {{\{NASA\} - Mars Science Laboratory}},
    Url = {http://www.nasa.gov/mission\_pages/msl/index.html},
    }

Minimal document:

\documentclass{article}
\bibliographystyle{abbrv}
\usepackage{url}
\begin{document}
\cite{marsrover}
\bibliography{library}
\end{document}

output of code

Related Question