[Tex/LaTex] Natbib – setcitestyle

natbib

I am using natbib and need the following reference output:

(Badie 2010: 1-2)

Therefore, I am using the setcitestyle command.

\setcitestyle{notesep={: }}

gives me the following output:

(Badie, 2010: 1-2)

When using

\setcitestyle{aysep{}}

I get

(Badie 2010, 1-2)

But combining both, is not possible

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

gives me

(Badie, 2010: 1-2)

Can you tell me why? What have I made wrong?

Best Answer

You have a typo in your code: You need to use aysep={} instead of aysep{}:

\begin{filecontents*}{\jobname.bib}
@article{badie2010,
 author={Badie, John},
 title={Title},
 journal={Journal},
 year={2010},
}
\end{filecontents*}

\documentclass{article}
\usepackage{natbib}
\setcitestyle{notesep={: }}
\setcitestyle{aysep={}}

\begin{document}
\citep[1--2]{badie2010}

\bibliographystyle{plainnat}
\bibliography{\jobname}
\end{document}

enter image description here

Related Question