Tools · Write Papers in LaTeX with VSCode and Zotero
2022-10-23 20:42:05
# 工具(Tools)
I’ve always wanted to find a way to write papers in an elegent way, including editing LaTeX and adding citations. Here is how.
Requirements
- VSCode Plugins: LaTeX Workshop, Zotero LaTeX
- Zotero Plugins: Better BibTeX for Zotero
Workflow
Write LaTeX
- Open a
.tex
file in VSCode. - Click the TeX icon at the left menubar, compile file and open PDF preview.
- Write LaTeX in the
.tex
file. The PDF will automatically refresh if auto compilation has been configured.
Insert Citation
- In Zotero, right click the folder containing papers you would like to cite in your paper and select
Export Collection
. Select “Better BibLaTeX” as the format. Check the option “Keep Updated” to keep the exported.bib
file updated when you make changes to this Zotero collection. Save the.bib
file under the same directory of your paper. - In VSCode, add
\bibliography{EXPORTED_BIB_FILENAME}
to the.tex
file. - To insert a citation, press
Option+M
(Alt+M
for Windows) to toggle Zotero citation selector. Search for the paper and clickEnter
to insert its citekey.
Notes
- Some LaTeX templates might require different bibliography keys. For example, the ACL rolling review Template requires the keys “year” and “journal” instead of “date” and “journalname”. To match its style, select “Better BibTeX” as the format instead of “Better BibLaTeX” when exporting the
.bib
file from Zotero.