Q: how do I set a specific separator in bibtex-mode's autokey generator?


I am working with bibtex-mode. It has a feature to auto-generate the entry key, which is customizable.


My goal is to get the autokey to work as follows:

  • One author: authorname:year.
  • Two authors: authorname1-authorname2:year.
  • Three or more authors: authorname1-etal:year.

Almost There

The following settings almost get me there:

(setf bibtex-autokey-additional-names "etal"
      bibtex-autokey-name-separator "-"
      bibtex-autokey-name-year-separator ":"
      bibtex-autokey-year-length 4
      bibtex-autokey-names 1
      bibtex-autokey-names-stretch 1
      bibtex-autokey-titlewords 0)

The Specific Problem

It works for one and two authors. However, for three or more authors, the generated key is:


rather than the desired, hyphen-separated


How do I get the hyphen separator between the author name and the etal?


  author       = {Bob Smith},
  title        = {A title},
  journal      = {A journal},
  year         = 2014

produces smith:2014

  author       = {Bob Smith and Frank Jones},
  title        = {A title},
  journal      = {A journal},
  year         = 2015

produces smith-jones:2015

  author       = {Bob Smith and Frank Jones and Joe Johnson},
  title        = {A title},
  journal      = {A journal},
  year         = 2016

produces smithetal:2016 (and I want smith-etal:2016)

1 Answer 1


Would the simple, if slightly barbaric, solution of setting bibtex-autokey-additional-names to "-etal", (with a hyphen built-in), work for you?

It has the advantage that you don't have to source-dive or modify any of the elisp functions.

  • 2
    Oiy, yes, that works just fine. The autokey machinery is so intricate that I was searching around for the right nob to adjust, and it never occurred to me that there was a very simple answer available. Thanks!
    – Dan
    Commented Jul 18, 2017 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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