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.)



\setcitestyle{notesep={: },aysep={}}

\ifdefmacro{\bibname}{}{\newcommand{\biname}{References}}   % Default bibliography name
\ifdefmacro{\bibfile}{}{\newcommand{\bibfile}{references}}  % Default name of references file, references.bib

Hello \citep{KandR}

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

Goodbye \citep[][222]{gary_a._dymski_afterword:_2009}
  • I don't get any error. – egreg May 19 '12 at 19:35

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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