I am using Texmaker 4.1 in Ubuntu 14.04. This is part of my .tex
file.
\documentclass[useAMS,usenatbib]{mn2e}
\usepackage{epsfig}
\usepackage{graphicx}
\usepackage{times}
\usepackage{color}
\usepackage{amssymb}
\bibliographystyle{mn2e} %using mnras bibliography style
\begin{document}
\section{Introduction}
The two-point correlation function (\citep{totsuji_1969})........
So the spatial correlation $\xi(s)$ directly (e.g.\citep{davis_peebles_1983})......
\bibliography{clustering_paper}
\end{document}
When I compile using Quick build, (pdflatex + bibtex + pdflatex(2) + view pdf)
I get the error in LINE 5 and LINE 11 !!
! Undefined control sequence.
l.5 {Davis} M., {Peebles} P.~J.~E., 1983, \apj
, 267, 465
! Undefined control sequence.
l.11 {Totsuji} H., {Kihara} T., 1969, \pasj
, 21, 221
LINE 5 as you can see is \usepackage{color}
, but the error states that it is inside my clustering_paper.bib
file.
Here are the two references that create the error that are in my clustering_paper.bib
file.
@ARTICLE{totsuji_1969,
author = {{Totsuji}, H. and {Kihara}, T.},
title = "{The Correlation Function for the Distribution of Galaxies}",
journal = {\pasj},
year = 1969,
volume = 21,
pages = {221},
adsurl = {http://adsabs.harvard.edu/abs/1969PASJ...21..221T},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
@ARTICLE{davis_peebles_1983,
author = {{Davis}, M. and {Peebles}, P.~J.~E.},
title = "{A survey of galaxy redshifts. V - The two-point position and velocity correlations}",
journal = {\apj},
keywords = {Cosmology, Galactic Clusters, Galaxies, Red Shift, Correlation, Line Of Sight, Mass Distribution, Position (Location), Velocity Distribution},
year = 1983,
month = apr,
volume = 267,
pages = {465-482},
doi = {10.1086/160884},
adsurl = {http://adsabs.harvard.edu/abs/1983ApJ...267..465D},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
My .bib
file is inside the folder that contains my .tex
file. When I say \citep{}
it does recognise my reference keys and prompts autocomplete, so I am sure that it recognises my .bib
file. But I am bot able to find out where the error lies!!
Best Answer
the error is not in cite it is simply that
\apj
is not defined, the bib file presumably intends you to load a package to define it, if not just\newcommand\apj{some journal name}
will do.Unrelated but don't load
epsfig
package unless you really mean to emulate a document from the 1980's (which is the reason I wrote that package).