2

For my thesis I'm working with TeXStudio and I tried to include my bibliography in my document. I used BibTeX for my bibliography and saved it in a .bib file, but I can't seem to make it work properly. When I use \usepackage{natbib}, I get an error message saying

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

And whatever style I use, it keeps the plain style... Someone knows what I did wrong?

Here my code:

\documentclass[10pt,a4paper,final]{book}
%\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage[hidelinks]{hyperref}
\usepackage{natbib}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage{polyglossia}
\setmainlanguage{french}
\setotherlanguages{english,german,latin,italian,spanish,russian,greek}

\begin{document}
text
\section{Bibliographie}
\bibliographystyle{acm}
\bibliography{roumain}
\end{document}

Example of my bibliography:

@mvbook{SMFC,
    author = {SMFC = Academia RPR, Institutul de lingvistica din Bucuresti},
    title = {Institutul de lingvistica din Bucuresti, Studii \c{s}i materiale privitoare la formarea cuvintelor în limba român\u{a}},
    date = {vol I, 1959 ; II, 1960 ; III, 1962 ; IV, 1967 ; V, 1969 ; VI, 1972},
    editor = {Editura Academiei},
    volumes = {6},
    location = {Bucarest},
}
@inbook{Asan-PsaltHur,
    author = {Asan, Finuţa},
    title = {Derivarea cu sufixe şi prefixe în Psaltirea Hurmuzaki},
    booktitle = {SMFC},
    date = {1959},
    bookauthor = {Academia RPR, Institutul de lingvistica din Bucuresti},   editor = {Editura Academiei},
    location = {Bucarest},
    volume = {1},
    volumes = {6},
    pages = {203-212}
}     
@book{Popescu-Formarea,
    author = {Popescu Marin, Magdalena (coord.)},
    title = {Formarea cuvintelor în limba română din secolele al XVI lea – al XVIII lea},
    date = {2007},
    editor = {Editura Academiei},
    location = {Bucarest},
}

enter image description here

  • You will have to replace \bibliographystyle{acm} with something that is natbib compatible. Btw: You are using xelatex or lualatex, so dont't load \usepackage[utf8]{inputenc}. – Ulrike Fischer Aug 12 '15 at 8:27
  • Right, in my file I put an % in front of the inputenc package. Actually I tried that and it's not working. When I use the style plainnat.bst it compiles, but other styles that should work like abbrvnat don't. I still get the same error message : "! Package natbib Error: Bibliography not compatible with author-year citations." – Bianca Mertens Aug 12 '15 at 11:56
  • Have you tried option numbers? – Johannes_B Aug 12 '15 at 12:14
  • By the way, with the current setup, i.e. abbrvnat, it works fine. It is an author year style. – Johannes_B Aug 12 '15 at 12:19
  • Your example doesn't contain any \cite command. So I doubt that it shows your output. Beside this: If you change the style, delete the bbl and then compile anew (including a bibtex call). Besides this: Be careful with accented chars in your bib. Unlike biblatex/biber, natbib+bibtex can't handle utf8 so they can break. – Ulrike Fischer Aug 12 '15 at 13:14
2

Well, in your code I can see some problems.

For example should package hyperref be the last called package!
The documentation of package natbib can you read by typing texdoc natbib on your console/terminal. There are the styles listed you can use with natbib and which styles and field names are supported.

To give you a starting point I changed your MWE, deleted not needed package calls for this problem, changed the order of package calls and added the missing informations for field year and publisher to your bib file (btw package filecontents is only used to have bib file and TeX code in one compilable MWE).

MWE:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{SMFC,
  author    = {{SMFC = Academia RPR, Institutul de lingvistica din Bucuresti}},
  title     = {Institutul de lingvistica din Bucuresti, Studii \c{s}i 
               materiale privitoare la formarea cuvintelor în limba român\u{a}},
  note      = {vol I, 1959 ; II, 1960 ; III, 1962 ; IV, 1967 ; V, 1969 ; VI, 1972},
  year      = {1972},
  editor    = {Editura Academiei},
  publisher = {UNKNOWN},
  volumes   = {6},
  location  = {Bucarest},
}
@inbook{Asan-PsaltHur,
  author     = {Asan, Finuţa},
  title      = {Derivarea cu sufixe şi prefixe în Psaltirea Hurmuzaki},
  booktitle  = {SMFC},
  year       = {1959},
  bookauthor = {Academia RPR, Institutul de lingvistica din Bucuresti}, 
  editor     = {Editura Academiei},
  publisher  = {UNKNOWN},
  location   = {Bucarest},
  volume     = {1},
  volumes    = {6},
  pages      = {203--212},
}
@book{Popescu-Formarea,
  author    = {Popescu Marin, Magdalena (coord.)},
  title     = {Formarea cuvintelor în limba română din secolele al XVI lea – al XVIII lea},
  year      = {2007},
  editor    = {Editura Academiei},
  publisher = {UNKNOWN},
  location  = {Bucarest},
}
\end{filecontents*}


\documentclass[10pt,a4paper,final]{book}
\usepackage{fontspec} % utf-8 encoding!
\setmainfont{Times New Roman}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\usepackage{polyglossia}
\setmainlanguage{french}
\setotherlanguages{english,german,latin,italian,spanish,russian,greek}

\usepackage[numbers]{natbib}
\usepackage[hidelinks]{hyperref}


\begin{document}
text \cite{Asan-PsaltHur} \nocite{*}
\section{Bibliographie}
\bibliographystyle{abbrvnat} % plainnat abbrvnat
\bibliography{\jobname}
\end{document}

Now if you compile you will get three warnings like this:

three resulting warnings

As you can see the warning is pretty clear (same with the warnings you got with your original code): you can not use author and editor both. Please rework your bib file. I also changed your undefined @mvbook to @book.

At last three tips:

  • SMFC = Academia RPR, Institutul de lingvistica din Bucuresti is an unusual entry for an author, better would be to place the acronym in the text and use the complete name. But your given name for author is an institution, as I can see. So better use it as editor ...
  • Studii \c{s}i should be in an utf-8 encoded file changed. Please change all tex substitutions for special characters with cedilie etc. to the corresponding original utf-8 letter.
  • You need a field year to be style-conform, so in the case of your first entry SMFC I would use field note={vol I, 1959 ; II, 1960 ; III, 1962 ; IV, 1967 ; V, 1969 ; VI, 1972}, instead your date field.
  • The author of the SFMC entry is clearly best taken to be a "corporate" author. Hence, use an extra pair of braces: author = {{SMFC = Academia RPR, Institutul de lingvistica din Bucuresti}},. – Mico May 3 '16 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.