How to order citations by appearance using BibTeX?
There are three good answers to this question.
- Use the
unsrt
bibliography style, if you're happy with its formatting otherwise - Use the
makebst
(link) tool to design your own bibliography style
And my personal recommendation:
- Use the
biblatex
package (link). It's the most complete and flexible bibliography tool in the LaTeX world.
Using biblatex
, you'd write something like
\documentclass[12pt]{article}
\usepackage[sorting=none]{biblatex}
\bibliography{journals,phd-references} % Where journals.bib and phd-references.bib are BibTeX databases
\begin{document}
\cite{robertson2007}
\cite{earnshaw1842}
\printbibliography
\end{document}
Change
\bibliographystyle{plain}
to
\bibliographystyle{ieeetr}
Then rebuild it a few times to replace the .aux
and .bbl
files that were made when you used the plain style.
Or simply delete the .aux
and .bbl
files and rebuild.
If you use MiKTeX you shouldn't need to download anything extra.
The best I came up with is using the unsrt
style, which seems to be a tweaked plain
style. i.e.
\bibliographystyle{unsrt}
\bibliography{bibliography}
However what if my style is not the default?