By default (using the plain
style) BibTeX orders citations alphabetically.
How to order the citations by order of appearance in the document?
By default (using the plain
style) BibTeX orders citations alphabetically.
How to order the citations by order of appearance in the document?
The datatool package offers a nice way to sort bibliography by an arbitrary criterion, by converting it first into some database format.
Short example, taken from here and posted for the record:
I'm a bit new to Bibtex (and to Latex in general) and I'd like to revive this old post since I found it came up in many of my Google search inquiries about the ordering of a bibliography in Latex.
I'm providing a more verbose answer to this question in the hope that it might help some novices out there facing the same difficulties as me.
Here is an example of the main .tex file in which the bibliography is called:
...and an example of the .bib file itself:
Note the references in the .bib file are listed in reverse order but the references are listed in the order they are cited in the paper.
More information on the formatting of your .bib file can be found here: http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management
If you happen to be using
amsrefs
they will override all the above - so comment out:\usepackage{amsrefs}
You answered your own question---
unsrt
is to be used when you want references to ne listed in the order of appeareance.But you might also want to have a look at natbib, an extremely flexible citation package. I can not imagine living without it.
Just a brief note - I'm using a modified version of plain.bst sitting in the directory with my Latex files; it turns out having sorting by order of appearance is a relatively easy change; just find the piece of code:
... and comment it - I turned it to:
... and then, after running
bibtex
,pdflatex
,pdflatex
- the citations will be sorted by order of appearance (that is, they will be unsorted :) ).Cheers!
EDIT: just realized that what I wrote is actually in the comment by @ChrisN: "can you edit it to remove the SORT command" ;)