0

I'm using \cite{} to reference from a .bib file into my document.

The problem is, references show up in a random order. For example I cite the first reference and on the output PDF, the number of the reference shows as [9] then the next one will be [4].

How can I fix this?

  • 2
    they are unlikely to be in random order. The order is specified by the bibliography style that you used (you have not said which) usually either order of citation or alphabetic order of author name, – David Carlisle Mar 30 '18 at 20:06
  • Apologies, \bibliographystyle{abbrv} \bibliography{bib1} – user309575 Mar 30 '18 at 20:12
  • abbrv sorts citations by author names. If you want citations to sort by order of appearance in the text \bibliographystyle{unsrt} might be for you. – moewe Mar 30 '18 at 20:14
  • 1
    so it is in alphabetical order of author (the form I find most natural as it happens) you want an unsorted style such as unsrt if you want it ordered in citation order – David Carlisle Mar 30 '18 at 20:14
  • Use the option sort or sort&compress. If this still does not work then open the folder in which your .tex file is located. There, you will find files that have the same name as that of your .tex file except that their extensions are different. Delete all of these files and then run the compilation again. – Al-Motasem Aldaoudeyeh Mar 30 '18 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.