Skip to content

Commit c750b6e

Browse files
authored
APA: Put conditional event-title logic in a macro (#6161)
* APA: `event-title` and conditional `event` To handle Zotero's updated data model * Update other APA styles with event-title * APA: Put conditional event-title logic in a macro
1 parent a87414f commit c750b6e

16 files changed

+249
-142
lines changed

apa-5th-edition.csl

+18-4
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
</else-if>
184184
<else>
185185
<choose>
186-
<if variable="event" match="none">
186+
<if variable="event event-title" match="none">
187187
<text variable="genre" suffix=", "/>
188188
</if>
189189
</choose>
@@ -196,23 +196,37 @@
196196
</macro>
197197
<macro name="event">
198198
<choose>
199-
<if variable="event">
199+
<if variable="event event-title" match="any">
200200
<choose>
201201
<if variable="genre" match="none">
202202
<text term="presented at" text-case="capitalize-first" suffix=" "/>
203-
<text variable="event"/>
203+
<text macro="event-title"/>
204204
</if>
205205
<else>
206206
<group delimiter=" ">
207207
<text variable="genre" text-case="capitalize-first"/>
208208
<text term="presented at"/>
209-
<text variable="event"/>
209+
<text macro="event-title"/>
210210
</group>
211211
</else>
212212
</choose>
213213
</if>
214214
</choose>
215215
</macro>
216+
<macro name="event-title">
217+
<choose>
218+
<!-- TODO: We expect "event-title" to be used,
219+
but processors and applications may not be updated yet.
220+
This macro ensures that either "event" or "event-title" can be accpeted.
221+
Remove if procesor logic and application adoption can handle this. -->
222+
<if variable="event-title">
223+
<text variable="event-title"/>
224+
</if>
225+
<else>
226+
<text variable="event"/>
227+
</else>
228+
</choose>
229+
</macro>
216230
<macro name="issued">
217231
<choose>
218232
<if variable="issued">

apa-6th-edition-no-ampersand.csl

+15-10
Original file line numberDiff line numberDiff line change
@@ -917,16 +917,7 @@
917917
</else>
918918
</choose>
919919
<group delimiter=", ">
920-
<choose>
921-
<!-- We expect "event-title" to be used, but applications may not be updated yet.
922-
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
923-
<if variable="event-title">
924-
<text variable="event-title"/>
925-
</if>
926-
<else>
927-
<text variable="event"/>
928-
</else>
929-
</choose>
920+
<text macro="event-title"/>
930921
<text variable="event-place"/>
931922
</group>
932923
</group>
@@ -938,6 +929,20 @@
938929
</if>
939930
</choose>
940931
</macro>
932+
<macro name="event-title">
933+
<choose>
934+
<!-- TODO: We expect "event-title" to be used,
935+
but processors and applications may not be updated yet.
936+
This macro ensures that either "event" or "event-title" can be accpeted.
937+
Remove if procesor logic and application adoption can handle this. -->
938+
<if variable="event-title">
939+
<text variable="event-title"/>
940+
</if>
941+
<else>
942+
<text variable="event"/>
943+
</else>
944+
</choose>
945+
</macro>
941946
<macro name="issued">
942947
<choose>
943948
<if type="bill legal_case legislation" match="any"/>

apa-6th-edition.csl

+15-10
Original file line numberDiff line numberDiff line change
@@ -916,16 +916,7 @@
916916
</else>
917917
</choose>
918918
<group delimiter=", ">
919-
<choose>
920-
<!-- We expect "event-title" to be used, but applications may not be updated yet.
921-
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
922-
<if variable="event-title">
923-
<text variable="event-title"/>
924-
</if>
925-
<else>
926-
<text variable="event"/>
927-
</else>
928-
</choose>
919+
<text macro="event-title"/>
929920
<text variable="event-place"/>
930921
</group>
931922
</group>
@@ -937,6 +928,20 @@
937928
</if>
938929
</choose>
939930
</macro>
931+
<macro name="event-title">
932+
<choose>
933+
<!-- TODO: We expect "event-title" to be used,
934+
but processors and applications may not be updated yet.
935+
This macro ensures that either "event" or "event-title" can be accpeted.
936+
Remove if procesor logic and application adoption can handle this. -->
937+
<if variable="event-title">
938+
<text variable="event-title"/>
939+
</if>
940+
<else>
941+
<text variable="event"/>
942+
</else>
943+
</choose>
944+
</macro>
940945
<macro name="issued">
941946
<choose>
942947
<if type="bill legal_case legislation" match="any"/>

apa-annotated-bibliography.csl

+15-10
Original file line numberDiff line numberDiff line change
@@ -1559,23 +1559,28 @@
15591559
<if variable="collection-editor editor editorial-director issue page volume" match="none">
15601560
<!-- Don't print event info if published in a proceedings -->
15611561
<group delimiter=", ">
1562-
<choose>
1563-
<!-- We expect "event-title" to be used, but applications may not be updated yet.
1564-
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
1565-
<if variable="event-title">
1566-
<text variable="event-title"/>
1567-
</if>
1568-
<else>
1569-
<text variable="event"/>
1570-
</else>
1571-
</choose>
1562+
<text macro="event-title"/>
15721563
<text variable="event-place"/>
15731564
</group>
15741565
</if>
15751566
</choose>
15761567
</if>
15771568
</choose>
15781569
</macro>
1570+
<macro name="event-title">
1571+
<choose>
1572+
<!-- TODO: We expect "event-title" to be used,
1573+
but processors and applications may not be updated yet.
1574+
This macro ensures that either "event" or "event-title" can be accpeted.
1575+
Remove if procesor logic and application adoption can handle this. -->
1576+
<if variable="event-title">
1577+
<text variable="event-title"/>
1578+
</if>
1579+
<else>
1580+
<text variable="event"/>
1581+
</else>
1582+
</choose>
1583+
</macro>
15791584
<!-- After 'source', APA also prints publication history (original publication, reprint info, retraction info) -->
15801585
<macro name="publication-history">
15811586
<choose>

apa-cv.csl

+15-10
Original file line numberDiff line numberDiff line change
@@ -1306,23 +1306,28 @@
13061306
<if variable="collection-editor editor editorial-director issue page volume" match="none">
13071307
<!-- Don't print event info if published in a proceedings -->
13081308
<group delimiter=", ">
1309-
<choose>
1310-
<!-- We expect "event-title" to be used, but applications may not be updated yet.
1311-
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
1312-
<if variable="event-title">
1313-
<text variable="event-title"/>
1314-
</if>
1315-
<else>
1316-
<text variable="event"/>
1317-
</else>
1318-
</choose>
1309+
<text macro="event-title"/>
13191310
<text variable="event-place"/>
13201311
</group>
13211312
</if>
13221313
</choose>
13231314
</if>
13241315
</choose>
13251316
</macro>
1317+
<macro name="event-title">
1318+
<choose>
1319+
<!-- TODO: We expect "event-title" to be used,
1320+
but processors and applications may not be updated yet.
1321+
This macro ensures that either "event" or "event-title" can be accpeted.
1322+
Remove if procesor logic and application adoption can handle this. -->
1323+
<if variable="event-title">
1324+
<text variable="event-title"/>
1325+
</if>
1326+
<else>
1327+
<text variable="event"/>
1328+
</else>
1329+
</choose>
1330+
</macro>
13261331
<!-- After 'source', APA also prints publication history (original publication, reprint info, retraction info) -->
13271332
<macro name="publication-history">
13281333
<choose>

apa-fr-provost.csl

+18-4
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
<else-if type="map post-weblog post" match="none">
246246
<group delimiter=", ">
247247
<choose>
248-
<if variable="event" match="none">
248+
<if variable="event event-title" match="none">
249249
<text variable="genre" prefix="[" suffix="]"/>
250250
</if>
251251
</choose>
@@ -298,17 +298,17 @@
298298
<choose>
299299
<if variable="container-title" match="none">
300300
<choose>
301-
<if variable="event">
301+
<if variable="event event-title" match="any">
302302
<choose>
303303
<if variable="genre" match="none">
304304
<text term="presented at" text-case="capitalize-first" suffix=" "/>
305-
<text variable="event"/>
305+
<text macro="event-title"/>
306306
</if>
307307
<else>
308308
<group delimiter=" ">
309309
<text variable="genre" text-case="capitalize-first"/>
310310
<text term="presented at"/>
311-
<text variable="event"/>
311+
<text macro="event-title"/>
312312
</group>
313313
</else>
314314
</choose>
@@ -317,6 +317,20 @@
317317
</if>
318318
</choose>
319319
</macro>
320+
<macro name="event-title">
321+
<choose>
322+
<!-- TODO: We expect "event-title" to be used,
323+
but processors and applications may not be updated yet.
324+
This macro ensures that either "event" or "event-title" can be accpeted.
325+
Remove if procesor logic and application adoption can handle this. -->
326+
<if variable="event-title">
327+
<text variable="event-title"/>
328+
</if>
329+
<else>
330+
<text variable="event"/>
331+
</else>
332+
</choose>
333+
</macro>
320334
<macro name="extra">
321335
<choose>
322336
<if type="manuscript">

apa-no-ampersand.csl

+15-10
Original file line numberDiff line numberDiff line change
@@ -1559,23 +1559,28 @@
15591559
<if variable="collection-editor editor editorial-director issue page volume" match="none">
15601560
<!-- Don't print event info if published in a proceedings -->
15611561
<group delimiter=", ">
1562-
<choose>
1563-
<!-- We expect "event-title" to be used, but applications may not be updated yet.
1564-
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
1565-
<if variable="event-title">
1566-
<text variable="event-title"/>
1567-
</if>
1568-
<else>
1569-
<text variable="event"/>
1570-
</else>
1571-
</choose>
1562+
<text macro="event-title"/>
15721563
<text variable="event-place"/>
15731564
</group>
15741565
</if>
15751566
</choose>
15761567
</if>
15771568
</choose>
15781569
</macro>
1570+
<macro name="event-title">
1571+
<choose>
1572+
<!-- TODO: We expect "event-title" to be used,
1573+
but processors and applications may not be updated yet.
1574+
This macro ensures that either "event" or "event-title" can be accpeted.
1575+
Remove if procesor logic and application adoption can handle this. -->
1576+
<if variable="event-title">
1577+
<text variable="event-title"/>
1578+
</if>
1579+
<else>
1580+
<text variable="event"/>
1581+
</else>
1582+
</choose>
1583+
</macro>
15791584
<!-- After 'source', APA also prints publication history (original publication, reprint info, retraction info) -->
15801585
<macro name="publication-history">
15811586
<choose>

apa-no-doi-no-issue.csl

+15-10
Original file line numberDiff line numberDiff line change
@@ -923,16 +923,7 @@
923923
</else>
924924
</choose>
925925
<group delimiter=", ">
926-
<choose>
927-
<!-- We expect "event-title" to be used, but applications may not be updated yet.
928-
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
929-
<if variable="event-title">
930-
<text variable="event-title"/>
931-
</if>
932-
<else>
933-
<text variable="event"/>
934-
</else>
935-
</choose>
926+
<text macro="event-title"/>
936927
<text variable="event-place"/>
937928
</group>
938929
</group>
@@ -944,6 +935,20 @@
944935
</if>
945936
</choose>
946937
</macro>
938+
<macro name="event-title">
939+
<choose>
940+
<!-- TODO: We expect "event-title" to be used,
941+
but processors and applications may not be updated yet.
942+
This macro ensures that either "event" or "event-title" can be accpeted.
943+
Remove if procesor logic and application adoption can handle this. -->
944+
<if variable="event-title">
945+
<text variable="event-title"/>
946+
</if>
947+
<else>
948+
<text variable="event"/>
949+
</else>
950+
</choose>
951+
</macro>
947952
<macro name="issued">
948953
<choose>
949954
<if type="bill legal_case legislation" match="any"/>

apa-no-initials.csl

+15-10
Original file line numberDiff line numberDiff line change
@@ -1559,23 +1559,28 @@
15591559
<if variable="collection-editor editor editorial-director issue page volume" match="none">
15601560
<!-- Don't print event info if published in a proceedings -->
15611561
<group delimiter=", ">
1562-
<choose>
1563-
<!-- We expect "event-title" to be used, but applications may not be updated yet.
1564-
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
1565-
<if variable="event-title">
1566-
<text variable="event-title"/>
1567-
</if>
1568-
<else>
1569-
<text variable="event"/>
1570-
</else>
1571-
</choose>
1562+
<text macro="event-title"/>
15721563
<text variable="event-place"/>
15731564
</group>
15741565
</if>
15751566
</choose>
15761567
</if>
15771568
</choose>
15781569
</macro>
1570+
<macro name="event-title">
1571+
<choose>
1572+
<!-- TODO: We expect "event-title" to be used,
1573+
but processors and applications may not be updated yet.
1574+
This macro ensures that either "event" or "event-title" can be accpeted.
1575+
Remove if procesor logic and application adoption can handle this. -->
1576+
<if variable="event-title">
1577+
<text variable="event-title"/>
1578+
</if>
1579+
<else>
1580+
<text variable="event"/>
1581+
</else>
1582+
</choose>
1583+
</macro>
15791584
<!-- After 'source', APA also prints publication history (original publication, reprint info, retraction info) -->
15801585
<macro name="publication-history">
15811586
<choose>

0 commit comments

Comments
 (0)