None of the solutions that I've found on internet have worked with me. I am trying to cite this paper: http://ijarece.org/wp-content/uploads/2013/08/IJARECE-VOL-1-ISSUE-4-52-56.pdf and many other documents as articles and books. I need to use IEEE style.
This is my document style:
\documentclass[a4paper]{book}
\usepackage[numbers]{natbib}
\begin{document}
....
\bibliographystyle{ieeetr} %I also tried IEEEtran, and IEEEtranN
\bibliography{literature/library}
\end document
This is what I have in my library.bib document:
@article{r1,
author = "A. N. Shinde, A. C. Joshi, S.S. Patil, Dr. A.P. Vaidya",
journal = "International Journal of Advanced Research in Electronics and Communication Engineering (IJARECE)",
month = oct,
number = "4",
pages = "1-5",
title = "DC Drive using PWM Techniques For Treadmill",
volume = "1",
year = "2012"
}
I'm using \cite{r1} to refer it.
But when compiling, I get this error:
! Package natbib Error: Bibliography not compatible with author-year citations
SOLVED:
I went back to use:
\usepackage[numbers]{natbib}
\bibliographystyle{IEEEtranN}
Now it's working. My problem was I was editing a template which contained some packages that somehow affected my whole code. I just started a new template myself with the stuff I need. I'm starting to learn Latex, and I confess it was a mistake editing an already-made template.
Best Answer
The error message provides the key clue. The
ieeetr
bibliography style is not compatible withnatbibt
.The format of a
\bibitmem
required bynatbib
has the following templateWhile
ieeetr
provides bib items with the following form:Thus, one option is not to load the
natbib
package (remove\usepackage[numbers]{natbib}
. The manual forIEEEtran
suggests to use thecite
style to manage citation (optionally).If
natbib
commands are already used in the body of the document, an option could be to usebiblatex
and thebib latex-ieee
style, i.e., add the following lines to the preambleand then
\printbibliography
where the bibliography should appear it the document. This solution requires to usebiber
instead ofbibtex
to generate the bibliography.