[Tex/LaTex] bibtex: order references as in bibtex file

bibtex

I am working with the cite package for ieeetran document class and am using a separate bibtex file for managing the references.

I wanted the references in my pdf to appear in the order in which I have made the entries in the bibtex file. How can this be done?

Best Answer

Assuming you're using the IEEEtran bibliography style, there is a very simple method.

Add \nocite{*} just after \begin{document} and you will have all entries sorted according to their position in the .bib file.

MWE:

\documentclass{IEEEtran}
\usepackage{cite}

\usepackage{filecontents}
\begin{filecontents*}{examplebib.bib}
@article{art1,
author={First Last},
title={A fictitious journal article},
year=1900,
journal={Journal of nothingness},
volume=2,
pages={1-2}
}

@article{art2,
author={Assd},
title={A fictitious journal article},
year=1900,
journal={Journal of nothingness},
volume=2,
pages={1-2}
}

@book{boo1,
author={Respectable Writer},
title={A silly book},
year=2000,
publisher={PublishCo},
address={Somewhere}
}
\end{filecontents*}

\begin{document}
\nocite{*}

Welcome to TeX.SX. Here we cite \cite{art2} and \cite{boo1} and \cite {art1}

\bibliographystyle{IEEEtran}
\bibliography{examplebib}

\end{document} 

Output:

enter image description here