I am using BibTeX. For overall configuration I use a .cls file. I am looking for a way to sort the bibliography in this order: Books, articles, and miscellaneous. Currently all types of materials get sorted according to author name. As I am not using author parameter for misc, all misc categories appear first, which I don't want to happen.
|
|
||||
|
|
|
Here's how to do it using
(The filecontents environment is only used to include some external files directly into the example, so that it compiles. It is not necessary for the solution.) |
|||||||||||
|
|
You need to change the sort keys in the bst file in order to achieve this. Suppose you use bibliography style alpha. Then copy
This pretty strange piece of code prefixes the sort keys for books with 01-, for articles with 02- and for all the rest with 99-. Note: If you wonder what all of that means: bibtex uses a stack based language inside the bst files, so you first push the arguments and then push the operator or function which pops its arguments from the top of the stacks, computes its result and then pushes the result on the stack. E.g. |
|||
|
|