I am trying to use the natbib style in order to cite references by author and year.
Using the tex and bib example here I am able to create a pdf file using the cite package.
mydocuments.tex
\documentclass[11pt]{article}
\usepackage{cite}
\author{John Doe} \title{Sample Document}
\begin{document} \maketitle
\section{Introduction}
According to the handbook of van Leunen \cite{vanleunen}, this paragraph---and certainly this section---should be longer than one sentence.
\bibliographystyle{plain} % (uses file "plain.bst")
\bibliography{myrefs} % expects file "myrefs.bib"
\end{document}
myrefs.bib
@book{vanleunen, title = "A Handbook for Scholars",
author = "Mary-Claire van Leunen",
publisher = "Knopf",
year = "1979"
}
When I switch to the natbib package (and the bibliography style plainnat), I get the error.
Package natbib Error: Bibliography not compatible with author-year citations.
mydocuments.tex
\documentclass[11pt]{article}
\usepackage{natbib}
\bibliographystyle{plainnat}
\begin{document} \maketitle
\section{Introduction}
According to the handbook of van Leunen \cite{vanleunen}, this paragraph---and certainly this section---should be longer than one sentence.
\bibliographystyle{plain} % (uses file "plain.bst")
\bibliography{myrefs} % expects file "myrefs.bib"
\end{document}
What is wrong with the bib file in the example, and how do I format it for natbib please?
citecitation management package) and, more recently, have switched tonatbibandplainnat. If that's the case, you may want to delete all "auxilliary" files and then rerun LaTeX, BibTeX, and LaTeX twice more. – Mico Jan 31 at 20:20