Zotero exports duplicate BibLaTeX citekey entries


Error report: 963135564

When exporting chapters with almost similar titles, Zotero generates the same bibtex/biblatex citekey for both titles. This obviously causes one of them to be ignored when importing into LaTeX.

Organisation og Omgivelser i et Normperspektiv

Organisation og Omgivelser i et Rationelt Perspektiv

Both get the following citekey:

I just switched from Mendeley that was able to automatically make sure that keys never duplicated or interfered.
  • edited March 25, 2021
    If you're using a BibTeX-based workflow, you'll want to use the Better BibTeX plugin, which adds vastly more advanced BibTeX functionality. Zotero's stock BibTeX export is meant for generic data exchange.
  • edited March 26, 2021
    It works for some titles, e.g. some chapters in the same book, Zotero adds af "-1" after the title, thus ensuring unique citekeys.

    It should be relatively straightforward and part of the basic functionality to make sure that keys do not clash. Otherwise you will just scare away users who are used to better software, such as Mendeley.

    Workaround to make Zotero work without installing extra software to perform a basic task is to write in the "Extra" cell:

    Citation Key: xxxxxxxxxx

    where 'xxxxxxxxxx' becomes the citekey in LaTeX.
  • who are used to better software, such as Mendeley
    Just to be totally clear, Better BibTeX provides far more advanced functionality than Mendeley. Extensibility is a feature, not a limitation. The fact that BBT exists means that we don't spend a lot of time focusing on BibTeX in stock Zotero — which, again, is meant primarily for generic data exchange, such as moving data to another reference manager — and instead work on things that benefit many more people. (And BBT itself has probably received more development in the last few years than Mendeley.)

    In any case, if you can provide a specific steps to reproduce this with the stock exporter, we'll look into it. If I create two journal items with the titles you give above and export them with the stock BibLaTeX exporter, I get "-1".

    Re: Citation Key in Extra, Zotero will be gaining a proper Citation Key field soon along with many other field updates, and values in Extra will be migrated at that time. In the meantime, yes, you can use that to set a specific citation key. But you should still use BBT if you're using Zotero with a BibTeX-based workflow, because that's what it's designed for.
  • edited March 26, 2021
    @henrex the citekeys generated by Zotero without Better BibTeX only exist during export, not before or after; the disambiguation postfix (-1, -2, etc) is only determined at time of export among the items exported together. If you export both "Organisation og Omgivelser i et Normperspektiv" and "Organisation og Omgivelser i et Rationelt Perspektiv" together, one of them will get a postfix, but if you export them separately, neither of them will, since the export only sees the items being exported; it can't see potential clashes with other parts of your library.

    The citekeys generated by Better BibTeX are generated ahead of export, and disambiguation happens then, across your entire library. At time of export, the keys are already determined. Better BibTeX also supports the "Citation Key" in the extra field, so that will carry over.

    Mendeley's bib(la)tex generation is very poor. Aside the more advanced workflow and integrations you get with Better BibTeX, I doubt the people at Mendeley who built it have ever looked at the bib(la)tex manuals or even used bib(la)tex for much, as even basic exports aren't right -- Mendeley:
    • is still double-bracing full titles, a behavior so wrong (yet unfortunately ubiquitous), bib(la)tex processors started ignoring it. If it did work, styles that demand casing different from what you happened to have in Mendeley will render incorrect bibliographies -- and this is not configurable as far as I can tell;
    • does not title case on export, meaning styles that demand title-case will all yield a incorrectly formatted bibliography;
    • exports verbatim fields (clearly marked so in the manual) as regular fields, meaning they will either not import at all elsewhere, or import only partially.
    • https://ramblingacademic.com/2016/06/19/fixing-bibtex-files-mendeley/
    • ...
    And that's just what I can recall right now. Given the clear misunderstanding of bib(la)tex evident in these problems I'm sure there's many more gaffes in Mendeley's bibtex support.
  • " the disambiguation postfix (-1, -2, etc) is only determined at time of export among the items exported together. If you export both "Organisation og Omgivelser i et Normperspektiv" and "Organisation og Omgivelser i et Rationelt Perspektiv" together, one of them will get a postfix"

    No not the case when using the syncing integration with Overleaf, but I see that they solved this issue now and that the postfixes are now correctly applied.
  • I don't think anything has changed, unless you have pinned your citekeys. The stock bibtex exporter has no memory, so it can't know that two items with the same base key will be exported.
Sign In or Register to comment.