Monday, December 30, 2013

Improving workflow: Zotero & Latex

I use Zotero as my reference manager. I've tried others including the popular Mendeley program but find Zotero's import feature the easiest to use and Zotero meets my needs well.

There are a couple of add-ons that I recently added to Zotero to improve my workflow when adding and using references in Latex documents. The first keeps the bibtex file automatically updated whenever changes are made to your Zotero library. To do this install Zotero automatic export from rokdd.de/permanent:zotero-autoexporting

The second allows for cite-keys (e.g. \cite{smith_fluids_1987}) to be either copied and pasted or dragged and dropped directly into your favorite text editor. To do this I followed directions from this forum by Kramer. The add-on works by adding an additional export format to Zotero.

Copy the code from http://pastebin.com/GXmCJevn and save it in a file called BibtexCiteKeyOnly.js within the translators folder in your zotero. If you don't know where your zotero folder is you can find it by going to Zotero Preferences, Advanced, and clicking on Show Data Directory. Once you restart Zotero (or Firefox) enable the export mode by going to Zotero Preferences, Export, and choosing BibTeX-CITEP. You should now be able to drag a reference (or multiple references) into your text editor and get the citekey. Or you can copy the citekey using Cmd+Shift+C and paste it using Cmd+V.