Back Table of contents Index Next   BibTool Manual
Reference Manual
Sorting

Sorting

The entries can be sorted according to a certain sort key. The sort key is by default the reference key. Sorting can enabled with the command line switches -s and -S as in

bibtool -s
bibtool -S

The first variant sorts in ascending ASCII order (including differentiation of upper and lower case). The second form sorts in descending ASCII order. The same effect can be achieved with the boolean resource values sort and sort.reverse respectively.

sort = {on}
sort.reverse = {on}

The resource sort determines whether or not the entries should be sorted. The resource sort.reverse determines whether the order is ascending (off) or descending (on) ASCII order of the sort key. The sort key is initialized from the reference key if not given otherwise.

Alternatively the sort key can be constructed according to a specification. This specification can be given in the same way as a specification for key generation. This is described in section Key Generation in detail.

The associated resource name is sort.format. Several formats are combined as alternatives.

sort.format = {%N(author)}
sort.format = {%N(editor)}

Those two lines are equivalent with the single resource

sort.format = {%N(author) # %N(editor)}

This means that the sort key is set to the (normalized) author names if an author is given. Otherwise it tries to use the normalized editor name. If everything fails the sort key is empty.

Let us reconsider the unprocessed example on page Key Generation. Without any sort.format instructions this entry would sorted in under ``article-full''. With the sort.format given above it would be sorted in under ``Aamport.LA''.

Note that in ASCII order the case is important. The uppercase letters all come before the lowercase letters. Beside the normal entries the macros (string entries) are sorted. This happens in per default. The resource sort.macros can be used to turn off this feature as in

sort.macros = {off}

An example of sorting can be seen in section Sorting and Merging on page Sorting and Merging.


Summary



Back Table of contents Index Next   BibTool Manual
Reference Manual
Sorting
© 1999 Gerd Neugebauer