I have posted a question regarding this matter in here. Some ppl suggest me to use unsrt
for numeric case of citations since I'm using .bib
. This works sometimes and sometimes switches to another mode that I don't want. To illustrate the problem, this is code my code
\documentclass{article}
\begin{document}
hshshhhs \cite{2} \cite{1} \cite{3} \cite{4}
\bibliographystyle{unsrt}
\bibliography{references}{}
\end{document}
The references.bib is
@article{1,
author ={H. Durrant-Whyte, T. Bailey},
title = {Simultaneous localization and mapping: part I},
publisher = "Robotics Automation Magazine, IEEE",
year = {2006},
volume = "13",
pages = {99-110}
}
@incollection{2,
year={1996},
isbn={978-1-4471-1257-0},
booktitle={Robotics Research},
editor={Giralt, Georges and Hirzinger, Gerhard},
doi={10.1007/978-1-4471-1021-7_69},
title={Localization of Autonomous Guided Vehicles},
url={http://dx.doi.org/10.1007/978-1-4471-1021-7_69},
publisher={Springer London},
author={Durrant-Whyte, Hugh and Rye, David and Nebot, Eduardo},
pages={613-625},
language={English}
}
@book{3,
author = "Mr. X",
title = {Mr. X Knows BibTeX},
publisher = "AWOL",
YEAR = 2005,
}
@misc{ 4,
author = "Nobody Jr",
title = "My Article",
year = "2006" }
The output is
Since I'm using \cite{2}
, I'm expecting the output to be [2]
but for somehow latex rearranges the references list to something I don't want. It is so confusing now. Any suggestions why this occurs.
Best Answer
unsrt
numbers citations in the order they appear in the document. The2
in the\cite{}
command and in the.bib
file is just the "key" that's used to refer to the entry; it has nothing to do with the numbering of the citations.I don't see how it could simplify the citations: the whole point of BibTeX is to make it so you don't have to worry about any of this stuff (see my notes below).
You can use
\nocite{<keys>}
to force the order.But first, in general, numerical keys are very confusing:
When writing the document, most people say,
and write
\cite{duckington98a}
or whatever pattern they've chosen, notHere's how you could do it if you really wanted to: