This is an old revision of the document!


Citation Styles

Citation Formatting in Zotero

Zotero offers multiple ways to generate citations and bibliographies, including word processor integration (for Word and OpenOffice), Quick Copy, and RTF Scan. To get the right citation format (e.g. APA, Chicago Manual of Style or MLA), Zotero relies on the Citation Style Language (CSL).

CSL is an independent open source project, but has a close relation with Zotero: most of the over 1400 CSL styles available have been created by Zotero users. Zotero uses another open source tool, citeproc-js, a CSL processor, to do the actual citation formatting. Zotero developers created a wrapper, citeproc-node, to use citeproc-js on a web server.

Below we give instructions on how to edit CSL styles, contribute to CSL development, and use CSL processors and citeproc-node.

Editing CSL Styles

CSL styles are XML files (their structure resembles the HTML of webpages). There are currently no WYSIWYG CSL editors (although Mendeley has started work on one), so for now styles must be edited by hand. Styles can be edited with any plain text editor (e.g. Notepad on Windows and TextEdit on Mac OS X), although dedicated XML editors have some advantages, such as real-time validation (checking during editing whether the style is still both correct XML and CSL).

In addition to a text editor, you can use the following two tools that ship with Zotero:

  • The Zotero Reference Test pane. Available by entering "chrome://zotero/content/tools/csledit.xul" in the Firefox address bar, this tool provides instant processing of CSL styles, using items selected in the local copy of Zotero.
  • The Zotero Preview pane. Available by entering "chrome://zotero/content/tools/cslpreview.xul" in the Firefox address bar, this tool generates citations for the items selected in the local copy of Zotero for all installed CSL styles.

The CSL 0.8.1 to 1.0 Upgrade

Zotero 2.1 is the first release to support CSL 1.0 (through citeproc-js). Earlier versions (up to Zotero 2.0.9) supported CSL 0.8.1 through an in-house developed CSL processor.

The Zotero Style Repository has traditionally been the main repository for CSL 0.8.1 styles. However, because a CSL 1.0 style repository is still under construction, and because Zotero 2.1 can install both CSL 1.0 and CSL 0.8.1 styles (Zotero converts the latter internally to the CSL 1.0 format), it can still make sense to make (small) edits to CSL 0.8.1 styles. However, some of the new features in CSL 1.0 can only be used by editing CSL 1.0 styles.

At the moment, CSL 0.8.1 and CSL 1.0 styles can be made available through the Zotero Style Repository. CSL 1.0 styles should preferably also be added to the GitHub CSL 1.0 style code repository. The latter repository already contains all styles from the Zotero style repository (CSL 0.8.1 styles have been automatically converted to the CSL 1.0 format).

CSL 0.8.1 and 1.0 styles can be easily distinguished by looking at the cs:style element at the top of the style. CSL 1.0 styles include a version attribute on this element with a value of “1.0”, e.g. “<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0">”. CSL 0.8.1 styles lack this element.

Editing CSL 0.8.1 Styles

The following resources exist for editing CSL 0.8.1 styles:

Editing CSL 1.0 Styles

The following resources exist for editing CSL 1.0 styles:

Installing (and Deleting) Styles

CSL styles can be installed either via the Firefox File menu (select “Open File…”) or by dragging and dropping the style into an open browser window. Styles can also be added via the Style Manager in the Zotero preferences window, which is located on the Styles tab of the Cite tab. Styles can also be deleted via the Style Manager. Finally, if you are hosting CSL styles online, serving the styles with a “text/x-csl” MIME type will allow Zotero to automatically install the style.

Contributing CSL Styles

For information on how to distribute CSL styles, see Submitting Citation Styles.

Translating CSL Locales

CSL locale files allow for easy, automatic localization of citations and bibliographies generated with CSL styles. For more information about CSL locales, to see the current status of translation, and to learn how you can contribute to these translations, see the localization section.

CSL Processors and citeproc-node

Discuss citeproc-js, link to citationstyles.org for other CSL processors. Discuss citeproc-node.

Anything below this point should be (re)moved

Existing Resources:

Citation Style Language (CSL)

  • What is CSL?

o Intro

        o How does it work in the context of Zotero?
              + brief explanation of citeproc
              + Slide from powerpoint showing how it fits into the architecture, is processed, etc
              + What skills are required?
  * Documentation
        o CSL primer
        o CSL language spec
          CSL Localization https://bitbucket.org/bdarcus/csl-locales/wiki/Home
        o CSL editor
  • CSL videos
  citeproc node and citeproc-js
        o What is it?
        o What skills are required?
        o Deploying citation processing in various environments  with node.js + citeproc-Node
        o Examples
        o Citeproc vids