[bug] BibTeX key generation

When BibTeX.js removes the small words from the title to form that part of a BibTeX key, it apparently removes both the beginning space, so that a title like

Love on a Platter by Smith in 1980

ends up with


rather than the expected


It will even merge more than two words to make a reallylongbibtexkey if those words each have the small words in between them.

I'd be glad if this were fixed, and can't manage to do it myself.


and (if you have the inclination):

I'd also be glad to have the list of ignored small words (typically including prepositions, articles and conjunctions) expanded to include the articles of --at a start--- German, Spanish and French.

I suggest that the following might be added to the regex:


(plus perhaps the l' of the elided French article. But I expect that would take it's own pass, since it's not separated from its noun by a space.)

This is a change I can make for myself, but I think others might appreciate it as well. Of course a more ambitious expansion could include prepositions and conjunctions in those languages, a larger selection of English prepositions, and perhaps venture into other languages, but the above change is pretty simple and would take takes us a good deal further than we are now. Articles are any way more common as initial title words than the other small words.

  • I forgot to add these articles to the small words list. I was reminded by the documentation for bibtool


    That should cover, as I said, French/German/Spanish articles.
  • I also see the bug with the "Love on a Platter by Smith in 1980" title exported to "smith_loveplatter_1980" key.

    And I would vote for adding the pruposed keywords to the list.
  • I may have a patch that fixes both of these things. I'll test some more and post it in the next few days.
  • edited June 5, 2010
    Patch submitted to Zotero-Dev for both of these issues. I noticed no bad side effects at all when exporting my fairly large library. It made about 15% of my BibTeX keys more friendly (300 of 1800). And by my stopwatch-benchmarking, it also speeds up BibTeX export by about 15%, even though it triples the number of articles and common more-grammatical-than-lexical prepositions it excludes from the BibTeX key.

    I'd be very glad if the patch could be considered for inclusion.

Sign In or Register to comment.