[Tex/LaTex] Line breaking (or hyphenation?) of references in apalike

apa-stylebibtexhyphenationline-breakingnatbib

This is a problem I encountered some time ago and I never could solve it: how can you achieve correct line-breaking or hyphenation when citing references with the apalike style?

Here is an example:

\documentclass[a5paper]{article}
\begin{document}
This is a paragraph with normal line breaking and hyphenation, isn't it? 
Yes! It is. 

This is paragraph that does not break well when citing \cite{citeme1},
or even \cite{citeme1, citeme2, citeme3}.  
\bibliographystyle{apalike}
\bibliography{biblio}
\end{document}

With the following bib file:

@Article{citeme1,
  author =       {Longlastname, Longfirstname and Helloworld E. Xample },
  title =        {A Title},
  journal =      {A journal},
  year =         {2009}
}
@Article{citeme2,
  author =       {Hofstadter, Leonard and Cooper, Sheldon},
  title =        {Experiences with a roommate that has Asperger syndrome},
  journal =      {The Big Bang Journal},
  year =         {2010},
}
@Article{citeme3,
  author =       {Cooper, Sheldon and Koothrappali, Rajesh and Wolowitz, Howard},
  title =        {Another example},
  journal =      {Another journal},
  year =         2010
}

This renders as:

example rendering 1

I understand that the problem comes from the fact that, initially, citations where more likely to be numbers. But, how can I fix this situation and keep the citation style like apa?


Edit

Okay, Charles Stewart's answer does help a lot: I have managed to correctly break the lines and even introduce my own hyphenation by adding:

\hyphenation{Lon-g-las-t-na-me}
\usepackage[square]{natbib}
...
... I use \citep instead of \citet
...
\bibliographystyle{plainnat}

(The weird hyphenation for longlastname was on purpose, to test the hyphenation)

This yields the following result:

example rendering 2

The only problem is that now the references section does not contain the brackets. I have not yet found a way to show them in the natbib package documentation.

Any ideas? (Maybe it does not make any sense to do have them anyways)

If you think that I should accept this answer and open a new question, drop me a comment!

Best Answer

Add \usepackage{natbib} to your preamble, and use \citet instead of \cite.