CommunityData:Zotero

From CommunityData
Revision as of 01:37, 17 January 2017 by Groceryheist (talk | contribs) (→‎Modifying Makefile to use your Zotero Collection: changed instructions to use the deterministic url)

We use Zotero for citation management.

Install Zotero

We recommend installing Zotero on your desktop as well as your browser. You can download the software and browser plugin (for Chrome, Firefox or Safari) from the zotero website. You'd also want to register for an account if you don't already have one.

Group Directory

We have a group directory that we use to collect citations for all shared projects. The directory is private, so ask a member of the collective to invite you.

The directory is organized by folder, with each folder aggregating citations for a particular project or topic.

Exporting

If you want to create a BibTex file from the citations in your folder, right-click your folder in the desktop application, and click "Export Collection". Select BibTex as the format and save to a location of your choice. Be sure to rename the file refs.bib so that it works with the paper-building workflow.

Zotero Better Bibtex Extension

Better Bib(la)tex [1] is a useful extension for using zotero with Tex.

Better BibTeX has a few nice features:

  1. It supports BibLaTeX which supports Unicode better than regular BibTeX
  2. Automatic journal abbreviations.
  3. No longer need refsprocessed.bib
  4. Automatically syncing .bib files with zotero collections
  5. Pulling .bib files from zotero with an http request


This final feature is particularly useful if you are building papers with make. Let's walk through steps for setting up Better BibTeX with make.

Setup Better BibTeX with Make

You'll need make, our TeX setup and wget to make this work.

Installing and Configuring Better BibTeX

  1. Install from instructions on github https://github.com/retorquere/zotero-better-bibtex/wiki/Installation
  2. Open Zotero preferences, go to the Better BibTex tab
  3. Open export subtab (under Better BibTeX) and enable "Enable export by HTTP". This turns on an HTTP server that can export your Zotero collections.
    Note: This step is not needed if using Zotero Standalone, as it always runs the server.
  4. Open the Automatic export subtab and select "Disabled".


The below steps may not be necessary, but they help getting cleaner bib files that won't add much strange junk you your bibliography.

  • add "keywords,note,abstract,eprint,isbn,rights,issue" to the "Fields to omit from export(comma-separated) field. If any of your zotero entries start adding weird crap to your bibliography you can stop it using this setting.
  • I also select DOI for "When a reference has both DOI and an URL, export

There are many other Better BibTeX settings, but the above are the ones that I think are useful for use with make.

Make sure your Tex file is using BibLaTeX

If you are using the latest versions of mako's templates[2] you should be using BibLaTeX.

You should see these lines:

\usepackage[natbib=true,style=apa,backend=biber]{biblatex}

\addbibresource{refs.bib}

If you aren't using Better BibTeX I suggest merging your document with Mako's template so that you are using the bibliography setup from the template.


Modifying Makefile to use your Zotero Collection

Make a few small changes to Makefile in paper_template.tex so running make synces refs.bib to your Zotero collection. g

  1. Identify the url you can use to download your Zotero Collection.
    1. Right click on the collection and then click on BibLaTeX url.
    2. There may be two urls show. It is better to use the one derived from the name of the collection since it should be the same for everyone. it has a unique identifier. It looks like this: http://localhost:23119/better-bibtex/collection?/1233037/<COLLECTION_NAME>.biblatex.
    3. Copy this url
  2. Test that the url works by opening it in your browser. You should see your .bib file! You may have to change how whitespace is represented for example by replacing %20 with '\ '.
  3. Now modify the Makefile to download the file and output it to refs.bib. Add these two lines:
    refs.bib:
    <TAB> wget -r -q -O refs.bib "your_collection_url"

  4. Next add refs.bib to the dependencies of .tex. Add refs.bib to the end of the line that starts with %.tex:
  5. Finally make refs.bib phony so that you update refs.bib every time you run make. Add refs.bib to the end of the line that starts with .PHONY.

That should be it! You should be ready to go! Test it out by running. make refs.bib and make pdf