typst / biblatex

A Rust crate for parsing and writing BibTeX and BibLaTeX files.
Apache License 2.0
120 stars 15 forks source link

Support `/` as an entry key delimiter #33

Closed Neved4 closed 8 months ago

Neved4 commented 1 year ago

A BibLaTeX entry key, of the form name1/name2 currently fails:

@online{baez/online,
  author       = {Baez, John C. and Lauda, Aaron D.},
  title        = {Higher-Dimensional Algebra {V}: 2-Groups},
  date         = {2004-10-27},
  version      = 3,
  langid       = {english},
  langidopts   = {variant=american},
  eprinttype   = {arxiv},
  eprint       = {math/0307200v3},
}

Reference: biblatex-examples.bib

zepinglee commented 8 months ago

The / character here is not a delimiter. Actually it has no special meaning.

The entry key in the original BibTeX only forbids ,, }, and whitespaces in a brace-style entry, or , plus whitespaces in a parenthesis style entry (see aclements/biblib). The following are valid entry keys for BibTeX. Although some characters (e.g., # and \) are not allowed in a LaTeX \cite command, the entries can still be crossrefed or listed out with \nocite{*}.

@misc{!"#$%&'()*+-./123:;<=>?@ABC[\]^_`abc{|~,
  author = {John Doe},
}

@misc(!"#$%&')(*+-./123:;<=>?@ABC[\]^_`abc{|}~,
  author = {John Doe},
)

Biber, which uses btparse as the underlying parser, only allows letters, digits, and the following characters in entry key: ! $ & * + - . / : ; < > ? [ ] ^ _ ` | (see Text-BibTeX/btparse).

reknih commented 8 months ago

Thank you!