Menu

Sorting

Philip Kime Philipp Lehman

Sorting

  1. Built-in sorting schemes are declared with convenenience names like "nyt" etc. using LaTeX macros.
  2. BibLaTeX style authors can define their own sorting scheme using these macros and users can refer to them by the convenience names.
  3. On compilation, BibLaTeX writes the sorting schemes explicitly, without convenience names, to the control file.
  4. Sorting schemes can be defined only globally - per-type makes no sense.
  5. Biber reads the control file and applies the sorting scheme(s).
  6. Sorting is 2-pass. This is to allow labelalpha and labelyear generation based on an initial sort. This ensures the following won't happen in alpha sorting styles (like anyt):

    [Doe95a] John Doe, Sorting algorithms, 1995.
    [Doe95b] John Doe, Algorithms for sorting, 1995.

    To avoid this, we need to do an initial sort on "nyt" in order to get the titles in the right order and only after that, apply the labels for the same year. This requires a 2-pass sorting with the labelalpha field generation after the first sort but before the second.

Currently, the following sorting tests are defined and pass with the Biber experimental sorting code:

  • standard nty, nyt, nyvt, anyt, anyvt, ynt, ydnt equivalents
  • alphabetical without labelalpha option defined
  • with sortkey defined
  • debug sorting
  • custom and per-type presort string
  • Sorting which exludes certain fields (forcing them to sort before any others)
  • short-circuit in arbitrary place (other than after defined sortkey)
  • useauthor, useeditor and usetranslator all off, sortname should be ignored
  • sorting on citekey only (default sort)
  • Generation of first and second pass sorting schemes
  • \alphaothers set by both maxnames and "and others" in .bib
  • ascending/descending sorts with different padding/sides for all date-related fields
  • different padding/sides for volume field
  • 2-pass sorting as per example 6 above
  • sorting on list items publisher, location, address, institution, school and organization. These also obey the maxitems and minitems settings.

Unsorted bibliographies

With the BibLaTeX option "sorting=none", the user can choose to leave the references in citation order. This needs a special entry for the sorting specification in the .bcf file:

  <bcf:sorting type="global">
    <bcf:sort order="1">
      <bcf:sortitem order="1">citeorder</bcf:sortitem>
    </bcf:sort>
  </bcf:sorting>

Related

Wiki: Space.menu

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.