Tips & Tricks

Codes and more that we use often

January 08, 2024 by Teamrat A. Ghezzehei

Linking a Zotero folder with Overleaf

Preparing Zotero

  • Login to your Zotero account on a web browser and go to settings.
  • Select the “Feeds/API” panel near the top.
  • Look for your numeric user ID near the top. You will refer to this as <userID>in later steps.
  • Create a private API key to allow Overleaf to access your library: Click on “Create new private key” below your user ID. Give it a name like “Link to Overleaf”. Select “Allow library access” and set other permissions as desired. Save the key and copy the alphanumeric code - this is <privateKey>.
  • Create a URL for your Zotero collections (library of zotero groups and folders) by substitituting the <userID> and <privateKey> in the following https://api.zotero.org/users/<userID>/collections?key=<privateKey>.
  • Open the Collections url you created above. The displayed information has a repeating pattern that describes various aspects of each library in your collection. As you scroll down, you will notice a block of code that looks like:
          "data": {
              "key": "<collectionKey>",
              "version": 2661,
              "name": "<collectionName>",
              "parentCollection": false,
              "relations": {}
          }
    
  • In the above, <collectionName> is the name you provided to individual folder in your library and <collectionKey> is the corresponding key.
  • Search your collection for the specific folder that you want to link with Overleaf and save is <collectionKey>.
  • Create a url for your specific folder using the following template: https://api.zotero.org/users/<userID>/collections/<collectionKey>/items?key=<privateKey>&format=bibtex
  • Test this folder url by copying it to your browser. If you followed the above steps correctly, it should download a *.bib file of your selected folder.

Improting your library to Overleaf

  • Login to Overleaf and open an existing project or create a new one.
  • Create a new file by clicking
  • Select “From External URL” in the dialog box.
  • Paste your folder’s URL into the URL to fetch file from box and give it a name like myrefs.bib.
  • The folder references should now be imported! To update later, click the refresh icon in Overleaf.
  • If you modify the folder in the future, go the bib file you just created and click the refresh button at top to updtae it. To avoid conflict and bugs, always edit and modify references on zotero and refresh the overleaf library frequently to keep it current.

Happy Writing!