Empty field in a BibTeX file causing Biber failing

(I'm writing on behalf of Overleaf Support.)

If one exports a BibTeX or BibLaTeX file from Zotero via the API that Overleaf connects to, an empty Zotero item causes Biber to crash.

The issue is that the empty item reads "@article{noauthor_notitle_nodate}" but Biber needs the comma there to be able to parse this: "@article{noauthor_notitle_nodate,}".

This comes up a lot in Overleaf Support as many Zotero users accidentally create an empty bibliography item.

One could argue that this is a bug in Biber, but I think it would be easier for Zotero to add this comma, as this would solve the issue also retrospectively, whereas a new Biber version would only available in new TeX Live versions.

You can check the issue using the following links:
This uses the original exported file and it crashes:
This has the comma added and it works:

Thanks s lot,

Tom Hejda
LaTeX Support & Product Specialist
  • Yeah, this makes sense to me. The alternative would be to just skip those items entirely, which might be even more elegant as a solution. We'll explore one of those.
    (Not sure when I have time to look at this, so PRs by anyone reading along more than welcome)
  • Thanks Adam for acknowledgement. If any more assistance or testing is needed, I'm available here or at tom.hejda at company. Thanks once more!
  • Given it's fine for the last field of an entry to have a trailing comma, this should be an easy change in translators/BibLaTeX.js:
    (a) remove the comma on line 289;
    (b) add Zotero.write(",") on line 320 at the end of writeField;
    (c) add + "," to Zotero.write on line 527

    And the same changes for translators/BibTeX.js on lines (a) 1051, (b) 1070, (c) 1358

    I would do it myself, but I wasn't able to find instructions to PRs. I suppose there is some versioning going on etc.
  • You can just edit the file and submit a PR on GitHub.
  • Ah ok, thanks, wilco.
Sign In or Register to comment.