最近在寫一篇綜述,要處理大量引用文獻,選用Zotero作為文獻管理工具。在插入參考文獻目錄時需要遵循格式,奈何網上找不到《軟件學報》對應的csl模板文件,所以決定自己動手修改。在此記錄下自己的學習所得。
Zotero入門
關於Zotero的用法建議閱讀這篇博客:文獻管理軟件Zotero基礎及進階示范
CSL基本概念理解
CSL是一種xml文件,專門用來描述論文中的參考文獻格式,具體包括引用格式(如是用數字[1]
形式引用還是用作者+年
的形式)和參考文獻目錄格式(如作者姓名、期刊名稱等顯示格式)。
關於CSL文獻的詳細描述參見官方文檔
CSL文件的工作原理如上圖所示,CSL文件負責描述格式,CSL Processor負責將CSL文件渲染成最終的引用和文獻目錄樣式。
CSL文件修改
- 對於CSL文件的修改,建議用在線CSL編輯器
我選用了Elsevier (numeric, with titles)作為模板來修改,其樣式如下圖,和軟件學報的要求很接近,只要將引用樣式改為上標,文獻目錄中作者姓名的顯示順序改變一下即可.
引用樣式修改如下:
文獻目錄修改如下:
出乎意料的簡單。需要注意的是因為我的文獻中英文居多,所以locale設置為了en_US,locale在左側的Global Formatting Options
中修改。
- 如果想要分享自己修改好的CSL文件,建議按照官方教程上傳到Github上
最后附上修改好的CSL文件:journal-of-software.csl
1
<?xml version="1.0" encoding="utf-8"?>
2
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US">
3
<info>
4
<title>Journal of Software(Chinese)</title>
5
<title-short>JOS</title-short>
6
<id>http://www.zotero.org/styles/journal-of-software</id>
7
<link href="http://www.zotero.org/styles/journal-of-software" rel="self"/>
8
<link href="http://www.zotero.org/styles/elsevier-with-titles" rel="template"/>
9
<author>
10
<name>Chang YC</name>
11
<email>chang.1123@outlook.com</email>
12
</author>
13
<category citation-format="numeric"/>
14
<issn>1000-9825</issn>
15
<summary>A style for Journal of Software</summary>
16
<updated>2017-07-01T03:38:51+00:00</updated>
17
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
18
</info>
19
<macro name="author">
20
<names variable="author">
21
<name delimiter-precedes-last="always" initialize-with="" name-as-sort-order="all" sort-separator=" "/>
22
<label form="short" prefix=", "/>
23
<substitute>
24
<names variable="editor"/>
25
<names variable="translator"/>
26
</substitute>
27
</names>
28
</macro>
29
<macro name="editor">
30
<names variable="editor">
31
<name initialize-with="." delimiter=", " delimiter-precedes-last="always"/>
32
<label form="short" prefix=" (" text-case="capitalize-first" suffix=")"/>
33
</names>
34
</macro>
35
<macro name="year-date">
36
<choose>
37
<if variable="issued">
38
<date variable="issued">
39
<date-part name="year"/>
40
</date>
41
</if>
42
<else>
43
<text term="no date" form="short"/>
44
</else>
45
</choose>
46
</macro>
47
<macro name="publisher">
48
<text variable="publisher" suffix=", "/>
49
<text variable="publisher-place" suffix=", "/>
50
<text macro="year-date"/>
51
</macro>
52
<macro name="edition">
53
<choose>
54
<if is-numeric="edition">
55
<group delimiter=" ">
56
<number variable="edition" form="ordinal"/>
57
<text term="edition" form="short"/>
58
</group>
59
</if>
60
<else>
61
<text variable="edition"/>
62
</else>
63
</choose>
64
</macro>
65
<macro name="access">
66
<choose>
67
<if variable="URL">
68
<text variable="URL"/>
69
<group prefix=" (" suffix=")" delimiter=" ">
70
<text term="accessed"/>
71
<date variable="accessed" form="text"/>
72
</group>
73
</if>
74
</choose>
75
</macro>
76
<citation collapse="citation-number">
77
<sort>
78
<key variable="citation-number" sort="ascending"/>
79
</sort>
80
<layout vertical-align="sup" prefix="[" suffix="]" delimiter=",">
81
<text variable="citation-number"/>
82
</layout>
83
</citation>
84
<bibliography entry-spacing="0" second-field-align="flush">
85
<layout suffix=".">
86
<text variable="citation-number" prefix="[" suffix="]"/>
87
<text macro="author" suffix=", "/>
88
<choose>
89
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
90
<group delimiter=", ">
91
<text variable="title"/>
92
<text macro="edition"/>
93
<text macro="publisher"/>
94
</group>
95
</if>
96
<else-if type="chapter paper-conference" match="any">
97
<text variable="title" suffix=", "/>
98
<text term="in" suffix=": "/>
99
<text macro="editor" suffix=", "/>
100
<text variable="container-title" form="short" text-case="title" suffix=", "/>
101
<text macro="edition" suffix=", "/>
102
<text macro="publisher"/>
103
<group delimiter=" ">
104
<label variable="page" form="short" prefix=": "/>
105
<text variable="page"/>
106
</group>
107
</else-if>
108
<else-if type="patent">
109
<group delimiter=", ">
110
<text variable="title"/>
111
<text variable="number"/>
112
<text macro="year-date"/>
113
</group>
114
</else-if>
115
<else-if type="thesis">
116
<group delimiter=", ">
117
<text variable="title"/>
118
<text variable="genre"/>
119
<text variable="publisher"/>
120
<text macro="year-date"/>
121
</group>
122
</else-if>
123
<else>
124
<group delimiter=" ">
125
<text variable="title" suffix=","/>
126
<text variable="container-title" form="short" text-case="title" suffix="."/>
127
<text variable="volume"/>
128
<text macro="year-date" prefix="(" suffix=")"/>
129
<text variable="page" form="short"/>
130
</group>
131
</else>
132
</choose>
133
<choose>
134
<if variable="DOI">
135
<text variable="DOI" prefix=". doi:"/>
136
</if>
137
<else>
138
<text macro="access" prefix=". "/>
139
</else>
140
</choose>
141
</layout>
142
</bibliography>
143
</style>