Table of Contents

The Citation Style Language

All citation styles shipped with Zotero, and available in the Zotero Style Repository, are written in the Citation Style Language (CSL). CSL is a new XML-based open standard for configuring citation formatting, designed to be independent of any particular application, document format, or programming language. Questions and comments related to CSL can be directed to the CSL project developer mailing list.

Creating and modifying styles

CSL is a new language that is still under development. Until more user-friendly wizards are developed, styles can only be created or modified by using text editors. However, this is not as scary as it sounds. Users with a little HTML or XML experience might quickly find themselves at home with CSL. A step-by-step guide to making basic changes is here.

For editing CSL styles in text editors, the most current source of documentation for CSL is the CSL schema itself. The schema, written in RelaxNG compact, is commented and relatively easy to read. In addition, the Zotero website hosts a page discussing the CSL syntax, and provides specifics on the implementation of CSL in Zotero.

When it comes to tools available to edit the XML-code of CSL styles, it must be noted that even very simple text editors can be used (e.g. Notepad), although dedicated XML-editors can have the strong advantage of real-time XML validation. In addition, each installation of Zotero ships with two tools which can be used in writing styles:

XML Validation

After creating a new style, make sure it is correct. For this the style has to be well-formed, and has to validate against the CSL schema. Producing correct CSL styles is paramount for obtaining the desired output style formatting. Some XML validation tools that support RELAX NG Compact schemas:

Alternatively, the RELAX NG Compact schema can be converted to RELAX NG XML syntax with the open source command-line utility Trang. Note that although Trang also supports conversion to XML 1.0 DTDs and W3C XML Schema, the CSL schema cannot be expressed in these schema languages.

Importing and Removing CSL Files in Zotero

Once you have created a CSL style, save it as a text file with a .csl extension (on Windows, make sure that file extensions aren't hidden). Then, in Firefox, import the style either via the program menu (File→“Open File…”) or just drag-and-drop the file into an open browser window. In Zotero 2.0 styles can also be added via the Styles tab in the Zotero preferences panel. Zotero will also automatically offer to import CSL files served with the text/x-csl content type.

CSL styles can also be removed from Zotero. In the 1.0 branch of Zotero, this is limited to a total reset of all styles: go to the Advanced tab in the preferences panel of Zotero, and click “Reset Translators and Styles…”. In Zotero 2.0 individual styles can be deleted: for this, go to the Styles tab in the preferences panel.

The Zotero Style Repository

If your custom style has general appeal, consider submitting it to the Zotero Style Repository via SVN. Additional instructions can be found at the bottom of the Style Repository page.