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.

The following test code works if I comment out the \setcitestyle line. If I don't it throws a "undefined control sequence error." What's wrong? (I'm using the MacTeX-2011 distribution.)

\documentclass{article}
\usepackage{etoolbox}

\def\bibfile{refs}

\usepackage{natbib}
\setcitestyle{numbers}
\setcitestyle{notesep={: },aysep={}}

\ifdefmacro{\bibname}{}{\newcommand{\biname}{References}}   % Default bibliography name
\ifdefmacro{\bibfile}{}{\newcommand{\bibfile}{references}}  % Default name of references file, references.bib
 %\input{mmd-local-chicagoAD}

\begin{document} 
Hello \citep{KandR}

Kernighan wrote, \citet{gary_a._dymski_afterword:_2009}

Goodbye \citep[][222]{gary_a._dymski_afterword:_2009}
\renewcommand\bibname{References}
\bibliographystyle{mcbride}
\bibliography{refs}
%\input{mmd-local-bibmake}
\end{document}
share|improve this question
    
I don't get any error. –  egreg May 19 '12 at 19:35
add comment

1 Answer

Well, I finally figured this out. Thanks egreg for telling me you didn't get any error. This pointed me in the right direction.

The problem was that a few years ago I had installed the Copernicus package, and it includes a natbib.sty file dating from 2006. Since I installed it in my ~/Library/texmf path, which comes before the directory for the systemwide files in the LaTeX search path, LaTeX was finding this file instead of the up-to-date one that comes with MacTeX-2011.

Once egreg told me it works, I looked more closely at the log file and noticed that a 2006 version of natbib was being loaded, instead of the 2010 version that comes with MacTeX. I'd infer that \setcitestyle was not implemented in 2006.

Lots of lessons here.

Thanks again.

share|improve this answer
    
+1. I had a quite similar problem! –  enderland Nov 26 '12 at 21:58
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.