I am trying to sort a bib file alphabetically using Bibtool, but I am looking for sorting the entries by types then by keys. For instance, first all the articles, then the books, etc…
With, all the articles sorted alphabetically by keys, then same with the books.
It looks like it should be a command like:
bibtool -s -sort.format={@type $key} -i BiBin.bib -o BiBout.bib
Thank you all for your help
Romain
Best Answer
Following the example on page 60 of the BibTool manual, the type can be specified with
%s($type)
.Example:
bibtool -s --sort.format='{%s($type) %s($key)}' -i bibsort.bib -o bibsorted.bib
Note that you need single quotes in the terminal command to prevent variable substitution by the terminal.