Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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!

share|improve this question
1  
+1 for BBT reference. –  Konrad Rudolph Jul 28 '10 at 10:36

2 Answers 2

up vote 5 down vote accepted

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

share|improve this answer
1  
That was the first thing I tried but it changes the style of the references and the problem somewhat still seems to be there (a two part lastname went past the margin of the page where a linebreak should have been inserted). –  Juan A. Navarro Jul 28 '10 at 11:16
2  
I managed to do it with \citep. But it did change the format of the References section now (see edit) –  YuppieNetworking Jul 28 '10 at 12:59
    
If you use the hyperref package as well, you need to use the breaklines hyperref parameter to allow natbib citations to break across lines properly. See arwintcher's post here: latex-community.org/forum/viewtopic.php?f=47&t=6106 –  monsieurRigsby Nov 7 '13 at 17:34

If you initially wanted to use the APA citation style, I can only recommend you use \bibliographystyle{newapa}. I have struggled a lot to get to it, trying apacite, apalike, and others, and this one works the best for me.

As to why you don't have brackets anymore, well, this is the way APA works actually, so this is to be expected! If you want to keep the brackets, then surely there is a better referencing style suited to you. I like this page a lot to compare bibstyles, although none seem to have the full authors between brackets...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.