[Tex/LaTex] Reference sorting within the .bst file


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 ?

Best Answer

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: