Zotero Citation Helper
VS Code extension for inserting Zotero citations into TeX documents and syncing matching Better BibTeX entries into a .bib file.
Current capabilities
- Better BibTeX health check
- search local Zotero items through Better BibTeX JSON-RPC
- insert
\cite{...} and related citation commands into .tex files
- export matching Better BibTeX entries into a configured
.bib file
- sync missing entries for the current TeX document
Setup
- Install Zotero 8 and Better BibTeX 8.
- Make sure Zotero is running.
- Open this project in VS Code and run the extension in the Extension Development Host.
- Configure
zotero.bib.path if your bibliography file is not references.bib.
Local development
- Run
npm run mock-bbt to start a local Better BibTeX mock server.
- Open
fixtures/sample/main.tex in the Extension Development Host.
- Press
F5 to launch the extension (configured in .vscode/launch.json).
- Run
Zotero: Insert Citation and search for smith or wang.
- Verify that
fixtures/sample/references.bib is updated.
Validation
npm run check verifies runtime syntax and runs smoke tests for citation parsing and .bib entry splitting.
Commands
Zotero: Health Check
Zotero: Insert Citation
Zotero: Insert Citation With Command
Zotero: Sync Bib For Current File
Zotero: Sync Bib For Workspace
Zotero: Reveal Citation In Zotero
Zotero: Open Associated PDF
Notes
- The extension expects Better BibTeX at
http://127.0.0.1:23119/better-bibtex by default.
- Citation keys are always sourced from Better BibTeX.
- The
.bib merge mode defaults to missingOnly to avoid overwriting manual edits.
- A mock Better BibTeX JSON-RPC server is provided in
scripts/mock-bbt-server.js for local extension development.
Reveal Citation In Zotero uses a zotero://select/... URI when Better BibTeX returns a Zotero item key.
| |