Behind the Scenes at the Citation Generator
If you’ve ever used a tool to generate citations, there’s a good chance that tool used Citation Style Language. CSL is an open source, XML-based language designed to describe citation styles. Many citation managers and citation generator tools rely on CSL and its style repository (https://github.com/citation-style-language/styles, or https://www.zotero.org/styles), including Zotero, Mendeley, RefWorks, and Papers. (Endnote uses a different system, unfortunately.) And, it turns out, anyone can suggest changes or updates to the existing style files, or even create their own.
I use Zotero pretty heavily, including its citation generation tool, but I’d developed a few pet peeves with the Bluebook citations Zotero generates, and I decided to see if I could fix them myself. In particular:
- Inserting a (last visited) parenthetical any time there’s a URL in a citation, even if there’s a publication date provided. This is unnecessary per Rule 18.2.2(c).
- Treating reports like articles, with italicized title and roman type authors, instead of like books, with authors and title in small caps.
- Italicizing titles of dissertations and working papers.
- Some date display issues and commas in strange places.
If I was going to update the style file, I figured I should fix as much as I could, so first I generated sample Bluebook citations for a wide variety of sources and reviewed them for additional errors. I didn’t focus on legal primary sources, mostly because I rarely use Zotero to gather those, but also because CSL isn’t really equipped to deal with them. (Jurism, a reference manager based on Zotero but with improved support for legal and multilingual resources, uses an extended version of CSL called CSL-M for its legal citation style files. I just focused on Zotero and CSL for this.)
Then I needed to learn CSL. It’s certainly not uncomplicated, but it wasn’t too difficult to learn well enough to edit an existing style file, although I have only the most basic familiarity with XML. I started by trying to figure out what each part of the existing style file did, referring to the official documentation as I went. Once I had a general idea of how it worked, I reviewed the file with my list of citation errors in mind and thought about what might be causing them and how they might be fixed, and if any could be fixed as a group. Then I started editing.
Zotero lets you upload your own local style files, so I named my new version “Bluebook Law Review TEST” and uploaded many, many new versions to test my edits. There was a lot of trial and error, but often Googling the issue I was having turned up some useful threads on the CSL or Zotero forums. It also helped to have a good text editor with basic code editing features, like syntax highlighting and automatic indentation. Notepad++ is a great option if you’re a PC user; I was fumbling around in Notepad before I got permission from my employer’s IT department to install Notepad++, and it made a huge difference.
A few of the issues I found with the citations weren’t fixable in CSL. There are some limitations in the language itself, but it also depends on the metadata you have and the available fields in whatever system you’re using. For example, I don’t think there’s a way for CSL to replace words with their T6 abbreviations whenever appropriate. However, CSL will use the contents of the “Journal Abbr” field in a Zotero record, if there is one, in place of the journal’s full title. Some databases, e.g. HeinOnline, will automatically populate that field if you’re adding the article to Zotero from them; otherwise, you need to add the journal abbreviation to that field yourself if you want the journal title to be abbreviated in the citation.
When I was satisfied with my changes, I followed the instructions on the CSL website to submit my changes for review on GitHub. Someone reviewed them and okayed them within a couple of days, and the updates are now live for all to use. If you already had the Bluebook Law Review style installed in your citation manager, it should have automatically updated.
If you’re updating a file, you don’t need to submit your changes to the public repository. Although it’s nice to share, you can just keep it for your own local use, which is also handy if you need to make a bespoke citation style. I once had to create a bibliography for a Zotero collection using the Stanford Encyclopedia of Philosophy house style, which does not have an existing CSL file. But I found one that was close enough and tweaked it, saving myself or some poor RA hours of work.
This was all before the 22nd edition came out, so I’ll be reviewing that for relevant changes and updating the style file…eventually. If your own pet peeves weren’t fixed in this update, feel free to reach out and let me know what they are, or take a crack at fixing them yourself!