4

I have a LaTeX Overleaf project article and I use the connection to my Zotero database to generate the .bib file used in my project.

I recently installed the Better BibTex package with the aim to sync all this process. It has generated new citation keys for my bibliography entries. Fine.

But when, in Overleaf, I import my Zotero account database, with the dedicated Add Files import menu, it comes with its own citation keys, not with the citation keys generated by Better BibTex.

enter image description here How to force Overleaf to use the Better Bibtex citation keys instead of Zotero keys?

2
  • 3
    [Disclaimer: I'm a support personnel at Overleaf.] The Zotero Web Exporter API, which Overleaf's "import Zotero library" hook into, is completely separate from your Zotero Desktop exporter, and can't be customised. If you want to use Better BibTeX output, you will need to export the .bib from your Zotero Desktop and upload it into your Overleaf project. If you would like to be able to "sync" and refresh this .bib file, you can put this .bib file in your Google Drive etc instead: see overleaf.com/help/247 under the heading "Linked File".
    – imnothere
    Mar 30, 2020 at 2:04
  • As you are staff, is that now implemented/fixed? Thanks! Nov 3, 2022 at 13:58

1 Answer 1

10

The API that Zotero provides which Overleaf uses does not have access to the database in which BBT keeps its keys1. There are two ways to get your keys into Overleaf:

  1. In Zotero, pin your BBT keys (right-click the items in Zotero, option Better BibTeX -> Pin BibTeX key. This will write them in the extra field of your items, and those keys will no longer change when the item does. The zotero API will use the keys it finds there. This will bring your keys to Overleaf, but not the BBT-generated bib(la)tex.
  2. Auto-export the file using BBT to a folder that is synced to Overleaf using Dropbox, Google Drive, or their git support. This will bring the full BBT-generated bib(la)tex file to overleaf, which will include your citekeys.

You can also have BBT generate keys that are usually identical to the keys that the Zotero API gives to overleaf by default, so that the keys you have locally and the keys you see in Overleaf will usually be the samen. But the process by which the Zotero API generates these keys may vary the keys it offers per item sometimes, so this cannot be guaranteed.


1 by necessity. BBT is not allowed to add extra fields to the Zotero database, and they wouldn't sync anyway. A change in Zotero is planned that will add a formally supported citation key field to Zotero items; BBT will put its keys there instead of its own database and workarounds such as those listed here will no longer be required.

4
  • please explain "in Zotero pin your BBT keys" @retorquere Mar 30, 2020 at 12:51
  • 1
    Does this suffice?
    – retorquere
    Mar 31, 2020 at 10:29
  • @retorquere do you know when they are going add formally supported citation key field to zotero? Before that, using shared Zotero libraries in overleaf that sync automatically is difficult. But it will be a great feature. Oct 29, 2021 at 11:56
  • 1
    I don't know, sorry. They haven't submitted a timeline for this (or other) features. You can use BBT to auto-pin citekeys, that way everyone in the synced group will automatically use the same keys, and they will show up in overleaf.
    – retorquere
    Oct 30, 2021 at 12:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.