3

Biber in tool mode used to sort fields within entries (not: entries in the BIB file!) alphabetically by default. Newer versions of Biber apply rather strange sorting by default. Is it possible to get back alphabetic sorting?

For all examples I ran biber --tool --output_file out.bib input.bib.

Input:

@REPORT{Self2016,
  DATE      = {2016},
  TITLE     = {The title},
  AUTHOR    = {Self, My}
}

Biber 2.5 and 2.6 sort correctly:

@REPORT{Self2016,
  AUTHOR = {Self, My},
  DATE = {2016},
  TITLE = {The title},
}

However, other fields are not sorted alphabetically, for example URL:

Input:

@REPORT{Self2016,
  DATE      = {2016},
  TITLE     = {The title},
  AUTHOR    = {Self, My},
  URL       = {http://example.net}
}

Biber 2.5 sorts correctly:

@REPORT{Self2016,
  AUTHOR = {Self, My},
  DATE = {2016},
  TITLE = {The title},
  URL = {http://example.net},
}

Biber 2.6 does not (URL should be last):

@REPORT{Self2016,
  AUTHOR = {Self, My},
  URL = {http://example.net},
  DATE = {2016},
  TITLE = {The title},
}

Biber 2.7 (beta) behaves like Biber 2.6. The strange sorting is not limited to URL fields but applies to INSTITUTION and LOCATION as well (and maybe others).

Is there an option to enforce alphabetic sorting of the fields?

1 Answer 1

3

Four years later, I found the answer myself, at the very end of Section 3.13. Tool Mode in the manual:

The order of the fields when writing BibTeX data is controlled by the --output-field-order option. This is a comma-separated list of fields or field classes and fields will be output to entries in the order specified. Any unspecified fields will be output in sorted order after the specified fields.

The default is (from biber -help):

By default, its value is 'options,abstract,names,lists,dates'.

As all unspecified fields are output in sorted order automatically, the trick is to set the option specifying no fields. Passing no value throws an error, but passing a whitespace character works. So the solution is:

biber --tool --output_file=out.bib input.bib --output-field-order=" "

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.