Skip to main content

Module citekey

Module citekey 

Source
Expand description

Citation keys from a template (#610).

cite and bib key every entry by its safekey (doi_10.1007_BF01340294) unless told otherwise, and that stays the default: it is stable and collision-free by construction. A project that keeps human keys (fock1930naherungsmethode) asks for a template instead:

placeholdervalue
{author}first author’s family name, lower-cased and ASCII-folded
{year}the year, or nothing when unknown
{title_word}first significant title word, lower-cased and ASCII-folded
{safekey}the safekey itself

Folding is Unicode NFD with the combining marks dropped (Näherung -> naherung), plus the letters NFD does not decompose (ß -> ss, ø -> o, æ -> ae, …). “Significant” skips articles and prepositions in English, German and French. Any character a BibTeX key cannot carry is dropped. A template that renders empty – no author, no year, no title – falls back to the safekey rather than emitting @article{,.

Enums§

KeyTemplateError
Why a key template was refused.

Functions§

disambiguate
Suffix a key that already appears in used with a, b, … (the biblatex convention for the same author and year), and record it.
is_valid_key
Whether key is usable as-is as a BibTeX / biblatex citation key: non-empty and made only of letters, digits and -_:.+/. An explicit --key is checked with this and refused otherwise, rather than silently rewritten: smith, 2020 would otherwise end the key at the comma and shift every field after it (review of #622).
render_key
The key template gives m, whose safekey is safekey.
validate_template
Check template without rendering it, so a bad --key-template or [cite] key_template fails before any network work.