5.2.2.2 Creating, Updating, and Deleting BibTeX Structures

images/casual-bibtex-screenshot

In Casual BibTeX, CRUD (CReate, Update, Delete) operations for entry and field structures are intended to be achieved through their respective commands. This contrasts with manual editing of a buffer to achieve the same end, which is prone to errors.

Creating an Entry

To create a new entry, use the “A Add…” command. You will be prompted in the mini-buffer with completion support for the entry type. This new entry will be inserted relative to existing entry where the point is with all fields supported by the entry type enumerated. Fields with the temporary prefix of “ALT” or “OPT” denote a field that is alternate or optional. Use the command “o Remove OPT/ALT” to remove this prefix.

When all desired information for a BibTeX entry has been entered, it can be “cleaned” using the command “C-c Clean”. Cleaning an entry will:

  1. Generate a unique citation key, if needed.
  2. Remove all unused fields.

By default, cleaning an entry will not format (or “fill”) the entry. This can be changed by setting the customizable variable bibtex-clean-entry-hook to include the command bibtex-fill-entry. This can be done from “Hooks” section in the Settings menu (Settings).

Creating a Field

To create a new field, use the “a Add…” command. You will be prompted in the mini-buffer with completion support for the field type. This new field will be inserted relative to existing field where the point is.

There are two components to a field:

key

the field name, referred to in the menu as ’k’.

value

the value of the field, referred to in the menu as ’v’.

A “brute-force” command to enumerate all fields for an entry is provided by the “u Update…” command. Clean the entry to remove all unpopulated fields after using it.

BibTeX mode has its own kill-ring

BibTeX has its own kill-ring variable bibtex-entry-kill-ring which the following menu commands use:

c Copy∙ k,v

Copy the whole field, both key and value.

C Copy∙

Copy the entry.

k Kill∙

Kill the entry.

y Yank∙

Yank the entry or field.

M-y Yank-Pop∙

Yank-pop the entry or field.

The “∙” annotation in a menu label denotes commands that do not use the kill-ring, but bibtex-entry-kill-ring instead.

Search and Jump

The ability to search and jump to a position in a BibTeX database are offered by the following menu commands:

/ Search…

Search the BibTeX database.

j Jump…

Move point to a citation key.