0

I have the following bib file:

@article{blei2017_review,
  title        = {Some {Inference}: {A} {Review} for
                  {ECM}},
  volume       = 112,
  shorttitle   = {Some {Inference}},
  number       = 518,
  journal      = {Journal of the American Association},
  author       = {Blei, M. and Kucukelbir, Alp},
  year         = 2017,
  pages        = {859--877},
}

I would like to create a sensible bibtex config file doing the following:

  1. the text of each field should be on its own line, no wrapping to next line
  2. @article should be @Article, and @inproceedings => @InProceedings, etc.
  3. remove unnecessary fields like pages and number
  4. fields should be sorted author, title, etc.
  5. remove double braces like (e.g. title and shorttitle), should be {Some Inference: A Review for ECM}
  6. the key should be concat(author last name, year), and if same author has multiple papers on that year then append to consequent keys (a,b,c,...), for instance blei2017, blei2017b, ..., etc.

I don't know which variables control the above behavior and my elisp skill is for beginners.

Does anyone have a template config file with similar behaviour I can build on top of that?

Thanks!

Kirk Walla
  • 219
  • 1
  • 8

1 Answers1

1

See the bibtex-entry-format variable. For example, to change @inproceedings to @InProceedings, you will need to add unify-case to it. Then do M-x bibtex-clean-entry and it should make those changes for you.

jagrg
  • 3,914
  • 5
  • 19
  • Thanks for the reply, if you don't mind me asking do you have MWE, for instance will this work, (setq bibtex-entry-format ((unify-case . t), (opts-or-alts . (pages, number, abstract, annote)), (realign . t), (last-comma . t), (delimiters . 'double-quotes), (key . author-last-name-year-alphastring))) – Kirk Walla Dec 30 '21 at 15:11
  • 1
    It should be a list of symbols, so either (add-to-list 'bibtex-entry-format 'unify-case) or (setq bibtex-entry-format '(opts-or-alts required-fields numerical-fields unify-case)). – jagrg Dec 30 '21 at 16:58