# Document working with cite package, but not with natbib package

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?

-
i think we need more than you've given us; a minimal example of the failure would help; this should be a complete, compilable document (so you need to provide a micro-.bib-file as well, introduced by a filecontents environment). (afaict, from what you say, it should be working...) – wasteofspace Jan 31 '13 at 19:29
The example is in the web page that I have linked to. The files are literary there, all that needs to be done is copy and paste the contents. Other than that, I am honestly at loss on what you're asking. – 4th guy Jan 31 '13 at 19:35
Welcome to TeX.SE. More details on what we mean by Minimal Example can be found here: meta.tex.stackexchange.com/q/228 – yo' Jan 31 '13 at 19:36
It sounds like you LaTeX'ed (and BibTeX'ed) your document first with a different bibliography style (and the cite citation management package) and, more recently, have switched to natbib and plainnat. 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 '13 at 20:20
Thanks Mico, yours is a more complete answer :) Do you mind reposting it as an answer so that I can mark it as correct? – 4th guy Jan 31 '13 at 20:29

When you switch to natbib, it is necessary to delete .aux and .bbl files since they contain the non-natbib information and the package complains about it.