I am trying to customize the behavior of M-x bibtex-entry-format function to reformat a bibtex entry in a bib file.

I want that the various fields in an entry are sorted to a given ordering. In my emacs init file I put this:

(setq bibtex-entry-format
      `(page-dashes required-fields
         numerical-fields whitespace last-comma delimiters
         unify-case sort-fields))

so it applies sort-fields to its default behavior, however, I want to customize it. How can I set my sort-field own criteria?


Not tested, but looking at the docstring of bibtex-entry-format, it says:

bibtex-entry-format is a variable defined in bibtex.el. Its value is
(opts-or-alts required-fields numerical-fields)

Type of formatting performed by bibtex-clean-entry.
It may be t, nil, or a list of symbols out of the following:
sort-fields Sort fields to match the field order in bibtex-BibTeX-entry-alist.

My understanding is that you have to tweak bibtex-BibTeX-entry-alist and adapt it to your needs.

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.