Differences

This shows you the differences between two versions of the page.

Link to this comparison view

zh:dev:citation_styles [2017/11/12 19:53] (current)
Line 1: Line 1:
 +<​html><​p id="​zotero-5-update-warning"​ style="​color:​ red; font-weight:​ bold">​We’re
 +in the process of updating the documentation for
 +<a href="​https://​www.zotero.org/​blog/​zotero-5-0">​Zotero 5.0</​a>​. Some documentation
 +may be outdated in the meantime. Thanks for your understanding.</​p></​html>​
  
 +
 +====== Citation Styles ======
 +
 +===== Citation Formatting in Zotero =====
 +
 +Zotero有多种方法生产引文和参考文献目录。它们可以在[[/​support/​word_processor_integration|字处理软件]] (Word,OpenOffice)中自动生成,也可以通过 [[/​support/​creating_bibliographies|Quick Copy]] 或者 [[/​support/​rtf_scan|RTF Scan]]来完成。而 [[http://​citationstyles.org/​|引文格式语言]] (CSL) 就是这一切得意工作的基础,Zotero基于该语言生成引文和参考文献目录。
 +
 +CSL 是独立于Zotero之外的一个开源项目,不过 CSL 和 Zotero 之间存在密切联系。因为 Zotero 中有超过 1500 个 CSL 样式可供使用。 此外,Zotero 通过另外一个开源项目[[https://​bitbucket.org/​fbennett/​citeproc-js/​wiki/​Home|citeproc-js]]来处理 CSL 样式,以便将正确的引文格式展示出来。确切的说,是 citeproc-js 在格式化引文,Zotero 要做的只是提供一个平台(即citeproc-node)。
 +
 +下面我们介绍一下如何编辑一个 CSL 文件。
 +
 +===== Editing CSL Styles =====
 +
 +CSL 文件事实上是由 XML 写成的。你可以使用任意一个文本编辑器来编辑它(如记事本)。
 +
 +为了方便调试 CSL 文件,Zotero 自带了两个测试工具。
 +
 +  * The Zotero Reference Test pane. 在 Firefox 浏览器地址栏中输入 <​nowiki>"​chrome://​zotero/​content/​tools/​csledit.xul"</​nowiki>​ 访问,该工具实时展示在 Zotero 中选定条目的引文格式。
 +  * The Zotero Preview pane. 在 Firefox 浏览器地址栏中输入 <​nowiki>"​chrome://​zotero/​content/​tools/​cslpreview.xul"</​nowiki>​ 访问,该工具会把你选定的条目以所有你已经安装的样式展示出来。
 +
 +==== 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.
 +
 +All the styles in the [[/​styles|Zotero Style Repository]] have been upgraded from CSL 0.8.1 to 1.0. The Zotero Style Repository now draws it styles from the [[https://​github.com/​citation-style-language/​styles|GitHub CSL 1.0 style repository]] instead of from the Zotero SVN. If you have a customized style that is not in the repository and is still in the 0.8.1 format, you can continue using it: Zotero 2.1 and newer still accept CSL 0.8.1 styles and convert them internally to CSL 1.0. However, if you want to take full advantage of the new features of CSL 1.0, consider [[http://​citationstyles.org/​downloads/​upgrade-notes.html#​updating-csl-0-8-styles|upgrading your style]].
 +
 +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. "<​nowiki><​style xmlns="​http://​purl.org/​net/​xbiblio/​csl"​ class="​in-text"​ version="​1.0"></​nowiki>"​. CSL 0.8.1 styles lack the version attribute.
 +
 +==== Editing CSL 1.0 Styles ====
 +
 +请参考下列资源:
 +
 +  * [[http://​citationstyles.org/​downloads/​primer.html|CSL 1.0 Primer]] - CSL 1.0 简介,小试牛刀
 +  * [[http://​citationstyles.org/​downloads/​specification.html|CSL 1.0 Specification]] - CSL 1.0 详解
 +  * [[dev/​citation_styles/​Style Editing Step-By-Step]] - 教程:修改 CSL 样式 (CSL 1.0 和 0.8.1 通用)
 +
 +==== Editing CSL 0.8.1 Styles ====
 +
 +请参考下列资源:
 +
 +  * [[http://​www.condast.com/​zotero/​index.html]] - 另一个教程
 +  * [[dev/​citation_styles/​CSL 0.8.1 Syntax]] - CSL 0.8.1 语法简介
 +
 +==== Validation ====
 +
 +When editing a CSL style, it is crucial to verify whether the finished style is valid XML and conforms to the CSL schema. This ensures that Zotero can install the style and process it correctly. Fortunately,​ there are several XML validation tools with support for the RELAX NG Compact schema language. These include the editors [[http://​www.gnu.org/​software/​emacs/​|Emacs]] (when using the [[http://​www.thaiopensource.com/​nxml-mode/​|nXML addon]]) and [[http://​www.oxygenxml.com/​|oXygen XML Editor]] (both offer real-time validation),​ and the command-line utilities [[http://​www.davidashen.net/​rnv.html|RNV]] and [[http://​www.thaiopensource.com/​relaxng/​jing.html|Jing]]. However, especially for infrequent use, the easiest option might be the online XML validator [[http://​validator.nu/​|Validator.nu]]. To validate a style using this website:
 +
 +  - Select the style you want to validate. When using "​Address"​ option, provide the URL to the style. With "File Upload",​ select the style file on your computer. With "Text Field",​ paste the style code into the text box.
 +  - Enter the URL to the CSL schema file in the "​Schemas"​ text field. For CSL 1.0, this is “https://​github.com/​citation-style-language/​schema/​raw/​v1.0/​csl.rnc”. For CSL 0.8.1, this is “https://​github.com/​citation-style-language/​schema/​raw/​v0.8.1/​csl.rnc”.
 +  - Check the "Be lax about HTTP Content-Type"​ check-box and select the "XML; don't load external entities"​ option in the "​Parser"​ drop-down menu.
 +  - Click the “Validate” button. If the style is correct, you will get the message “The document validates according to the specified schema(s) and to additional constraints checked by the validator.”. Only errors are important, warnings can be ignored.
 +
 +==== 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 [[preferences/​styles|Style Manager]] in the [[/​support/​preferences|Zotero preferences]],​ 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 the information on [[/​support/​dev/​citation_styles/​sharing styles|sharing 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 [[/​support/​dev/​localization#​csl_styles|localization section]].
 +
 +===== Diving Deeper =====
 +
 +==== CSL and citeproc-js ====
 +
 +To learn more about CSL, visit the [[http://​citationstyles.org/​|CSL project home]] and the [[http://​sourceforge.net/​mailarchive/​forum.php?​forum_name=xbiblio-devel|xbiblio mailing list]]. For more information about the citeproc-js CSL processor, see the citeproc-js [[https://​bitbucket.org/​fbennett/​citeproc-js/​wiki/​Home|code repository]],​ [[http://​gsl-nagoya-u.net/​http/​pub/​citeproc-doc.html|integrator'​s manual]], and [[https://​groups.google.com/​forum/#​!forum/​citeproc-js|mailing list]].
 +
 +==== citeproc-node ====
 +
 +citeproc-node allows citeproc-js to be deployed on a server. See the [[/​support/​dev/​citation_styles/​citeproc-node|citeproc-node installation instructions]].
zh/dev/citation_styles.txt · Last modified: 2017/11/12 19:53 (external edit)