Translations of this page:

We’re in the process of updating the documentation for Zotero 5.0. Some documentation may be outdated in the meantime. Thanks for your understanding.

修改 CSL 样式

虽然没有 CSL 的编辑器,但是修改样式其实一点都不困难。你甚至都不需要太多的 XML 知识,只需要按照下列步骤进行即可。







现在你可以在第一个文本框中改动XML文件的内容。只要改动后的文件仍然具有正确的结构,改动后的格式就会在第二个文本框中显示。 注意你所做的改动不会自动保存,请自行保存。你可以将相应的文本复制到文本编辑器中,存为以csl文件(*.csl)。


在CSL文件的末尾,会有<citation><bibliography> 这两块代码,前者决定引文的格式,后者决定参考文献的格式。 一般情况下,你只需要改动这两个部分。


    <option name="collapse" value="citation-number"/>
      <key variable="citation-number"/>
    <layout prefix="(" suffix=")" delimiter="; ">
      <text variable="citation-number"/>


    <option name="second-field-align" value="true"/>
      <text variable="citation-number" suffix=". "/>
      <text macro="author"/>
      <text macro="title" suffix=". "/>
	<if type="book">
	  <text macro="edition" prefix=" " suffix=" "/>
	  <text macro="publisher" prefix=" " suffix="."/>
	<else-if type="chapter">
	  <group prefix=" " suffix=". ">
	    <text term="in" suffix=": " text-case="capitalize-first"/>
	    <text macro="editor"/>
	    <text variable="container-title"/>
	  <text macro="publisher" prefix=" "/>
	  <text variable="page" prefix=" p. " suffix="."/>
	  <text variable="container-title" suffix=" " form="short"/>
	  <text macro="date" suffix=";"/>
	  <text variable="volume"/>
	  <text variable="issue" prefix="(" suffix=")"/>
	  <text variable="page" prefix=":" suffix="."/>



引文格式的差异通常会很小,你可以找一个类似的格式,只需要做些许改动,就可以得到你想要的格式。 一般情况下,你只需要改动参考文献目录中的标点符号,各个项目(作者,题目,年份等)的位置就可以了。

在 Zotero 中,分别以prefix, suffix 和 (group) delimiter属性来标识。


<text variable="issue" prefix="(" suffix=")"/>
<text variable="issue" prefix="[" suffix="]"/>


当一篇引文的作者有多个的时候,常常需要显示 et al. 的缩写,这需要一个option参数。这个设置在CSL 0.8.1 和 1.0 中有所不同。

CSL 0.8.1

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.

如果有4个以上作者时,只显示第一个作者,并加上 et al. ,那么会有如下代码:

<option name="et-al-min" value="4" />
<option name="et-al-use-first" value="1"/>


<option name="et-al-min" value="6" />
<option name="et-al-use-first" value="3"/>

The CSL 0.8.1 Syntax explains how CSL 0.8.1 works. Common options you might wish to change are here.

CSL 1.0

In CSL 1.0, the same options - and several new ones - exist, but they are not listed separately, but included in the <citation> and <bibliography> lines, e.g.

<citation et-al-min="4" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true">

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 your style has a mistake, an error message is displayed instead of a citation. Often these messages can help you figure out what you're doing wrong.
Also, you can 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.

改变样式的标题(Title)和 ID



  • 你安装新的样式会覆盖掉原有的样式
  • 自动更新之后,你的自定义样式又会被更新覆盖。


<title>Harvard Reference format 1 (Author-Date)</title> 


<title>Harvard Style Modified</title>

Different CSL versions

Starting with version 2.1, Zotero uses an updated version of the Citation Style Language, CSL 1.0, which has a changed syntax. The styles that come with your copy of Zotero as well as most styles in the Zotero Style Repository are in the old CSL 0.8.1 format and are updated internally. You can still edit CSL 0.8.1 styles, but if you want to make more substantive changes or take advantage of one of the new features of CSL 1.0, you should download an updated version of the style from the CSL 1.0 repository or use update the CSL 0.8.1 style yourself. You cannot mix CSL 0.8.1 and 1.0. If you want to use some of the new features in 1.0 you will need to use a style converted to 1.0.


你需要将一个样式安装到 Firefox 中,或者说安装到 Zotero 中。

将样式的文本全选,复制并粘贴到文本编辑器中,保存为一个以.csl结尾的文件。然后,拖动该文件到 Firefox 窗口上面,会提示你是否安装,如下图所示。

选择确定。该样式就会安装到你的 Zotero 中了。

Some Slightly more advanced tips

For anything more advanced, this page is your friend. It also includes links to comprehensive documentation for both CSL 1.0 and CSL 0.8.1.

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 OS X, can help you to see the structure clearly and not make mistakes. Set the “language” to XML (CSL is based around XML).

You'll find that your fellow users on the Zotero forum will be happy to help you with any problems. The forums also 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 forums and it's likely to get answered quickly.

Sharing Styles

If your new style has general appeal, consider submitting it for inclusion into the Zotero Style Repository.

zh/dev/citation_styles/style_editing_step-by-step.txt · Last modified: 2017/11/12 19:53 (external edit)