Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using the natbib package and would like author-date referencing format. I have the following setup in the preamble:

\usepackage[authoryear]{natbib}
\bibliographystyle{harvard} %(also tried apalike)
\bibliography{mylibrary}

Compiling leads to number format in the pdf with an error 'Bibliography not compatible with author year citations' and the commands:

\providecommand\NAT@force@numbers{}\NAT@force@numbers

in the .aux file. I had previously used the author-date format with no trouble so I'm not sure why this error has suddenly occurred. I'm using TeXnicCenter with MiKTeX on Windows 7.

share|improve this question
1  
Have you checked the formatting of the bibliography items. If there is a mistake there, the bibliography can revert to number format. Common mistakes involve mixing up "[" and "{" –  Peter Jansson Jan 23 '13 at 14:29
    
Thanks for your reply. Do you mean in the bibtex file itself or within the latex document e.g. the \citep commands? –  Mark Jan 23 '13 at 20:07
    
My comment actually came from using \bibitem[]{} in the document file and I am therefore now uncertain how these errors translate into a bib-file. Would it be possible to post a mnimum working example (MWE) of your document and bib-file that reproduces the error? –  Peter Jansson Jan 23 '13 at 20:15
    
Thanks for your help. It seems that the issue related to an entry in the .bib file which didn't have a date, hence natbib overrode the author-date format. Fixing the problem required repairing the databse but also deleting the .aux and .bbl files otherwise the error persisted even with a corrected database. –  Mark Jan 24 '13 at 17:56
add comment

closed as too localized by Guido, barbara beeton, egreg, Werner, Torbjørn T. Apr 23 '13 at 5:13

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.