Automatic export

To export a library, group or collection, right-click on it in the left Zotero pane and choose “Export Library…” or “Export Collection…”. With BBT’s export translators (e.g., “Better BibTeX”), checking the Keep updated option will register the export for automation. After you’ve completed the current export, any changes to the collection or library will trigger an automatic re-export to update the file. You can review/remove exports from the BBT preferences. While I’ve gone to some lengths to make sure performance is OK, don’t go overboard with the number of auto-exports you have going. Also, exporting only targeted selections over your whole library will get you better performance. You can set up separate exports for separate papers for example if you have set up a collection for each.

Managing auto-exports

There are two important concepts in play for auto-export

  • register a collection/library for scheduled exports, and
  • executing these scheduled exports

When you check “keep updated” in the export screen, that means “in the future, schedule this export for re-export when any of its items change, to the file I pick next”. If you do not check this checkbox, that merely means you are not registering the export you are doing, rather than undoing an auto-export you scheduled before.

When these scheduled exports are ran depends on a further configuration in the preferences. You can choose to have scheduled exports to be ran:

  • on change: run the scheduled export as soon as possible
  • on idle: run the scheduled export as soon as Zotero goes idle (meaning you haven’t used it for some seconds)
  • paused: run the scheduled exports manually, or run then whenever you change the setting back to “on change” or “on idle”. In sthis mode, exports are still scheduled, they are just not ran until you give permission.

After you’ve set up an auto-export using an Keep updated export, you can manage your auto-exports in the BBT preferences under the Automatic exports tab. There, you can remove auto-exports or change settings on them. You cannot add new auto-exports from here, that can only be done by initiating an export.

Getting your BBT-generated bib(la)tex/citekeys to other places

You may want to use your BBT generated bib(la)tex on other systems; maybe you use Overleaf (as I do), maybe you have your documents compiled using github actions (as I do). In any case, you want your auto-exported items to show up somewhere else. If you’re thinking of this in the context of Overleaf, here’s a TL;DR of the pros and cons:

  • Auto-export + cloud-sync + import by URL
    • pro: gets the full Better BibTex / Better BibLaTeX file into Overleaf
    • pro: free or already included in what you pay for your cloud service
    • con: requires cloud service which has direct-download links (Dropbox seems to offer this, as does Onedrive, but I haven’t tested this)
  • Auto-export + Dropbox - Overleaf integration
    • pro: gets the full Better BibTex / Better BibLaTeX file into Overleaf
    • con: paid option on Overleaf
  • Auto-export + git:
    • pro: gets the full bibtex file to Overleaf, tested and works
    • con: requires technical expertise to set up, paid option on overleaf
  • citekey pinning:
    • pro: no setup, free
    • con: only gets the BBT citekeys, BibTeX is generated by Zotero itself

DropBox / Google Drive / Box.com / …

Or any other of the plethora of choices that are available today that will “cloud-sync” your files. Will work with any cloud service, as long as it delivers direct-download links, as this method will import into Overleaf by URL. 1.Export the Better Bibtex / Better LaTeX file into an cloud shared folder, with the “keep updated”-option checked 2.Create/generate/find a direct-download link. Google is your friend. 3.Import your cloud-saved bib-file into Overleaf by “Add file -> From external URL” 4.When adding new sources, refresh both the Zotero client, and click the “refresh”-button in the file on Overleaf

If working in a group, this can be accomplished by repeating step 1 for each person into the same cloud-shared folder. When doing step 1, make sure to use the same filename as the original bib-file. This will overwrite the bib-file every time the library is refreshed.

git support

BBT auto-export works nicely with git services (such as Overleaf, which is where I use it myself; the instructions for setting up Overleaf for git can be found here, but any git service (gitlab, github, etc) should work exactly the same. I’m toying with various online services here.

Note that this is more for the technically inclined, you will need to be comfortable with the command line to set this up. I can’t think of a real benefit to using git over cloud-sync unless, like me, you like to keep a backup history in git.

To activate git support, first clone the repo that holds your article/thesis/whatnot from your provider (github, overleaf, etc), run git config zotero.betterbibtex.push true in a command shell in that clone, and set up an auto export to that directory; at each update, BBT will now also push your library to the git service. For the technically curious, that means it does:

  1. git pull
  2. Performs the export
  3. git add <your library file>
  4. git commit -m <your library file>
  5. git push

Note that the nature of git commit/push is not file-bound; if you made edits to other files, and added those, they will be committed and pushed along. If you want to be super-careful, the best way to go about it is to have a separate clone of your repo that BBT auto-exports to, and then another repo that you do your own edits in. I don’t use it myself this way, but you have been warned.

Pinning BBT citekeys for Overleaf

If you only want BBTs citation keys on Overleaf, you can simply pin them and use the regular Overleaf-Zotero integration. This will get you the pinned keys, but the bibtex is generated by the standard Zotero exporters. If you want this to be done by default, set autoPinDelay to a non-zero value.