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.

Im currently writing a paper with the iop/emulateapj template (http://hea-www.harvard.edu/~alexey/emulateapj/). I want the following citation style to work:

Defining what life is is a complex matter (Smith, 2012). However, the work of Anderson et al. (2013) models life as a random walk, with successful applications to the social sciences.

However, what I get instead is this:

Defining what life is is a complex matter (Smith 2012). However, the work of Anderson et al. (2013) models life as a random walk, with successful applications to the social sciences.

Note that the comma after the citation to Smith's work is what I want. My bibliography looks like this:

\begin{thebibliography}{}
\bibitem[Anderson et al.(2013)]{And13} Anderson, T., 2012, Journal of Life, 
289, pp. 1209-1250.
\bibitem[Smith(2012)]{Smith12} Smith, H., 2012, Journal of The Matrix, 
143, pp. 313-320.
\end{thebibliography}

And my code in that part of the LaTeX code looks like this:

Defining what life is is a complex matter \citep{Smith2012}. However, the work of 
\citet{And13} models life as a random walk, with successful applications 
to the social sciences.

How can I do this?

share|improve this question
    
are you open to using biblatex? –  cmhughes Mar 25 '13 at 1:20
add comment

1 Answer

up vote 5 down vote accepted

The file emulateapj.cls contains the following lines:

\renewcommand{\bibstyle@aas}{\bibpunct{(}{)}{;}{a}{}{,}}% 
\citestyle{aas}

which show that the coma won't be used to separate the author from the year (the fifth argument of \bibpunct is empty). To revert to the coma, redefine the aas bibstyle:

\documentclass[iop]{emulateapj}

\makeatletter
\renewcommand{\bibstyle@aas}{\bibpunct{(}{)}{;}{a}{,}{,}}% 
\citestyle{aas}
\makeatother

\begin{document}

Defining what life is is a complex matter \citep{Smith12}. However, the work of 
\citet{And13} models life as a random walk, with successful applications 
to the social sciences.

\begin{thebibliography}{9}
\bibitem[Anderson et al.(2013)]{And13} Anderson, T., 2012, Journal of Life, 
289, pp. 1209-1250.
\bibitem[Smith(2012)]{Smith12} Smith, H., 2012, Journal of The Matrix, 
143, pp. 313-320.
\end{thebibliography}

\end{document}

enter image description here

share|improve this answer
    
Brilliant, thanks! –  Néstor Mar 25 '13 at 14:03
add comment

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.