Purplelink
← All guides

Zotero with LaTeX on a Mac: a .bib that stays current, and citing from Zotero

There are two connections worth making. Zotero keeps a .bib file in your project folder up to date, and you pick items in Zotero to insert a \cite while you write. Both work best with the free Better BibTeX add-on.

Disclosure up front: I make ModernTex, one of the editors listed below. The Better BibTeX steps work with any editor. They come from Better BibTeX's documentation, read October 31, 2026, when its latest release was 9.0.74. For the other editors I describe what their makers or users document, and I say where I have not tested something.

The short answer

Install Better BibTeX in Zotero. Export the collection for your paper as Better BibTeX or Better BibLaTeX with Keep updated ticked, saved next to main.tex. Then cite from Zotero in whatever way your editor supports: a picker extension in VS Code, a macro in TeXstudio, drag and drop anywhere, or Cite from Zotero in ModernTex.

Step 1: install Better BibTeX for stable keys

Zotero can export BibTeX on its own, but it makes the citation keys at the moment of export. Better BibTeX's documentation lists the problems that causes: fix a typo in an author's name or a title and the key changes, and you cannot see a key until you export. A changed key turns every \cite that used it into an undefined citation.

Better BibTeX (BBT) is a free add-on that gives each item a stable key, avoids clashes in a predictable way, and lets you pin a key to any value you choose. It also shows the keys in Zotero's item list. Install it from its installation page, then restart Zotero.

Step 2: let Zotero keep the .bib file current

  1. Put the items for one paper in their own Zotero collection. Exporting a collection is faster than exporting the whole library, which BBT's documentation also recommends.
  2. Right-click the collection and choose Export Collection.
  3. Pick the format that matches your document (see Step 3) and tick Keep updated.
  4. Save the file in the project folder, for example as references.bib.

From then on, any change to an item in that collection re-exports the file. Per the auto-export documentation, this happens on change or when Zotero goes idle, depending on a BBT setting, and you can review or remove kept-updated exports in BBT's preferences. It runs only while Zotero is open. If Zotero was closed while you edited items elsewhere, open it before you compile.

Step 3: match the export format to the document

If the PDF shows question marks where the citations should be, the bibliography step did not run or the key is missing from the .bib. The undefined citation page walks through both causes.

Step 4: cite from Zotero while you write

BBT provides a "Cite as you Write" service that editors call to open Zotero's picker and get back a citation. Its page includes a Vim example that calls it on 127.0.0.1:23119, the address Zotero listens on, on your own Mac. Here is what I found for the common Mac editors.

EditorHow you cite from ZoteroNeeds Better BibTeXTested by me
Any editorDrag items from Zotero into the editor to drop a \cite{key}, after a one-time setup described in BBT's citation key pageYesNo
VS CodeAn extension such as Citation Picker for Zotero, which calls BBT's picker (last updated September 2026)YesNo
TeXstudioA Zotero Picker macro, added from Macros, Edit Macros, Browse, as described in a June 2025 Zotero forum replyYesNo
Vim or NeovimThe snippet on BBT's Cite as you Write pageYesNo
TeXShopNo built-in Zotero integration found. Drag and drop worksFor drag and dropNo
ModernTex (mine)Cite from Zotero in the command palette (details below)No, but keys are stable only with itSee below

Citing from Zotero in ModernTex

ModernTex 2.0 and later have three Zotero commands in the command palette: Cite from Zotero, Update from Zotero and Zotero Settings. Switch on Connect to Zotero on this Mac in Settings, under Citations, first. In Zotero, the setting "Allow other applications on this computer to communicate with Zotero" (Settings, Advanced) must be on. ModernTex tells you if it is off.

ModernTex talks only to Zotero on your own Mac (127.0.0.1), on port 23119, or 24119 for Juris-M, which you can change in Settings. It makes no request until you use a Zotero command or open its Settings section. It never writes to Zotero.

If you share the project with co-authors

Commit the exported .bib with the project, or upload it to Overleaf with the rest of the files. Only one person's Zotero needs to keep it updated. With Better BibTeX the keys stay the same between exports, so the \cite commands everyone else wrote keep working. Without it, one edited item can rename a key under a co-author's citation.

Frequently asked questions

Does Zotero have to be open?
Yes, for both routes. Better BibTeX re-exports a kept-updated .bib only while Zotero is running, and every cite-from-Zotero tool, ModernTex included, talks to the running Zotero app on your Mac.
Why did my citation keys change?
Zotero's own BibTeX export makes the keys at the moment of export, so correcting an author name or title can change a key and break a \cite. Better BibTeX keeps keys stable and lets you pin a key to any value.
Which export format should I pick, Better BibTeX or Better BibLaTeX?
Match the document. A file with \bibliographystyle and \bibliography uses BibTeX, so pick Better BibTeX. A file with \addbibresource and \printbibliography uses biblatex, usually with biber, so pick Better BibLaTeX.
Can co-authors share one .bib file?
Yes. Commit the exported .bib with the project. With Better BibTeX the keys stay the same between exports, so a co-author's \cite commands keep working. Only one person's Zotero needs to keep the file updated.

From the maker of these tools

Writing LaTeX on a Mac?

ModernTex can cite straight from Zotero, add the cited entries to your .bib, and show what changed in Zotero before it updates the file. $19.99 once, after a free trial.

I make ModernTex. $19.99 once after the trial, macOS 14 or later, no account.