3

What characters are valid in a biblatex entry key?

I'm asking because Zotero will export entry keys with <i>foo</i> in them, and pandoc-citeproc doesn't like that. But I don't know whether Zotero is too permissive, or pandoc-citeproc is too strict.

This is the error that pandoc-citeproc generates with an entry key like that:

pandoc-citeproc: "stdin" (line 10918, column 2):
unexpected "A"
expecting "c", "C", "p", "P", "s" or "S"
CallStack (from HasCallStack):
  error, called at src/Text/CSL/Input/Bibtex.hs:113:32 in pandoc-citeproc-0.10.4-BdOyQb33rzG2TMOLj4Fbp9:Text.CSL.Input.Bibtex
pandoc: Error running filter pandoc-citeproc
Filter returned error status 1
2
  • 3
    biblatex accepts <i>foo</i> as a bibkey with Biber and BibTeX as a backend. So the problem must lie elsewhere. In general you should try and use only ASCII letters and numbers as well as a few special characters such as -, ., :, _. Avoid non-ASCII letters (ä, ß, É) - even if they might work if you use an engine with full Unicode support and Biber. You should also avoid commas as well as braces (curly and otherwise).
    – moewe
    Commented Aug 27, 2017 at 18:54
  • 5
    For future reference, we removed html markup in citekeys in bibtex export from Zotero a while ago and it's an oversight that it remains in biblatex. We'll fix that, even if it may take a little time. See forums.zotero.org/discussion/comment/284813/#Comment_284813 for discussion.
    – adam.smith
    Commented Aug 27, 2017 at 21:25

1 Answer 1

8

An entry key may contain <, > and / if you use biblatex no matter if you use the legacy BibTeX backend or Biber. So <i>foo</i> is acceptable as part of a entry key.

In general, however, it is a good idea to only use ASCII letters (lowercase a-z and uppercase A-Z; keep in mind that the names are case sensitive), digits and a few special characters such as ., -, :, _, /.

If you use a fully Unicode-aware TeX engine such as XeLaTeX or LuaLaTeX your entry keys may also contain non-ASCII letters (with diacritics, from other scripts etc.) such as é, ß, Ä.

A key may never contain a comma (,) or braces or brackets (curly {, } or round (, )).

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .