crossmem generates citation keys using a pattern DSL inspired by Better BibTeX . The pattern is configured in ~/.crossmem/config.toml:
[cite_key]
pattern = "[auth:lower][year][shorttitle:1:nopunct]"
A pattern is a string of tokens (inside [brackets]) and literal characters (outside brackets).
[field:modifier1:modifier2]literal_text[field2]
Token Description Example output
authFirst author’s last name Vaswani
authorsAll authors’ last names concatenated VaswaniShazeer
yearPublication year 2017
shorttitleFirst N significant words from title (stop words filtered) attention
titleFull title Attention Is All You Need
shorttitle filters out common stop words (a, an, the, is, are, was, for, of, with, …) and takes the first N remaining words. N is specified as a numeric modifier.
Example with title “Attention Is All You Need”:
[shorttitle:1] → attention
[shorttitle:3] → attentionneed (after filtering “Is”, “All”, “You”)
Modifiers are appended to the token with : separators and applied in order:
Modifier Description Example
lowerLowercase VASWANI → vaswani
upperUppercase vaswani → VASWANI
nopunctRemove all non-alphanumeric characters hello-world! → helloworld
condenseRemove all whitespace hello world → helloworld
N (digit)For shorttitle: take first N words. For other fields: take first N whitespace-delimited words. [shorttitle:1] → first significant word
pattern = "[auth:lower][year][shorttitle:1:nopunct]"
Paper Generated key
Vaswani et al., “Attention Is All You Need”, 2017 vaswani2017attention
LeCun et al., “Deep Learning”, 2015 lecun2015deep
pattern = "[authors:lower][year]"
Paper Generated key
Vaswani & Shazeer, “Attention Is All You Need”, 2017 vaswanishazeer2017
pattern = "[auth:lower]_[year]"
Paper Generated key
Vaswani et al., 2017 vaswani_2017
pattern = "[title:condense:lower]"
Paper Generated key
“Attention Is All You Need” attentionisallyouneed
pattern = "[auth:lower][year][shorttitle:3:nopunct]"
Paper Generated key
Vaswani et al., “Attention Is All You Need”, 2017 vaswani2017attentionneed
If a generated key collides with an existing entry, crossmem appends a suffix:
Try a through z: vaswani2017attention → vaswani2017attentiona
If all 26 letters exhausted, append _<count>: vaswani2017attention_27