How to cite references in Org Mode with Zotero

[2024-02-20 Tue] #permalink

Org Mode + Zotero = a happy writing of documents with citations

This post describes a simple workflow for citing references in an .org file in org-mode that comes with recent versions of Emacs. It is assumed here that, like many researchers, you have a collection of relevant references collected in Zotero, an open-source software for managing a growing list of literature productively.

The first step is to export a library of references managed in Zotero into a file format recognized by a cite processor, such as BibTeX. This is straightforward; in Zotero, select the context menu on a library folder and choose "Export Collection ..." submenu. This action will display a dialog asking for the format and other options. Clicking the "OK" button will result in a .bib file saved at a specified location.

The setup is almost complete. You can start editing a .org file in an Emacs buffer. The final step is to insert the bibliography keyword in the first lines of the file (see the example below). This step enables Org Mode to find the library that includes potential references to be cited. Also, insert a couple of keywords, cite_export and print_bibliography, usually in the botton of the file, where the references section will appear when the .org file is exported to another format, e.g., PDF via LaTeX by org-export-dispatch (C-c C-e by default).

#+TITLE: example
#+bibliography: path/to/library.bib


* References
#+cite_export: basic author author-year

In the above example, path/to/library.bib is the BibTeX file exported from the library. #+cite_export: ... is an option to choose the style used in the LaTeX export. Please refer to the Org Mode manual for details on style options.

Now, you can insert a citation at the cursor position using org-cite-insert (C-c C-x @ by default), which supports an interactive session to easily pick one or more references from the library.

Bonus: Better BibTeX for Zotero

The advantage of the above setup is its simplicity; all you need is vanilla Emacs & Zotero. However, you might find it cumbersome to keep the BibTeX file of the library updated, for example, when a new reference is added. That is a drawback of using two separate applications. We suggest a Zotero add-on called "Better BibTeX for Zotero", which virtually solves this issue. The add-on supports automatic export of libraries, along with several useful options. If you have exported a library to a .bib file with the automatic export on by the add-on, then no extra effort is necessary to cite a new entry from the the updated library in the .org file.

© 2006-2024