Zotero citations in LaTeX

The editor lists the sources of your project, completes citation keys while you type and shows the entry and its PDF behind a \cite. Connected to Zotero, it also keeps the .bib file in step with your library. This guide goes through the setup and the daily use.

How the parts fit together

Everything starts from the .bib files in your project. The Sources tab, the completion inside \cite{ and the window behind a citation all read them, so they work without Zotero as soon as the project has a .bib file.

Zotero adds two things. It can write its library into a .bib file of the project and keep that file current. And it supplies what a .bib entry often lacks: the abstract and the attached PDF.

Connect Zotero

In the browser the editor uses the Zotero Web API. You need two values from your Zotero account: your user ID, which is a number, and an API key.

  1. Sign in at zotero.org/settings/keys. The page shows the line “Your userID for use in API calls is …”; note the number. Then create a new private key with “Allow library access”. Read-only access is enough.

  2. In the editor, open the settings with the gear button in the top bar.

    The top bar of the editor with the gear button for the settings outlined at the right end.
  3. Scroll to “Zotero Citations” and fill in “Web API user ID” and “Web API key”. Each value is saved when you leave its field.

    The settings group "Zotero Citations" with the outlined fields "Web API user ID" and "Web API key", and below them the part "Bib Sync" with the buttons "Test BBT" and "Test Web API".
  4. Click “Test Web API” in the part “Bib Sync” below. A line under the buttons says whether Zotero accepted the key and how many entries it returned.

Keep a .bib file in step with Zotero

  1. Right-click a .bib file in the file list and choose “Link with Zotero”. To start with a new file, create a .bib file and tick “Sync with Zotero” in the dialog.

    The context menu of the file references.bib with the entry "Link with Zotero" outlined.
  2. The editor writes the BibTeX export of your library into the file. A green “Z” next to the name marks a linked file.

    The file list with main.tex and references.bib; the green letter Z next to references.bib is outlined.
  3. After you add sources in Zotero, right-click the file again and choose “Sync Zotero now”. For an automatic sync, set “Auto-Sync” in the settings under “Bib Sync” to 1, 5 or 10 minutes.

Find a source and cite it

  1. Open the tab “Sources” in the sidebar. It lists every entry of the project’s .bib files with title, citation key, authors and year.

    The sidebar with the tab "Sources" outlined: a search field, filters and six sources, each with its citation key and a plus button.
  2. Type at least two letters into the search field. The list narrows to the sources whose title, authors, key or abstract contain them.

    The search field with the word "drift" and two matching sources below it.
  3. Put the cursor where the citation belongs and click the plus button of the source. The editor inserts \cite{key} at the cursor.

    One source in the list, opened to show its abstract; the plus button that inserts the citation is outlined.

Cite while you type

  1. Type \cite{ and the first letters of a key. The editor lists the matching keys with the title of each source.

    The editor after typing \cite{dr: a list offers the key tanaka2022drift with the title "Gyroscope Drift Compensation".
  2. Choose an entry with the arrow keys and press Enter.

Look up what a citation says

  1. Click on the key inside a \cite{...}. A window opens next to it with title, authors, year, journal and DOI of the source.

    The citation window for the key lind2024fusion with the tabs Info, Attachment and Web, the data of the article and the buttons "Open PDF", "Find in PDF" and "Copy key".
  2. Switch to the tab “Attachment” to read the PDF in the same window. Type a word into its search field and press Enter to jump from match to match.

    The citation window on the tab "Attachment": the first page of the article, with the search word "magnetic" marked in the text.

Link a sentence to the passage that backs it

An evidence link ties a passage of your text to a passage in the PDF of the source. Later you jump from the citation window to that place in the paper, or back to your sentence.

  1. In the editor, select the sentence together with its \cite{...}, at least eight characters.

  2. Right-click the selection and choose “Zotero: Link Evidence”. The citation window opens with the PDF of the source.

  3. Select the passage in the PDF, again at least eight characters, and click “Link now”.

Take a figure out of a PDF

  1. Open the PDF in the tab “Attachment” of the citation window and click the scissors button.

  2. Drag a rectangle around the figure or table on the page.

  3. In the dialog, check the folder (Images unless you change it) and the file name, set the width between 40 and 100 percent of the text width, and write the caption and the label.

  4. Click “Save & insert figure”. The editor saves the region as a PNG in the project and inserts a figure with \includegraphics, your caption and the \cite of the source.

When something does not work

The Sources tab says “No .bib file found in project”: add a .bib file, by hand or linked with Zotero as described above. The tab reads .bib files, not the Zotero library itself.

The citation window says “No entry found”: the key is in no .bib file of the project. Check the spelling, or sync the linked file so that a source you added in Zotero arrives.

The PDF shows citations as question marks: that is a matter of the compile, not of Zotero. See BibLaTeX and Biber in the browser and Create a bibliography in LaTeX with biblatex and Biber.

Where it works

What you need

Related pages