I have to use natbib for a conference paper bibliography and I'm having trouble getting the numbering working. I have the following code:
...
\usepackage[numbers]{natbib}
...
\begin{document}
...
\bibliographystyle{unsrtnat}
\bibliography{FAR_citations}
\end{document}
With the following in FAR_citations.bib
:
@ONLINE {spy_camera,
author = "Adafruit",
title = "Spy Camera for Raspberry Pi",
year = "2015",
howpublished = {\url{https://www.adafruit.com/products/1937}}
}
@ONLINE {raspberry_pi,
author = "Adafruit",
title = "Raspberry Pi Model B+ 512MB RAM",
year = "2015",
howpublished = {\url{http://www.adafruit.com/products/1914}}
}
@ONLINE {powerboost,
author = "Adafruit",
title = "PowerBoost 500 Basic - 5V USB Boost at 500mA from 1.8V+",
year = "2015",
howpublished = {\url{https://www.adafruit.com/products/1903}}
}
The output is:
The following are my problems:
- How do I make natbib sort the order of the citations by their order of appearance in the document?
- How do I make natbib put [1], [2], etc. instead of these weird [Ada15a], [Ada15b] type citations?
Thanks a lot for your help!
Best Answer
The screenshot and description you've posted give the impression that you used to work with the
alpha
citation call-out style (probably achieved by specifying the bibliography stylealpha
, or something very similar) before switching over to an unsorted numeric call-out style, to be achieved by (a) using theunsrtnat
bibliography style and (b) loading thenatbib
citation management package with the optionnumbers
.After switching bibliography styles, it is mandatory to recompile the document with LaTeX, re-run BibTeX, and then re-run LaTeX twice more in order to propagate all changes. Did you remember to run this four-step process?
Two additional comments/suggestions:
The entry type
@online
is not actually defined by either theunsrtnat
or thealpha
bibliography style. In such cases, BibTeX falls back on the catch-all entry type@misc
to format the entries. The@misc
entry type recognizes and knows how to process the field namedhowpublished
.Be sure to prevent BibTeX from lowercasing uppercase-letter acronyms -- such as
USB
,RAM
, andMB
-- that occur in thetitle
fields of your entries. The easiest way to achieve this is to encase the contents of thetitle
fields in curly braces.Here's a modified version of your code that achieves your stated objectives and also preserves uppercase spelling of words in the
title
fields.