about | blog | config | notes | github

1. Manage Bibliography Entries

BibTeX is pimarily used by LaTeX to manage bibliography entries. GNU/Emacs already provides a major-mode for editing BibTeX files.

2. Configuration

2.1. Setup Spellcheking

In bibtex-mode buffers, let's also have spell checking setup. Can't be writing citations with typos. We incorporate flyspell which is part of the Flycheck Syntax Checking package.

(require 'init-flycheck)
(add-hook 'bibtex-mode-hook 'flyspell-mode)

2.2. User Defined Fields

We can have specially defined fields that are not normally added by bibtex-mode.

(setq bibtex-user-optional-fields
      '(("keywords" "Keywords to describe the entry" "")))

Disable the use of OTP keys.

(setq bibtex-include-OPTkey nil)

2.3. Alignment

Let's make bibtex-mode's formatting more pretty

(setq bibtex-align-at-equal-sign t)

2.4. Org Export Support

We should provide BibTeX export support for Org-mode. Make sure to pull in Org-mode first however!

(require 'init-org)

What we want to do is change the build command for LaTeX in Org-mode to support the BibTeX as well. By using latexmk, as its runs pdflatex the correct number of times and also runs bibtex as well to ensure references are correctly built.

(setq org-latex-pdf-process '("latexmk -pdf -outdir=%o %f"))

2.5. Feature Provide

(provide 'init-bibtex)

Created: 2021-11-13

Emacs 26.1 (Org mode 9.5)