I have an 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?

  • 1
    [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 '20 at 2:04

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.

  • please explain "in Zotero pin your BBT keys" @retorquere – the world is not flat Mar 30 '20 at 12:51
  • 1
    Does this suffice? – retorquere Mar 31 '20 at 10:29

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