# Package natbib Error: Bibliography not compatible with author-year citations

I have a basic tex file and a bibliography which is exported from Mendeley

However, when I want to cite in the author-year style, I get the error:

Package natbib Error: Bibliography not compatible with author-year citations. (natbib) Press <return> to continue in numerical citation style.

Any clue what's wrong?

Minimum working example:

\documentclass[letterpaper, 10pt]{article}

\usepackage[authoryear]{natbib}
\usepackage{lipsum}

\begin{document}

\lipsum[1-4]
\nocite{*}

\bibliographystyle{apalike}
\bibliography{articles}

\end{document}


A snippet of my .bib library:

@article{shortcode,
author = {Lastname, Firstname},
file = {:/path/to/file.pdf:pdf},
journal = {Journal name},
number = {xx},
pages = {x--xx},
title = {Title},
volume = {xx},
year = {xxxx}
}

-
I also get the error, but my PDF still gets rendered fine. All my library entries have a year and I deleted temporary files several times. So, I ignore it for now. I found out that this command always gets into the aux file: \providecommand\NAT@force@numbers{}\NAT@force@numbers –  OneWorld Aug 22 '12 at 10:15

Another way this error can arise is if one of your BibTeX entries has no year.

-
That was indeed the case Josh. Tnx –  grrrbytes May 31 '12 at 8:03

When changing the bibliography style, sometimes natbib is upset because it can't interpret the data correctly.

In any case, after changing the argument to \bibliographystyle a run of LaTeX and one of BibTeX are necessary to get back in sync. Removing the .bbl and .aux files before those run is recommended, in order to avoid spurious error messages that might corrupt the .aux file currently being generated.

-
A vote here to remove all the temporary files- it does not seem like just the bbl+aux was enough (though I was tearing my hair out so I may not have been of entirely sound mind). Anyway- temporary files- they'll get ya. –  Brandon Kuczenski Jun 2 '12 at 0:04
This fixed my problem! –  Earl Bellinger Dec 8 '12 at 19:14

I had the same error trying to use spmpsci.bst in conjunction with natbib. While natbib's default citation style is author-year, spmpsci.bst is numeric, so this is a strange error to get. I eventually changed the following:

\usepackage[square,sort,comma]{natbib}


to

\usepackage[square,sort,comma,numbers]{natbib}


Problem went away.

-
Terrific solution, thanks! –  Xi'an Apr 9 at 11:43
The spbasic.bst doesn't have this problem for me, but the spmpsci.bst does. But if I use the svjour3.cls document class, I can't use natbib as you suggest, because of a clash of options. Also, doesn't setting numbers mean that you're no-longer using author-date? –  naught101 Jun 11 at 7:18
Thanks! \usepackage[square,sort,comma,numbers]{natbib} that helped for me. –  moe Nov 3 at 9:28

remove below line in the preamble works for me %\bibpunct{(}{)}{;}{a}{,}{,}

-
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. In particular, you would improve your answer, by providing a complete working document demonstrating what you mean. –  Andrew Swann Nov 8 at 15:30

1. Delete the .aux and the .bbl files
2. Do your changes (in the \bibliographystyle or in any option of natbib)
3. Run LaTeX
4. Run BibTeX
-

This can also happen if one of the BibTeX entries is missing the label (shortcode).

One possible scenario is when the bibliography is exported from e.g. EndNote and the label for the entry has not been set in EndNote. (This happened to me.)

-
If the entry in question doesn't have a label, how do you \cite it? –  Mico Dec 4 at 19:47
With the label I thought I had set, but had actually forgot to set. –  matsr Dec 4 at 20:08
I had the same problem and didn't have any BiBTeX entries without years. I was able to solve this error by changing two \cite commands to \citet or \citep.