7

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 ?

10
  • 1
    How are you inserting the url address?
    – Sigur
    Apr 15 '13 at 22:39
  • 1
    Load the url package in your document's preamble.
    – Mico
    Apr 15 '13 at 22:56
  • @Sigur What do you mean ?
    – Razor
    Apr 15 '13 at 23:09
  • @Mico How exactly ?
    – Razor
    Apr 15 '13 at 23:10
  • @NLed, paste here the item from your bib file which contain that reference.
    – Sigur
    Apr 15 '13 at 23:11
7

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

5
  • Yes this fixed the problem .. it seems like Mendeley does not output webpages correctly .. I might need to ask this in a new topic.
    – Razor
    Apr 16 '13 at 2:15
  • No, I don't think this is the correct diagnosis. The issue is what the bibliography style does with the howpublished field. This field is a catch-all described in the BibTeX documentation as "How something strange has been published. The first word should be capitalized." So it's not always a URL, so it's up to you to indicate that it is a URL when it is one. This is different from e.g. the url field, which (if your bibliography style recognises it) is intended to hold a URL and will be formatted accordingly.
    – Alan Munn
    Apr 16 '13 at 2:22
  • Hmm I see ... Well is there a way I can automate this rather than manually editing the file every time Mendeley updates the .bib ?
    – Razor
    Apr 16 '13 at 2:38
  • Sorry I don't know anything about Mendeley. Does it overwrite changes you make to the bib file?
    – Alan Munn
    Apr 16 '13 at 3:08
  • Yeah, every time I update the reference manager it automatically overwrites any changes done in the bib file.
    – Razor
    Apr 16 '13 at 11:34

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.