1
\documentclass{singlecol-new}

\usepackage{natbib,stfloats}

\usepackage{mathrsfs}

\begin{thebibliography}

\bibitem[\protect\citeauthoryear{Wang and Vergara-Niedermayr}{2008}]{wang08com}
Wang, F. and Vergara-Niedermayr, C. (2008) `Collaboratively Sharing
Scientific Data', {\it CollaborateCom}, pp.805--823.

\end{thebibliography}

\end{document}

when i run this tex code i find this error "! Package natbib Error: Bibliography not compatible with author-year citations.". I am not able to figure out this ...please help

1
  • 2
    Since you are clearly not using biblatex, that tag should probably be removed (people have alerts associated to tags, so questions of a chosen type are highlighted)
    – daleif
    Commented Aug 9, 2017 at 11:52

1 Answer 1

3

If you want to make your hand-edited bibliographic items compatible with the format that natbib expects, you have to change

\bibitem[\protect\citeauthoryear{Wang and Vergara-Niedermayr}{2008}]{wang08com} ...

to

\bibitem[Wang and Vergara-Niedermayr(2008)]{wang08com} ...

(Aside: Who taught you to write \protect\citeauthoryear{Wang and Vergara-Niedermayr}{2008}]?!)

Mainly, you should make an effort to learn how to use BibTeX and/or biblatex.

A full MWE (note that your code snippets are compilable):

\documentclass{article} % "singlecol-new" ?
\usepackage[authoryear]{natbib}
\usepackage{stfloats,mathrsfs}

\begin{document}
\citet{wang08com}

\begin{thebibliography}{9}

\bibitem[Wang and Vergara-Niedermayr(2008)]{wang08com}
Wang, F. and Vergara-Niedermayr, C. (2008) `Collaboratively Sharing
Scientific Data', {\itshape CollaborateCom}, pp.\ 805--823.

\end{thebibliography}
\end{document}
4
  • @mico..thanx a lot.....\protect\citeauthoryear{Wang and Vergara-Niedermayr}{2008}] style has been from a journal template as i am following their template.
    – Wang
    Commented Aug 9, 2017 at 12:06
  • Following templates is the source of much frustration... (The journal template probably doesn't load the natbib package, though, does it?)
    – Mico
    Commented Aug 9, 2017 at 12:15
  • @mico...ya it does not load natbib package.. the above code snippets of yours also getting the same error...
    – Wang
    Commented Aug 9, 2017 at 12:29
  • @NiranWang - Really?! I get no errors when compiling my answer (which is definitely not a "code snippet"!) under pdflatex (MacTeX2017) Did you delete the aux file before re-running LaTeX twice?
    – Mico
    Commented Aug 9, 2017 at 12:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .