I am using a master thesis template which was prepared from my university. But when I compile my thesis, the references are sorting alphabetically instead of by appearance in the document. I have one .bst file. But I couldn't find any clue about "sorting" or "ordering" in the .bst file. So how could I change the sorting from alphabetically to appearance order in the file from my .bst file ?

  • 5
    Welcome to TeX.sx! You should tell us which .bst file you use (and provide a link if it's not available at CTAN).
    – lockstep
    Commented Dec 18, 2012 at 17:40
  • 7
    It's also worth noting that if your university provides a template then presumably they expect alphabetical reference sorting.
    – Joseph Wright
    Commented Dec 18, 2012 at 17:41
  • @lockstep here is my bib.bst file: gist.github.com/4335953 JosephWright yes you' re right. They mentioned in the "How to write" section, there are 2 ways to sort references that you can choose. But they didn't prepare the example for sorting appearance in the document..
    – Yirmidokuz
    Commented Dec 19, 2012 at 16:26

2 Answers 2


Sorting of the references is indeed controlled by the bst file. This is not something that you should be changing separately: Choose a bst file that is suited for (presumably) numeric citation style, and it will almost certainly sort by order of citation. (If you're using the name-year citation style, you should be sorting your references alphabetically as well). If you otherwise like the looks of the style you have, identify it here and ask about look-alikes.

PS. bst files are written in a strange stack language that I recommend you don't bother with. Unless you have a very strange style, you'll find the sort command about 30 lines from the bottom of the file. It looks like this:

  • There is not any word like sort. I can not find it. I uploaded the .bst file. You can check there: gist.github.com/4335953
    – Yirmidokuz
    Commented Dec 19, 2012 at 11:10
  • Thanks, dude. Removing SORT command from the bst file worked for Springer splncs03.bst.
    – Gobinath
    Commented Oct 1, 2016 at 5:18

Your bibtex style seems to be an older makebst style, so probably you are using the natbib package. To get entries sorted by order of citation, use the unsrtnat style. Further options are unsrt, and unsrturl.

Edit Looking closer at the style file you provided, there really is no sorting going on, so you should get your references in order of citation. I tried

\providecommand{\bolum}{Chapter }


\bibliographystyle{Yirmidokuz}  % that is the style file you provided
\bibliography{xampl}  % this is an example bibliography that is contained in all TeX distributions

and got:

pdflatex output

As you can see, the references are in order of citation. Are you sure that you use the style file you provided?

  • I am using the style file at gist.github.com/4335953. Because it helps me to design my bibliography as my university wanted. But still I cannot the way out for sorting them by order of citation.
    – Yirmidokuz
    Commented Jan 18, 2013 at 11:37
  • @Yirmidokuz I updated my answer.
    – mafp
    Commented Jan 18, 2013 at 13:02
  • yes, I am totally sure that I am using the style file provided above. The weird thing is that, in the document first citation takes the number two and the number one goes to citation of an image which is placed much after than the place of the text cited as number 2.
    – Yirmidokuz
    Commented Jan 18, 2013 at 13:21
  • Wait, you have images of your document in the bibliography?! You should not do that. The bibliography is only for things that you actually cite, e.g., books and articles. If you want a separate list of the figures in your document, use \listoffigures.
    – mafp
    Commented Jan 18, 2013 at 20:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .