Thursday, June 12, 2014

Modifying Zotero Citation (CSL) Styles

Technical post alert: Making minor changes to Zotero citation styles is quite simple once you have done it a few times if you are familiar with basic xml coding. My problem is that I typically only need to modify a style once every three years or so, and by the time I return to it I have forgotten how it is done. So, for my reference (primarily), here is how I did it this time:
  1. In Zotero standalone, go to Tools > Preferences > Advanced, and click on Open CSL Editor under the General tab.
  2. Select a reference from your Zotero library and the citation style you wish to modify. The formatted reference will display in the bottom half of the screen with the xml in the top.
  3. Make changes to the style sheet. (I found what I wanted to use by checking a few different styles and cutting and pasting from one to the other. To find the right bit of code, I copied the whole xml file to Word so that I could use Word's search features.)
  4. Follow the instructions in this step-by-step guide to change the id and name of the file so that you don't copy over a standard style. 
  5. Validate the xml file following the instructions here.
  6. Select the xml file, paste it into Notepad, and save it as a text file for reference.
  7. Save the style as a csl file by clicking "Save As" "All" and make the extension csl. 
  8. Install the csl file by following the instructions here.
Two helpful resources:

This time around I modified the Chicago Manual of Style 16th edition in two ways: (1) to remove final punctuation (non-standard, but my preference), drawing on Adam Smith's directions here (search for "layout suffix" and change layout suffix="."> to <layout suffix=""> under the notes section near the end of the file); and (2) to allow abbreviations in journal titles in the notes (see the general directions here; I ended up copying the relevant section of the SBL style). My modified style is available here.

Now back to the writing that Zotero is supposed to help me with.

No comments: