-
Notifications
You must be signed in to change notification settings - Fork 0
/
citation_style_language.qmd
227 lines (202 loc) · 10.1 KB
/
citation_style_language.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
---
title: "Citation Style Language (CSL)"
format: html
---
# Overview
As mentioned earlier in the tutorial, Citation Style Language (CSL) is an XML-based format for defining citation and bibliography styles. CSL files are used by citation management software like Zotero to format citations and bibliographies in a specific style.
## Citation Style Examples
To demonstrate differences in citation styles, the citation for the same article is shown in several different styles below. The article is "Palmer Archipelago Penguins Data in the palmerpenguins R Package-An Alternative to Anderson's Irises" by Allison M. Horst, Alison Presmanes Hill, and Kristen B. Gorman, published in the R Journal in 2022.
Note that if you use Google Scholar to find article citations, you will see that the 5 examples included below are the default citation styles used by Google Scholar.
Style Name | Citation
:-:|:----------
MLA | Horst, Allison M., Alison Presmanes Hill, and Kristen B. Gorman. "Palmer Archipelago Penguins Data in the palmerpenguins R Package-An Alternative to Anderson's Irises." *R Journal* 14.1 (2022).
APA | Horst, A. M., Hill, A. P., & Gorman, K. B. (2022). Palmer Archipelago Penguins Data in the palmerpenguins R Package-An Alternative to Anderson's Irises. *R Journal*, 14(1).
Chicago | Horst, Allison M., Alison Presmanes Hill, and Kristen B. Gorman. "Palmer Archipelago Penguins Data in the palmerpenguins R Package-An Alternative to Anderson's Irises." *R Journal* 14, no. 1 (2022).
Harvard | Horst, A.M., Hill, A.P. and Gorman, K.B., 2022. Palmer Archipelago Penguins Data in the palmerpenguins R Package-An Alternative to Anderson's Irises. *R Journal*, 14(1).
Vancouver | Horst AM, Hill AP, Gorman KB. Palmer Archipelago Penguins Data in the palmerpenguins R Package-An Alternative to Anderson's Irises. R Journal. 2022 Mar 1;14(1).
# CSL and Zotero
The main Zotero application comes pre-loaded with several popular citation styles like APA, Chicago, Nature, and Vancouver style. These formats are generally sufficient for most users and scenarios, but, in the event that you need a style that is not included, you can easily add more.
Zotero maintains a collection of over 8,000 additional citation styles on the [Zotero Style Repository](https://www.zotero.org/styles). There are two ways to add a new citation style to Zotero:
1. The CSL files can be downloaded directly from the Zotero Style Repository. Once you have the file, you can add it to Zotero by dragging and dropping it into the Zotero application, or by attempting to open the file. This should open a prompt asking if you'd like to install the style.
2. From within the Zotero application. The directions for this will vary based on your operating system. In general, you can find the option to add a new citation style in the preferences or settings menu where the other citation styles are listed. You may find a button that says "Get additional styles" or "Add style." Clicking this button will open a window where you can search for and install new styles. (This window, however, is essentially a browser window that opens the Zotero Style Repository.)
Once you have added a new citation style, it will be available in the Zotero application for you to select when you *generate a bibliography directly from Zotero*. If you are using Zotero with a word processor, you may need to restart the word processor to see the new style. For text editors like RStudio, you will need to copy the CSL file to the appropriate project directory; this will be covered in detail in the [Citations in Quarto chapter](citations_in_quarto.qmd).
## What Does a CSL File Look Like?
A CSL file is an XML file that contains the information necessary to format citations and bibliographies in a specific style. The file is divided into several sections, including:
- Metadata: Information about the style, such as the title, author, and version.
- Macros: Definitions for common elements like names, dates, and titles.
- Citations: Rules for formatting in-text citations.
- Bibliography: Rules for formatting the bibliography.
If you're interested, the collapsed code below is an example of a CSL file that defines the style for formatting citations in Nature style. **Understanding the code underlying a CSL file is not necessary to use Zotero CSL files, but it can be helpful if you want to modify or create your own styles.**
:::{.callout-note collapse="true" title="XML file for Nature Citation Language Style"}
```xml
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB">
<info>
<title>Nature</title>
<id>http://www.zotero.org/styles/nature</id>
<link href="http://www.zotero.org/styles/nature" rel="self"/>
<link href="http://www.nature.com/nature/authors/gta/index.html#a5.4" rel="documentation"/>
<link href="http://www.nature.com/srep/publish/guidelines#references" rel="documentation"/>
<author>
<name>Michael Berkowitz</name>
<email>[email protected]</email>
</author>
<category citation-format="numeric"/>
<category field="science"/>
<category field="generic-base"/>
<issn>0028-0836</issn>
<eissn>1476-4687</eissn>
<updated>2024-01-22T03:08:05+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<macro name="title">
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<text variable="title" font-style="italic" text-case="title"/>
</if>
<else>
<text variable="title"/>
</else>
</choose>
</macro>
<macro name="author">
<names variable="author">
<name sort-separator=", " delimiter=", " and="symbol" initialize-with=". " delimiter-precedes-last="never" name-as-sort-order="all"/>
<label form="short" prefix=", "/>
<et-al font-style="italic"/>
</names>
</macro>
<macro name="access">
<choose>
<if variable="volume" type="article dataset software" match="any"/>
<else-if variable="DOI">
<text variable="DOI" prefix="doi:"/>
</else-if>
</choose>
</macro>
<macro name="access-data">
<choose>
<if type="dataset software" match="any">
<text variable="DOI" prefix="https://doi.org/"/>
</if>
</choose>
</macro>
<macro name="issuance">
<choose>
<if type="bill book graphic legal_case legislation motion_picture song thesis chapter paper-conference" match="any">
<group delimiter="; " suffix=".">
<group delimiter=", " prefix="(" suffix=")">
<text variable="publisher" form="long"/>
<text variable="publisher-place"/>
<date variable="issued">
<date-part name="year"/>
</date>
</group>
</group>
</if>
<else-if type="article">
<group delimiter=" ">
<choose>
<if variable="genre" match="any">
<text variable="genre" text-case="capitalize-first"/>
</if>
<else>
<text term="article" text-case="capitalize-first"/>
</else>
</choose>
<text term="at"/>
<choose>
<if variable="DOI" match="any">
<text variable="DOI" prefix="https://doi.org/"/>
</if>
<else>
<text variable="URL"/>
</else>
</choose>
<date date-parts="year" form="text" variable="issued" prefix="(" suffix=")"/>
</group>
</else-if>
<else-if type="dataset software" match="any">
<group delimiter=" ">
<text variable="publisher"/>
<text macro="access-data"/>
<date date-parts="year" form="text" variable="issued" prefix="(" suffix=")"/>
</group>
</else-if>
<else-if type="report webpage post post-weblog" match="any">
<group delimiter=" ">
<text variable="URL"/>
<date date-parts="year" form="text" variable="issued" prefix="(" suffix=")"/>
</group>
</else-if>
<else>
<date variable="issued" prefix="(" suffix=")">
<date-part name="year"/>
</date>
</else>
</choose>
</macro>
<macro name="container-title">
<choose>
<if type="article-journal">
<text variable="container-title" font-style="italic" form="short"/>
</if>
<else>
<text variable="container-title" font-style="italic"/>
</else>
</choose>
</macro>
<macro name="editor">
<choose>
<if type="chapter paper-conference" match="any">
<names variable="editor" prefix="(" suffix=")">
<label form="short" suffix=" "/>
<name and="symbol" delimiter-precedes-last="never" initialize-with=". " name-as-sort-order="all"/>
</names>
</if>
</choose>
</macro>
<macro name="volume">
<choose>
<if type="article-journal" match="any">
<text variable="volume" font-weight="bold" suffix=","/>
</if>
<else>
<group delimiter=" ">
<label variable="volume" form="short"/>
<text variable="volume"/>
</group>
</else>
</choose>
</macro>
<citation collapse="citation-number">
<sort>
<key variable="citation-number"/>
</sort>
<layout vertical-align="sup" delimiter=",">
<text variable="citation-number"/>
</layout>
</citation>
<bibliography et-al-min="6" et-al-use-first="1" second-field-align="flush" entry-spacing="0" line-spacing="2">
<layout suffix=".">
<text variable="citation-number" suffix="."/>
<group delimiter=" ">
<text macro="author" suffix="."/>
<text macro="title" suffix="."/>
<choose>
<if type="chapter paper-conference" match="any">
<text term="in"/>
</if>
</choose>
<text macro="container-title"/>
<text macro="editor"/>
<text macro="volume"/>
<text variable="page"/>
<text macro="issuance"/>
<text macro="access"/>
</group>
</layout>
</bibliography>
</style>
```
:::