If you find yourself writing lots of academic papers, then it’s important you use writing and referencing tools that work well together.

A Brief Aside - Integrating Scrivener and Zotero Using OpenOffice (or LibreOffice)

For large works, such as My Abi, I use Scrivener as my word processor because it’s fantastic at breaking complex works into smaller, more manageable, parts. I use Zotero as my citations manager. The most well-documented method of integrating Scrivener and Zotero also relies on OpenOffice or LibreOffice and the scannable cite option within Zotero - here’s one such example of doing it that way.

However, I prefer to avoid having to open an additional Word Processor package, so I use another method for integrating Scrivener and Zotero, which I outline below.

Markdown and BibTeX

The method I am going to outline uses Markdown, together with BibTeX formatted references, to produce beautiful LaTex inspired PDFs. I format my Scrivener documents as Markdown using the MultiMarkdown package - here are instructions for setting that up. I like Markdown’s minimalist style because it allows me to concentrate on content without worying too much about presentation, at least while I’m busy writing.

Furthermore, because the source documents I create are text files, they are perfect for version control on GitHub. That also means they are amenable to collaboration through branching, diff’ing and merging.

As a small note of caution - I have only used this method on a Mac. It will certainly work on Linux, and it probably works on Windows too, but I rarely work on such systems (at least, not for writing), so I cannot vouch for them.

Dependencies

Although I avoid having to use two word processing tools, my method does have other dependencies. Not least of which is being comfortable using a command line.

The tools you’ll need:

  1. A Markdown Editor. Scrivener for large documents. For shorter works, I use the fuss free Sublime Text editor together with the Markdown Editing package.
  2. A citations manager that can output BibTeX. I use Zotero, which works best with Firefox and Firefox’s Zotero plugin. Additionally, I use Zotero’s Better BibText plugin, primarily because that helps avoid citation key clashes.
  3. Pandoc - the swiss army knife of text formatting tools. It’s a fabulous, if somewhat complex, tool. You can get it to produce just about anything - PDFs, Word documents, and it can even turn Markdown into beautiful reveal.js inspired presentations. I won’t document such uses here, but if you want to do such things, I’ve written a script that can create those presentations. You may also wish to read Pandoc’s documentation.
  4. A Citation Style Language (CSL) file that matches the citation style you need. The Zotero Style Repository has many such files. I often have to produce IEEE citations, for which I use the file IEEE with URL.
  5. A LaTex processor. The BasicTex package will suffice.

Configuration

  1. Setup Zotero so that the Export Default Output Format is Better BibTex Quick Copy and make sure that Better BibTex’s QuickCopy format is Pandoc.
  2. Make sure the command pandoc is in your path.
  3. Make sure that the LaTex commands are also in your path; e.g. export PATH=$PATH:/usr/texbin.

Workflow

Let’s imagine you have to produce a paper for a conference on renewable energy. Your article is entitled Only Oil Executives and Their Friends in Government Believe Fracking is a Good Energy Option. You want to open with high impact, and you find a piece by Bill McKibben in the Rolling Stone, which outlines the scientific case for keeping fossil fuels in the ground. That’s just the impact you were looking for, so you save that article to Zotero, and then open your paper with the following statement:

Here’s the terrifying truth: there are already enough known fossil fuel reserves to fry Planet Earth five times over.

Bang! Of course, you still need to include that Bill McKibben reference, so you head on over to Zotero, highlight the Rolling Stone article, hit cmd+shift+c (on a Mac) and then paste that citation into your Markdown using cmd+v:

Here’s the terrifying truth: there are already enough known fossil fuel reserves to fry Planet Earth five times over @bill_mckibben_global_2012.

…note the citation key @bill_mckibben_global_2012.

Then, when you finish your document, save it as renewables.md (or, if you’re using Scrivener, compile it as MultiMarkdown), then export, into the same directory, your Zotero library in Better BibTeX format. Call it library.bib. Make sure your CSL file, ieee-with-url.csl, is also in that directory. Finally, create a meta file, meta.txt, that contains your paper’s title, the author(s), the header and the footer. Here’s my meta.txt:

    ---
    title: Only Oil Executives and Their Friends in Government Believe Fracking is a Good Energy Option
    author: Steve Huckle
    header-includes:
        - \usepackage{fancyhdr}
        - \pagestyle{fancy}
        - \lhead{\thepage}
        - \chead{}
        - \rhead{}
        - \lfoot{© Steve Huckle}
        - \cfoot{}
        - \rfoot{}
        - \renewcommand{\headrulewidth}{0.4pt}
        - \renewcommand{\footrulewidth}{0.4pt}
    ---

Finally, to produce the fully referenced PDF, run the following command:

pandoc –normalize –toc –metadata link-citations=true –filter pandoc-citeproc -V documentclass=report “meta.txt” “renewables.md” –biblio “library.bib” –csl “ieee-with-url.csl” –latex-engine=xelatex -s -S -o “renewables.pdf”

…the output should be renewables.pdf, a beautifully formatted PDF, complete with a title page and a table of contents. It will contain the following text and reference:

Here’s the terrifying truth: there are already enough known fossil fuel reserves to fry Planet Earth five times over 1.

[1] Bill McKibben, “Global Warming’s Terrifying New Math.” http://www.rollingstone.com/politics/news/global-warmings-terrifying-new-math-20120719, Jul-2012.

Script

I have created a script that automates much of the work detailed above. The script can even create those beautiful reveal.js inspired presentations I mentioned earlier.

Copyright © Steven Huckle, 2017-2018.

CC-BY-NC-SA 4.0 International
Unless otherwise stated, the works here are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0). They are attributed to Steven Huckle. The license lets you remix, tweak, and build upon the work non-commercially, as long as you credit Steven Huckle and license your new creations under identical terms.