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

Workflow

Write LaTeX

  1. Open a .tex file in VSCode.
  2. Click the TeX icon at the left menubar, compile file and open PDF preview.
  3. Write LaTeX in the .tex file. The PDF will automatically refresh if auto compilation has been configured.

Insert Citation

  1. 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.
  2. In VSCode, add \bibliography{EXPORTED_BIB_FILENAME} to the .tex file.
  3. To insert a citation, press Option+M (Alt+M for Windows) to toggle Zotero citation selector. Search for the paper and click Enter 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.