# 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
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. – user31480 May 30 '13 at 3:45
remove below line in the preamble works for me %\bibpunct{(}{)}{;}{a}{,}{,} – user39708 Nov 8 '13 at 15:18

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! – rhombidodecahedron Dec 8 '12 at 19:14
Maybe one day they'll fix this issue... – Franck Dernoncourt Aug 23 '14 at 20:24
Congrats on earning the "bibtex" golden badge! :-) – Mico Apr 5 at 14:24
@Mico Almost a year after yours! ;-) – egreg Apr 5 at 14:26

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 '13 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 '13 at 7:18
Thanks! \usepackage[square,sort,comma,numbers]{natbib} that helped for me. – user39408 Nov 3 '13 at 9:28
This also worked for eptcs.bst (style.eptcs.org) – Florian Jan 14 at 8:22

The error occurs because natbib cannot find year information in the .bbl file (or possibly, but less likely, it cannot find author information). You can open it up yourself to see why this is the case.

The simplest reason would be that you have a \bibitem with the year field missing. A trickier reason is that your bibliography style does not output year information in a way that is parsable by natbib. For example, I was using \bibliographystyle{abbrv}, which does not play nicely with natbib. I fixed the problem by using instead \bibliographystyle{authordate1}. Of course, delete all temporary files, especially .bbl and .aux files, after making this change.

A final workaround is to use \usepackage[numbers]{natbib} when including the package. This outputs numbered citations instead of (author, year) citations and does not need year information.

-

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
-
What changes do you mean when you say "do your changes"? Thanks! – user29020 Dec 4 '14 at 23:04

Another not so intuitive reason for me was that I simply forgot a comma after one of the shortcodes. There was no other error and the references displayed fine, however only numerical.

-

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 '13 at 19:47
With the label I thought I had set, but had actually forgot to set. – matsr Dec 4 '13 at 20:08

In my case the problem was setting the cite style!!so, simply \setcitestyle{...}

-
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. I doubt that this answers the original question. Could you please show a full solution to the problem in the question? Please remember that this is not a forum, and the Answer field is intended only for true answers to the problem. – yo' Jan 2 '15 at 19:03
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. – Ruben Jan 2 '15 at 19:18
Could you please explain what you mean? – Stefan Kottwitz Jan 2 '15 at 21:38
Actually, this suggestion is what I was looking for! Some journal document classes load natbib without the citation style option, and that may give rise to OP's error message even when numeric citations are being used. In those cases \setcitestyle{number} resolves the issue. – alexurba Feb 24 '15 at 12:27

Another way this error can arise is if one of your BibTeX entries has no year. (From Josh Porter's answer)

This is true, but due to the mismatch between natbib package and your bibliographystyle settings, instead of a bug of natbib, which uses its own bibliography styles (even though natbib supports the original bibtex styles but not completely).

natbib intends to offer better author-year citations. If using natbib, you should choose plainnat, abbrvnat or unsrtnat. For example,

\documentclass[letterpaper, 10pt]{article}

\usepackage[round,sort]{natbib}
\usepackage{lipsum}

\begin{document}

\lipsum[1-4]

\bibliographystyle{abbrvnat}
\bibliography{articles}

\end{document}


Here [round,sort] is not necessary, which makes it look close to APA style. If you want use IEEE-like style, you could use \usepackage[numbers]{natbib}.

However, if you use apalike, ieeetr, siam, etc., it implies you use the default bibtex styles, you should comment natbib package; otherwise, you would meet the problems if your bib files contain entries without author/year information.

Either way should solve your problem. This also brothers me for a long time, due to many incorrect examples in blogs.

References:

https://en.wikibooks.org/wiki/LaTeX/More_Bibliographies

http://sites.stat.psu.edu/~surajit/present/bib.htm#bibstyle

-

## protected by Community♦Apr 5 '15 at 15:58

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.