Zotero and Better BibTeX for Notes and Biblio
Our Bookdown workflow uses the open-source Zotero bibliography manager, with the Better BibTeX extension, to simplify the process of citing sources and creating a bibliography. Rather than typing full references directly into the text, you can insert a short citation key into the book manuscript, and the tools will automatically generate the desired references in your preferred format (we like Chicago-style endnotes), with an alphabetized bibliography of all sources cited at the end.
After you’ve installed the tools, here’s an overview of the workflow:
- Create an entry for each source (book, journal article, document, etc.) in your Zotero library.
- Select and upload your preferred citation style in
- For each source, Better BibTeX generates a unique citation key, similar to
tyackOneBestSystem1974, which you can paste with formatting to create a note in the book manuscript.
- Each time before you build your book inside Bookdown, export your Zotero library or collection in
.bibformat into your Bookdown repository, which supplies the reference data to match your citation keys in the text.
Here are more detailed instructions to install, set up, and use Zotero and Better BibTeX in a Bookdown workflow. Remember that this workflow may not be ideal for novice computer users. But if you have multiple citations, it will save you time in the long run.
Download and install Zotero for Mac, Windows, or Linux. Add connectors to your preferred browsers to automatically upload bibliographic data for your sources.
Install the Better BibTeX extension and follow all of the site’s instructions for initial setup.
At the top of each entry in Zotero, the extension will generate a unique citation code, such as
Copy and paste the citation code into your Markdown text, and add a caret, square brackets, and the at symbol
^[@tyackOneBestSystem1974]. See more options in the Style Guide. Or you can set Zotero preferences > Export > Better BibTeX Quick Copy to use Zotero’s drag-and-drop quick copy feature.
Tip: If you use R Studio’s built-in text editor, see this blog post on how it supports Zotero citations.
Go to the Zotero Style Repository to find your preferred citation style (such as
chicago-fullnote-bibliography.csl). Upload this file to your Bookdown repository, and also add it to your book’s
index.Rmdsettings for both the HTML and PDF editions.
Each time before your build your book in Bookdown, export an updated Zotero bibliography (in
.bibformat) from your Zotero library or collection, and upload into your Bookdown repo, following these steps:
- A. Select Library > Right-click to export the collection
- B. Select format > Better BibLaTeX (IMPORTANT: We use this setting, rather than “Better BibTex”, because “Better BibLaTex” includes full dates in newspaper citations, and URLs). Also, we leave all of the checkboxes blank during the export, and do not select “keep updated”. This means that if your Better BibTex citation codes suddenly change in Zotero because the author, title, or year changed, then you are responsible for running find-and-replace to make these edits in the text of the book.
- C. Save the output in
.bibformat, save into your book repo, and be sure to add the same filename to your settings in
index.Rmd, as shown in these excerpts:
bibliography: dataviz.bib citation-style: chicago-fullnote-bibliography.csl ... output: bookdown::gitbook: ... pandoc_args: [ "--csl", "chicago-fullnote-bibliography.csl" ] bookdown::pdf_book: ... citation_package: none pandoc_args: [ "--csl", "chicago-fullnote-bibliography.csl" ]
In our Bookdown workflow, which uses the Chicago full-note bibliography style, this Zotero source type entries appear correctly formatted:
- Book chapter
- Journal article
- Web page
- Blog post – But we avoid this because Zotero Chicago-style entry inserts “(blog)” into citation title. Instead, we prefer to reset the type to Web page.
- Document – Use this all-purpose entry in place of other types: Law case, Presentation, Interview, Video recording, Television broadcast, etc. Insert important details (such as the archival location information) in the Publisher field.
To help other researchers find items cited in this book, include URLs in Zotero entries whenever feasible, even if not required by convention. For example, some print-only books and documents are hard to locate, so include an OCLC WorldCat permalink to make them easier to find (example: https://www.worldcat.org/oclc/20683509). Also, if a print source has been digitized by HathiTrust, Google Books, or the Internet Archive, add one of these URLs to the Zotero entry.
Reminder: Chicago full-note works exactly as it was designed, meaning that the second instance of a citation currently appears as an abbreviated note (author, with title when appropriate).
Demo: Here’s a text-only note, with no Zotero citation.58
To create a note with citations only, separate Zotero/BibTeX citation keys with semi-colons: 59
Since notes also may include text and punctuation in Markdown syntax, always insert a caret symbol prior to the brackets to demarcate a note:60
Remember that the
chicago-fullnote-bibliography.csl format is designed to automatically shorten the note after it its first reference.
This is a note, with no bibliographic reference.↩︎
Compare how “lying” is justified by Huff, How to Lie with Statistics, pp. 10-11 and Monmonier, How to Lie with Maps, pp. 11-12.↩︎