csl simple edits
Translations of this page:

Step-by-step guide to making basic changes to a Style

First find your CSL code

Open the Zotero Test Pane by pasting this:

chrome://zotero/content/tools/csledit.xul

into a new tab.

In Zotero, select a citation (or several). Choose a style from the drop-down menu at top-right of the Test Pane, and you will see a preview of the output in the lower part of the split screen. The CSL code is in the upper half of your split screen.

Make some changes

You can now make the change you want in the CSL directly.

Minor issues are likely to be in the <citation> or <bibliography> sections, which are usually near the bottom.

For example, to remove all given-name disambiguation, find the line:

<option name=“disambiguate-add-givenname” value=“true”/>

And just delete the whole line. You'll see the change occur immediately in the preview pane below.

See below for other types of changes you can easily make.

A bit of trial and error, and testing with a few combinations should help. You can see what different items and combinations will look like by selecting them in Zotero (Ctrl-click to select multiple items), and then “Refresh” at the top-left of the Test pane.

TIP : If nothing happens when you click refresh, you've broken the style!
Use Ctrl-Z to undo, or if you get really stuck, just select the style from the drop-down again and you're back where you started.

Give your style a new name and ID

Now you must rename your new style, otherwise it will be overwritten in future.

Go all the way to the top of the code and find the two lines with <title> and <id>

for example:

  • <title>Harvard Reference format 1 (Author-Date)</title>
  • <id>http://www.zotero.org/styles/harvard1</id>

change them both to something else that is memorable for you, like

  • <title>Bob's Harvard Style Version 1</title>
  • <id>http://www.zotero.org/styles/BobsHSv1</id>

Get it back into Zotero

Now for the last step; how do you get this new style into Zotero? Select the entire code (Ctrl-A), then copy and paste it into a text editor (NOT Word or Wordpad. On windows use Notepad).

Save the file as, e.g. HarvardBS.csl - the important part here is the .csl (in Windows, you need to have file extensions displayed - see this page if you don't know how)

Then drag the file (from where you saved it) into a Firefox page, and click Install.

Done!

What changes can I make?

The CSL syntax summary explains how the CSL works. Common options you might wish to change are here.

Some Slightly more advanced tips

For anything more advanced, this page is your friend, especially if you have made changes that would have wider appeal and you wish to share them.

If you are making several changes, you might want to copy all the CSL code from the top window (Ctrl-A, Ctrl-C) and paste it into a new file in a text editor. Notepad works fine, though using a good text editor designed for programming like the free Notepad++ for Windows or TextWrangler for Mac, can help you to see the structure clearly and not make mistakes. Set the “language” to XML (CSL is based around XML).

The Zotero forums have little nuggets of gold all through them, and searching usually finds the solution to any issue. If you are still having trouble, post a question in the Styles section of the Forum and it's likely to get answered quickly.

This tutorial has some good information to get you started, though it looks unfinished.

 
csl_simple_edits.txt · Last modified: 2009/09/13 23:09 by komrade
 
Driven by DokuWiki