12

I am trying to move to using biblatex with Biber rather than BibTeX. unfortunately, nearly all of my BibTeX entries have keys that include colons and parentheses. like,

@BOOK{Chambers+Hastie:(92),
  editor               = {Chambers, John M. and Hastie, Trevor J.},
  year                 = 1992,
  title                = {Statistical Models in S},
  publisher            = {Wadsworth and Brooks/Cole Advanced Books and Software},
  address              = {Pacific Grove, CA},
  annote               = {tree,glm,splus},
}

this is something Biber apparently doesn't care for. Is there a workaround that doesn't involve changing all my .bib files?

doncherry
  • 54,637
user25395
  • 121
  • Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}). – Claudio Fiandrino Feb 02 '13 at 12:54
  • @user25395 Could you elaborate a bit on 'does not like', for example by editing in the message you see? – Joseph Wright Feb 02 '13 at 12:59
  • It seems biber doesn't like the parentheses in Chambers+Hastie:(92) – cgnieder Feb 02 '13 at 13:06
  • If I have use the entry above, when i compile my document I only see the cite key. however, if i alter only the citekey (in both the .bib file and the document) to remove the colon and parentheses, like "Chambers+Hastie-92", my entry appears in the text and the bibliography is created. so it appears the special characters in the cite key, viz. "(", ")", and "+", are unacceptable in biber citekeys? – user25395 Feb 02 '13 at 13:14
  • 1
    @user25395 It's only the parentheses. + and : don't pose a problem. You could probably make a feature request as I don't think this behaviour is intended (I could be wrong, though). – cgnieder Feb 02 '13 at 14:47
  • 1
    @user25395: biber certainly don't like the braces: You should have warnings and errors in the log-file of biber (.blg). The "+" and the ":" works fine for me. – Ulrike Fischer Feb 02 '13 at 14:50
  • See my edited answer for a possible workaround of sorts. – PLK Feb 06 '13 at 06:51

1 Answers1

16

I'm afraid the reason for this is that the library used by biber (btparse) intentionally doesn't allow this. It aims to disallow some of the more questionable bibtex constructs on purpose (see http://search.cpan.org/~ambs/Text-BibTeX-0.66/btparse/doc/bt_language.pod). Keys can't contain any of:

" # % ' ( ) , = { }

with btparse. The reason it doesn't allow parentheses is because it (and so biber) allows them to be used instead of braces, e. g.:

@BOOK(key,
...
)

As a result, it's non-trivial to modify the old PCCTS parser to fix this.

Of possible help, however, is that biber supports key aliases:

@BOOK{key,
  IDS = {key(withparens)},
  ...
}

This means you can still do \cite{key(withparens)}

thymaro
  • 1,507
PLK
  • 22,776