publ-imp-apa.mkvi /size: 44 Kb    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=publ-imp-apa,
3
%D version=2013.12.12,
4
%D title=APA bibliography style,
5
%D subtitle=Publications,
6
%D author=Alan Braslau and Hans Hagen,
7
%D date=\currentdate,
8
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
%C
10
%C This module is part of the \CONTEXT\ macro||package and is therefore copyrighted
11
%D by \PRAGMA. See mreadme.pdf for details.
12 13
\startbtxrenderingdefinitions
[
apa
]
14 15
\ifdefined
\c!translate
\else
\def
\c!translate
{
translate
}
\fi
16 17
%D Reference:
18
%D \startTEX
19
%D @Book{APA2010,
20
%D title ={Publication Manual of the American Psychological Association},
21
%D year ={2010},
22
%D edition ={Sixth},
23
%D address ={Washington, DC},
24
%D publisher={American Psychological Association},
25
%D Xpages ={291},
26
%D url ={http://www.apa.org/books/},
27
%D }
28
%D \stopTEX
29 30
% set ALL specific APA compliant values
31 32
\definebtx
33
[
apa
]
34
[
\c!default
=
default
,
35
\c!specification
=
apa
,
36
\c!otherstext
=
{
\btxspace
\btxlabeltext
{
others
}}
,
37
%c!journalconversion=\v!normal,
38
\c!monthconversion
=
\v!month
,
39
\c!stopper
:
initials
=
{
.
}
,
% with a (breakable) space
40
\c!separator
:
names
:
2
=
{
\btxcomma
}
,
% aka namesep - in this namespace
41
\c!separator
:
names
:
3
=
{
\btxcomma
\btxnobreakspace
\textampersand\space
}
,
% comma separated list
42
\c!separator
:
names
:
4
=
{
\btxnobreakspace
\textampersand\space
}
]
% last of two, no comma!
43 44
% First, define list and rendering parameters
45 46
% The APA style sorts the unnumbered rendered list by authoryear
47 48
\definebtxrendering
49
[
apa
]
50
[
\c!specification
=
apa
,
51
\c!sorttype
=
authoryear
,
52
\c!numbering
=
\v!no
]
53 54
\setupbtxlist
55
[
apa
]
56
[
\c!alternative
=
\v!paragraph
,
57
\c!align
=
{
normal
,
verytolerant
,
stretch
}
,
58
%\c!width=\v!fit,
59
%\c!distance=.5\emwidth,
60
\c!margin
=
3
.
5
\emwidth
]
61 62
\definebtx
63
[
apa
:
\s!list
]
64
[
apa
]
65
[
\c!otherstext
=
{
\btxcomma
\btxnobreakspace
\textellipsis\space
}
,
66
\c!etallimit
=
7
,
67
\c!etaldisplay
=
6
,
68
\c!etaloption
=
last
,
69
\c!authorconversion
=
invertedshort
]
70 71
% First, we define a namespace for a few special fields
72 73
\definebtx
74
[
apa
:
\s!list
:
author
]
75
[
apa
:
\s!list
]
76 77
\definebtx
78
[
apa
:
\s!list
:
withauthor
]
79
[
apa
:
\s!list
:
author
]
80 81
\definebtx
82
[
apa
:
\s!list
:
editor
]
83
[
apa
:
\s!list
:
author
]
84 85
\definebtx
86
[
apa
:
\s!list
:
ineditor
]
87
[
apa
:
\s!list
:
editor
]
88
[
\c!authorconversion
=
normalshort
]
89 90
\definebtx
91
[
apa
:
\s!list
:
translator
]
92
[
apa
:
\s!list
:
author
]
93
[
\c!authorconversion
=
normalshort
]
94 95
\definebtx
96
[
apa
:
\s!list
:
director
]
97
[
apa
:
\s!list
:
author
]
98 99
\definebtx
100
[
apa
:
\s!list
:
producer
]
101
[
apa
:
\s!list
:
author
]
102 103
\definebtx
104
[
apa
:
\s!list
:
suffix
]
105
[
apa
:
\s!list
]
106 107
\definebtx
108
[
apa
:
\s!list
:
url
]
109
[
apa
:
\s!list
]
110 111
\definebtx
112
[
apa
:
\s!list
:
doi
]
113
[
apa
:
\s!list
]
114 115
\definebtx
116
[
apa
:
\s!list
:
\s!page
]
117
[
apa
:
\s!list
]
118
[
\c!separator
:
2
=
{
\btxcomma
}
,
119
\c!separator
:
3
=
{
\btxcomma
\btxlabeltext
{
and
}
\space
}
,
120
\c!separator
:
4
=
{
\btxspace
\btxlabeltext
{
and
}
\space
}
,
121
\c!left
=
{
\btxleftparenthesis
}
,
122
\c!right
=
{
\btxrightparenthesis
}
,
123
\c!command
=
{
\wordright
}
]
124 125
\definebtx
126
[
apa
:
\s!list
:
numbering
]
127
[
apa
:
\s!list
]
128
[
\c!right
=
{
\btxspace
}
]
129 130
\definebtx
131
[
apa
:
\s!list
:
numbering
:
default
]
132
[
apa
:
\s!list
:
numbering
]
133 134
\definebtx
135
[
apa
:
\s!list
:
numbering
:
num
]
136
[
apa
:
\s!list
:
numbering
]
137
[
\c!stopper
=
{
.
}
]
138 139
\definebtx
140
[
apa
:
\s!list
:
numbering
:
short
]
141
[
apa
:
\s!list
:
numbering
]
142 143
\definebtx
144
[
apa
:
\s!list
:
numbering
:
tag
]
145
[
apa
:
\s!list
:
numbering
]
146 147
\definebtx
148
[
apa
:
\s!list
:
numbering
:
index
]
149
[
apa
:
\s!list
:
numbering
]
150 151
% Next, we define a namespace for each category
152 153
%D In order to be able to get journals expanded (or normalized or abbreviated) you need
154
%D to load a list:
155
%D
156
%D \starttyping
157
%D \btxloadjournallist[journals.txt] % the jabref list
158
%D \stoptyping
159 160
\definebtx
161
[
apa
:
\s!list
:
journal
]
162
[
apa
:
\s!list
]
163
[
\c!style
=
\v!italic
]
164
%command=\btxexpandedjournal] % btxabbreviatedjournal
165 166
\definebtx
167
[
apa
:
\s!list
:
volume
]
168
[
apa
:
\s!list
]
169
[
\c!style
=
\v!italic
]
170 171
\definebtx
172
[
apa
:
\s!list
:
title
]
173
[
apa
:
\s!list
]
174
[
\c!style
=
\v!italic
,
175
\c!command
=
\Word
,
176
\c!translate
=
\v!yes
]
177 178
\definebtx
179
[
apa
:
\s!list
:
title
:
article
]
180
[
apa
:
\s!list
:
title
]
181
[
\c!style
=]
% journal is set in italics
182 183
\definebtx
184
[
apa
:
\s!list
:
title
:
magazine
]
185
[
apa
:
\s!list
:
title
]
186 187
\definebtx
188
[
apa
:
\s!list
:
title
:
newspaper
]
189
[
apa
:
\s!list
:
title
]
190 191
\definebtx
192
[
apa
:
\s!list
:
title
:
periodical
]
193
[
apa
:
\s!list
:
title
]
194 195
\definebtx
196
[
apa
:
\s!list
:
title
:
standard
]
197
[
apa
:
\s!list
:
title
]
198 199
\definebtx
200
[
apa
:
\s!list
:
title
:
book
]
201
[
apa
:
\s!list
:
title
]
202 203
\definebtx
204
[
apa
:
\s!list
:
booktitle
:
inbook
]
205
[
apa
:
\s!list
:
title
]
206 207
\definebtx
208
[
apa
:
\s!list
:
title
:
inbook
]
209
[
apa
:
\s!list
:
title
]
210
[
\c!style
=]
% booktitle is set in italics
211 212
\definebtx
213
[
apa
:
\s!list
:
booktitle
:
incollection
]
214
[
apa
:
\s!list
:
title
]
215 216
\definebtx
217
[
apa
:
\s!list
:
title
:
incollection
]
218
[
apa
:
\s!list
:
title
]
219
[
\c!style
=]
% booktitle is set in italics
220 221
\definebtx
222
[
apa
:
\s!list
:
title
:
proceedings
]
223
[
apa
:
\s!list
:
title
]
224 225
\definebtx
226
[
apa
:
\s!list
:
booktitle
:
inproceedings
]
227
[
apa
:
\s!list
:
title
]
228 229
\definebtx
230
[
apa
:
\s!list
:
title
:
inproceedings
]
231
[
apa
:
\s!list
:
title
]
232
[
\c!style
=]
% booktitle is set in italics
233 234
\definebtx
235
[
apa
:
\s!list
:
booktitle
:
conference
]
236
[
apa
:
\s!list
:
title
]
237 238
\definebtx
239
[
apa
:
\s!list
:
title
:
conference
]
240
[
apa
:
\s!list
:
title
]
241
[
\c!style
=]
% booktitle is set in italics
242 243
\definebtx
244
[
apa
:
\s!list
:
title
:
thesis
]
245
[
apa
:
\s!list
:
title
]
246 247
\definebtx
248
[
apa
:
\s!list
:
title
:
phdthesis
]
249
[
apa
:
\s!list
:
title
]
250 251
\definebtx
252
[
apa
:
\s!list
:
title
:
mastersthesis
]
253
[
apa
:
\s!list
:
title
]
254 255
\definebtx
256
[
apa
:
\s!list
:
title
:
booklet
]
257
[
apa
:
\s!list
:
title
]
258 259
\definebtx
260
[
apa
:
\s!list
:
title
:
manual
]
261
[
apa
:
\s!list
:
title
]
262 263
\definebtx
264
[
apa
:
\s!list
:
title
:
techreport
]
265
[
apa
:
\s!list
:
title
]
266 267
\definebtx
268
[
apa
:
\s!list
:
title
:
unpublished
]
269
[
apa
:
\s!list
:
title
]
270 271
\definebtx
272
[
apa
:
\s!list
:
title
:
patent
]
273
[
apa
:
\s!list
:
title
]
274 275
\definebtx
276
[
apa
:
\s!list
:
title
:
electronic
]
277
[
apa
:
\s!list
:
title
]
278 279
\definebtx
280
[
apa
:
\s!list
:
title
:
music
]
281
[
apa
:
\s!list
:
title
]
282 283
\definebtx
284
[
apa
:
\s!list
:
title
:
film
]
285
[
apa
:
\s!list
:
title
]
286 287
\definebtx
288
[
apa
:
\s!list
:
title
:
other
]
289
[
apa
:
\s!list
:
title
]
290 291
\definebtx
292
[
apa
:
\s!list
:
title
:
misc
]
293
[
apa
:
\s!list
:
title
]
294 295
\definebtx
296
[
apa
:
\s!list
:
title
:
literal
]
297
[
apa
:
\s!list
:
title
]
298 299
\definebtx
300
[
apa
:
\s!list
:
type
]
301
[
\c!command
=
\Word
]
302 303
% Then define and set cite parameters.
304 305
\definebtx
306
[
apa
:
\s!cite
]
307
[
apa
]
308
[
\c!alternative
=
authoryear
,
309
\c!otherstext
=
{
\btxcomma
\btxlabeltext
{
others
}}
,
310
\c!etallimit
=
5
,
311
\c!etaldisplay
=
1
,
% TODO: when 2-4, show all first time, etaldisplay subsequently...
312
\c!authorconversion
=
\v!name
,
313
\c!sorttype
=
normal
,
% \v!normal ?
314
\c!style
=
,
315
\c!compress
=
\v!yes
,
% note that cite sorts only work with compress=yes.
316
\c!separator
:
names
:
3
=
{
\btxcomma
\btxlabeltext
{
and
}
\space
}
,
% not \textampersand
317
\c!separator
:
names
:
4
=
{
\btxspace
\btxlabeltext
{
and
}
\space
}
]
% not \textampersand
318 319
\definebtx
320
[
apa
:
\s!cite
:
name
]
321
[
apa
:
\s!cite
]
322
[
\c!authorconversion
=
\v!name
]
323 324
\definebtx
325
[
apa
:
\s!cite
:
inverted
]
326
[
apa
:
\s!cite
]
327
[
\c!authorconversion
=
\v!invertedshort
]
328 329
\definebtx
330
[
apa
:
\s!cite
:
invertedshort
]
331
[
apa
:
\s!cite
]
332
[
\c!authorconversion
=
\v!invertedshort
]
333 334
\definebtx
335
[
apa
:
\s!cite
:
normalshort
]
336
[
apa
:
\s!cite
]
337
[
\c!authorconversion
=
\v!normalshort
]
338 339
\definebtx
340
[
apa
:
\s!cite
:
normal
]
341
[
apa
:
\s!cite
]
342
[
\c!authorconversion
=
\v!normal
]
343 344
\definebtx
345
[
apa
:
\s!cite
:
author
]
346
[
apa
:
\s!cite
]
347 348
\definebtx
349
[
apa
:
\s!cite
:
editor
]
350
[
apa
:
\s!cite
:
author
]
351 352
\definebtx
353
[
apa
:
\s!cite
:
translator
]
354
[
apa
:
\s!cite
:
author
]
355 356
\definebtx
357
[
apa
:
\s!cite
:
organization
]
358
[
apa
:
\s!cite
]
359 360
\definebtx
361
[
apa
:
\s!cite
:
authoryear
]
362
[
apa
:
\s!cite
:
author
]
363
[
\c!left
=
{
(
}
,
364
\c!right
=
{
)
}
,
365
\c!inbetween
=
{
\btxcomma
}
,
366
\c!separator
:
names
:
3
=
{
\btxcomma
\textampersand\space
}
,
367
\c!separator
:
names
:
4
=
{
\btxspace
\textampersand\space
}
]
368 369
\definebtx
370
[
apa
:
\s!cite
:
default
]
371
[
apa
:
\s!cite
:
authoryear
]
372 373
\definebtx
374
[
apa
:
\s!cite
:
authoryears
]
375
[
apa
:
\s!cite
:
author
]
376
[
\c!left
=
,
% these two settings are perhaps redundant?
377
\c!right
=
,
378
\c!inbetween
=
{
\btxspace
}
]
379 380
\definebtx
381
[
apa
:
\s!cite
:
authornum
]
382
[
apa
:
\s!cite
:
author
]
383
[
\c!left
=
{
(
}
,
384
\c!right
=
{
)
}
,
385
\c!separator
:
names
:
3
=
{
\btxcomma
\textampersand\space
}
,
386
\c!separator
:
names
:
4
=
{
\btxspace
\textampersand\space
}
]
387 388
\definebtx
389
[
apa
:
\s!cite
:
author
:
num
]
% todo
390
[
apa
:
\s!cite
:
authornum
]
391
[
\c!left
=
{
\btxspace
[
}
,
392
\c!right
=
{
]
}
]
393 394
\definebtx
395
[
apa
:
\s!cite
:
author
:
year
]
% todo
396
[
apa
:
\s!cite
]
397 398
\definebtx
399
[
apa
:
\s!cite
:
author
:
years
]
% todo
400
[
apa
:
\s!cite
:
authoryears
]
401
[
\c!inbetween
=
,
402
\c!left
=
{
\btxspace
(
}
,
403
\c!right
=
{
)
}
]
404 405
\definebtx
406
[
apa
:
\s!cite
:
lefttext
]
407
[
apa
:
\s!cite
]
408
[
\c!left
=
,
409
\c!right
=
{
\btxspace
}
]
410 411
\definebtx
412
[
apa
:
\s!cite
:
righttext
]
413
[
apa
:
\s!cite
]
414
[
\c!left
=
{
\btxcomma
}
,
415
\c!right
=]
416 417
\definebtx
418
[
apa
:
\s!cite
:
year
]
419
[
apa
:
\s!cite
]
420
[
\c!separator
:
2
=
{
\btxcomma
}
,
% :0 and :1 - between items of a list
421
\c!separator
:
3
=
{
\btxcomma
\btxlabeltext
{
and
}
\space
}
,
% not \textampersand
422
\c!separator
:
4
=
{
\btxspace
\btxlabeltext
{
and
}
\space
}
]
% not \textampersand
423 424
\definebtx
425
[
apa
:
\s!cite
:
title
]
426
[
apa
:
\s!cite
]
427
[
\c!separator
:
2
=
{
\btxcomma
}
,
% :0 and :1 - between items of a list
428
\c!separator
:
3
=
{
\btxcomma
\btxlabeltext
{
and
}
\space
}
,
% not \textampersand
429
\c!separator
:
4
=
{
\btxspace
\btxlabeltext
{
and
}
\space
}
,
% not \textampersand
430
\c!command
=
{
\language
[
\currentbtxlanguage
]
}
,
% BAH
431
\c!sorttype
=
none
,
432
\c!style
=
\v!italic
]
433 434
\definebtx
435
[
apa
:
\s!cite
:
subtitle
]
436
[
apa
:
\s!cite
:
title
]
437 438
\definebtx
439
[
apa
:
\s!cite
:
booktitle
]
440
[
apa
:
\s!cite
:
title
]
441 442
\definebtx
443
[
apa
:
\s!cite
:
subbooktitle
]
444
[
apa
:
\s!cite
:
booktitle
]
445 446
% Will these get used?
447 448
\definebtx
449
[
apa
:
\s!cite
:
title
:
inbook
]
450
[
apa
:
\s!cite
:
title
]
451
[
\c!style
=]
% not italic
452 453
\definebtx
454
[
apa
:
\s!cite
:
title
:
incollection
]
455
[
apa
:
\s!cite
:
title
:
inbook
]
456 457
\definebtx
458
[
apa
:
\s!cite
:
title
:
inproceedings
]
459
[
apa
:
\s!cite
:
title
:
inbook
]
460 461
\definebtx
462
[
apa
:
\s!cite
:
subtitle
:
inbook
]
463
[
apa
:
\s!cite
:
title
:
inbook
]
464 465
\definebtx
466
[
apa
:
\s!cite
:
subtitle
:
incollection
]
467
[
apa
:
\s!cite
:
title
:
incollection
]
468 469
\definebtx
470
[
apa
:
\s!cite
:
subtitle
:
inproceedings
]
471
[
apa
:
\s!cite
:
title
:
inproceedings
]
472 473 474
\definebtx
475
[
apa
:
\s!cite
:
tag
]
476
[
apa
:
\s!cite
]
477
[
\c!left
=
{
[
}
,
478
\c!right
=
{
]
}
]
479 480
\definebtx
481
[
apa
:
\s!cite
:
index
]
482
[
apa
:
\s!cite
]
483
[
\c!left
=
{
[
}
,
484
\c!right
=
{
]
}
]
485 486
\definebtx
487
[
apa
:
\s!cite
:
page
]
488
[
apa
:
\s!cite
]
489
[
\c!left
=
,
490
\c!right
=
,
491
\c!separator
:
2
=
{
\btxcomma
}
,
% :0 and :1 - between items of a list
492
\c!separator
:
3
=
{
\btxcomma
\btxlabeltext
{
and
}
\space
}
,
% not \textampersand
493
\c!separator
:
4
=
{
\btxspace
\btxlabeltext
{
and
}
\space
}
]
% not \textampersand
494 495
\definebtx
496
[
apa
:
\s!cite
:
pages
]
497
[
apa
:
\s!cite
:
page
]
498 499
\definebtx
500
[
apa
:
\s!cite
:
keywords
]
501
[
apa
:
\s!cite
]
502 503
\definebtx
504
[
apa
:
\s!cite
:
short
]
505
[
apa
:
\s!cite
]
506
[
\c!left
=
{
[
}
,
507
\c!right
=
{
]
}
]
508 509
\definebtx
510
[
apa
:
\s!cite
:
category
]
511
[
apa
:
\s!cite
]
512 513
\definebtx
514
[
apa
:
\s!cite
:
url
]
515
[
apa
:
\s!cite
]
516
[
\c!left
=
{
(
}
,
517
\c!right
=
{
)
}
]
518 519
\definebtx
520
[
apa
:
\s!cite
:
doi
]
521
[
apa
:
\s!cite
:
url
]
522 523
\definebtx
524
[
apa
:
\s!cite
:
num
]
525
[
apa
:
\s!cite
]
526
[
\c!left
=
{
[
}
,
527
\c!right
=
{
]
}
,
528
\c!separator
:
2
=
{
,
}
,
% no space
529
\c!separator
:
3
=
\btxparameter
{
\c!separator
:
2
}
,
530
\c!separator
:
4
=
\btxparameter
{
\c!separator
:
2
}
]
531 532
\definebtx
533
[
apa
:
\s!cite
:
textnum
]
534
[
apa
:
\s!cite
:
num
]
535
[
\c!left
=
{
Ref
.
\nbsp
}
,
536
\c!right
=
,
537
\c!separator
:
2
=
{
\btxcomma
}
,
538
\c!separator
:
3
=
{
\btxspace
\btxlabeltext
{
and
}
\space
}
,
539
\c!separator
:
4
=
{
\btxspace
\btxlabeltext
{
and
}
\space
}
]
540 541
\definebtx
542
[
apa
:
\s!cite
:
entry
]
543
[
apa
:
\s!cite
]
544
[
\c!left
=
,
545
\c!right
=
,
546
\c!inbetween
=
{
\btxspace
}
,
547
\c!separator
:
2
=
{
\btxsemicolon
}
,
548
\c!separator
:
3
=
\btxparameter
{
\c!separator
:
2
}
,
549
\c!separator
:
4
=
\btxparameter
{
\c!separator
:
2
}
]
550 551
% Now we setup for the details of the renderings
552 553
%D Sometimes we have verbose injections in an entry and these can be language
554
%D dependent, so we use labels.
555
%D
556
%D Because we want to mix rendering (in the manual) we need a namespace in label
557
%D texts:
558 559
\setupbtxlabeltext
560
[
en
]
561
[
apa
:
number
=
{
No
.
}
,
562
apa
:
edition
=
{
ed
.
}
,
563
apa
:
Editor
=
{
Ed
.
}
,
564
apa
:
Editors
=
{
Eds
.
}
,
565
apa
:
Volume
=
{
Vol
.
}
,
566
apa
:
Volumes
=
{
Vols
.
}
,
567
apa
:
nd
=
{
n
.
d
.
}
,
% no date
568
apa
:
supplement
=
{
Suppl
.
}
,
% Supplement (not used?)
569
apa
:
MotionPicture
=
{
Motion
picture
}
,
570
apa
:
Writer
=
Writer
,
571
apa
:
Writers
=
Writers
,
572
apa
:
Producer
=
Producer
,
573
apa
:
Producers
=
Producers
,
574
apa
:
Director
=
Director
,
575
apa
:
Directors
=
Directors
,
576
apa
:
Recordedby
=
{
Recorded
by
}
,
577
apa
:
Author
=
Author
,
578
apa
:
Translator
=
{
Trans
.
}
,
% Translator(s)
579
apa
:
Advanced
=
{
Advanced
online
publication
}
,
580
apa
:
Retrieved
=
{
Retrieved
from
}
]
% {Available from}]
581 582
\setupbtxlabeltext
583
[
nl
]
584
[
apa
:
number
=
{
Nr
.
}
,
585
apa
:
edition
=
{
ed
.
}
,
% editie
586
apa
:
Editor
=
Editor
,
% Ed./Eds.
587
apa
:
Editors
=
Editors
,
588
apa
:
Volume
=
{
Vol
.
}
,
589
apa
:
Volumes
=
{
Vols
.
}
,
590
apa
:
nd
=
{
g
.
d
.
}
% geen datum
591
apa
:
supplement
=
Supplement
,
592
apa
:
MotionPicture
=
Film
,
% ?
593
apa
:
Writer
=
Scenarioschrijver
,
% ?
594
apa
:
Writers
=
Schrijvers
,
% ?
595
apa
:
Producer
=
Producent
,
% ?
596
apa
:
Producers
=
Producents
,
% ?
597
apa
:
Director
=
Directeur
,
598
apa
:
Directors
=
Directeurs
,
599
apa
:
Recordedby
=
{
Opgenomen
door
}
,
% ?
600
apa
:
Author
=
Auteur
,
601
apa
:
Translator
=
Vertaler
,
602
apa
:
Advanced
=
{
Geavanceerde
online
publicatie
}
,
603
apa
:
Retrieved
=
{
Ontvangen
van
}
]
% {Beschikbaar vanaf}]
604 605
\setupbtxlabeltext
606
[
fr
]
607
[
apa
:
number
=
{
N
\high
{
o
}}
,
608
apa
:
edition
=
{
édition
}
,
609
apa
:
Editor
=
Éditeur
,
610
apa
:
Editors
=
Éditeurs
,
611
apa
:
Volume
=
Volume
,
612
apa
:
Volumes
=
Volumes
,
613
apa
:
nd
=
{
s
.
d
.
}
,
% sans date
614
apa
:
supplement
=
Supplément
,
615
apa
:
MotionPicture
=
{
Film
cinématographique
}
,
616
apa
:
Writer
=
Scénariste
,
617
apa
:
Writers
=
Scénaristes
,
618
apa
:
Producer
=
Producteur
,
619
apa
:
Producers
=
Producteurs
,
620
apa
:
Director
=
Réalisateur
,
621
apa
:
Directors
=
Réalisateurs
,
622
apa
:
Recordedby
=
{
Enregistré
par
}
,
623
apa
:
Author
=
Auteur
,
624
apa
:
Translator
=
Traducteur
,
625
apa
:
Advanced
=
{
Publication
en
ligne
anticipée
}
,
626
apa
:
Retrieved
=
{
Téléchargé
de
}
]
% {Disponible à}]
627 628
\setupbtxlabeltext
629
[
de
]
630
[
apa
:
number
=
{
Nr
.
}
,
631
apa
:
edition
=
Auf
\/
lage
,
632
apa
:
Editor
=
Herausgeber
,
% Hrsg./Hg.
633
apa
:
Editors
=
Herausgeber
,
634
apa
:
Volume
=
Band
,
% Bd.
635
apa
:
Volumes
=
{
Bände
}
,
636
apa
:
nd
=
{
o
.
D
.
}
,
% ohne Datum (mostly: o.J. / ohne Jahr)
637
apa
:
supplement
=
{
Beilage
}
,
% Supplement
638
apa
:
MotionPicture
=
Kinofilm
,
% ?
639
apa
:
Writer
=
Drehbuchautor
,
% ?
640
apa
:
Writers
=
Schriftsteller
,
% ?
641
apa
:
Producer
=
Producer
,
% ?
642
apa
:
Producers
=
Produzenten
,
% ?
643
apa
:
Director
=
Director
,
% ?
644
apa
:
Directors
=
Directors
,
% ?
645
apa
:
Recordedby
=
{
per
Einschreiben
}
,
% ?
646
apa
:
Author
=
Autor
,
647
apa
:
Translator
=
{
Übersetzer
}
,
% Übers.
648
apa
:
Advanced
=
{
Erweiterte
Online
-
Publikation
}
,
649
apa
:
Retrieved
=
{
heruntergeladen
von
}
]
650 651
% thanks: Andrea Valle
652 653
\setupbtxlabeltext
654
[
it
]
655
[
apa
:
number
=
{
}
,
656
apa
:
edition
=
{
ed
.
}
,
% edizione
657
apa
:
Editor
=
{
A
cura
di
}
,
658
apa
:
Editors
=
{
A
cura
di
}
,
659
apa
:
Volume
=
{
Vol
.
}
,
% Volume
660
apa
:
Volumes
=
{
Vol
.
}
,
% Volumi
661
apa
:
nd
=
{
s
.
d
.
}
,
% senza data
662
apa
:
supplement
=
{
Supplemento
}
,
663
apa
:
MotionPicture
=
Film
,
% ?
664
apa
:
Writer
=
Sceneggiatore
,
% ?
665
apa
:
Writers
=
Scrittori
,
% ?
666
apa
:
Producer
=
Produttore
,
667
apa
:
Producers
=
Produttori
,
668
apa
:
Director
=
Direttore
,
669
apa
:
Directors
=
Direttori
,
670
apa
:
Recordedby
=
{
Registrato
da
}
,
671
apa
:
Author
=
Autore
,
672
apa
:
Translator
=
{
Trad
.
}
,
% Translator(s)
673
apa
:
Advanced
=
{
Pre
-
pubblicazione
on
line
}
,
674
apa
:
Retrieved
=
{
Accessible
online
}
]
675 676
\setupbtxlabeltext
677
[
es
]
678
[
apa
:
number
=
{
}
,
679
apa
:
edition
=
{
ed
.
}
,
% edición
680
apa
:
Editor
=
Editor
,
% Ed./Eds.
681
apa
:
Editors
=
Editores
,
682
apa
:
Volume
=
{
Vol
.
}
,
% Volumen
683
apa
:
Volumes
=
{
Vols
.
}
,
% Volúmenes
684
apa
:
nd
=
{
s
.
f
.
}
,
% sin fecha
685
apa
:
supplement
=
Suplemento
,
686
apa
:
MotionPicture
=
Cinematográfica
,
687
apa
:
Writer
=
Guionista
,
% ?
688
apa
:
Writers
=
Escritores
,
% ?
689
apa
:
Producer
=
Productor
,
690
apa
:
Producers
=
Productores
,
691
apa
:
Director
=
Director
,
692
apa
:
Directors
=
Directores
,
693
apa
:
Recordedby
=
{
Grabada
por
}
,
694
apa
:
Author
=
Autor
,
695
apa
:
Translator
=
Traductor
,
696
apa
:
Advanced
=
{
Publicación
en
línea
avanzada
}
,
697
apa
:
Retrieved
=
{
Obtenido
de
}
]
% {Disponible desde}]
698 699 700
\setupbtxlabeltext
701
[
sv
]
702
[
apa
:
number
=
{
nr
.
}
,
703
apa
:
edition
=
{
Utgåva
}
,
704
apa
:
Editor
=
Redaktör
,
705
apa
:
Editors
=
Redaktörer
,
706
apa
:
Volume
=
Band
,
707
apa
:
Volumes
=
Band
,
708
apa
:
nd
=
{
u
.
å
.
}
,
% utan årtal
709
apa
:
supplement
=
Bilaga
,
% Supplement
710
apa
:
MotionPicture
=
Spelfilm
,
% ?
711
apa
:
Writer
=
{
Manusförfattare
}
,
% Assuming for a movie
712
apa
:
Writers
=
{
Manusförfattare
}
,
%
713
apa
:
Producer
=
Producent
,
% Assuming for a movie
714
apa
:
Producers
=
Producenter
,
%
715
apa
:
Director
=
{
Regissör
}
,
% Assuming for a movie
716
apa
:
Directors
=
{
Regissörer
}
,
%
717
apa
:
Recordedby
=
{
Inspelad
av
}
,
% Assuming for a movie
718
apa
:
Author
=
{
Författare
}
,
719
apa
:
Translator
=
{
Översättare
}
,
720
apa
:
Advanced
=
{
Avancerad
onlinepublikation
}
,
% ?
721
apa
:
Retrieved
=
{
Hämtad
från
}
]
722 723
% cite setups
724 725
% The following differs from the default returning n.d. if year is empty
726 727
\startsetups
btx
:
apa
:
cite
:
author
:
year
728
\ifx
\currentbtxfirst
\empty
729
\def
\currentbtxfirst
{
\fastsetup
{
\s!btx
:
apa
:
nd
}}
730
\fi
731
\fastsetup
{
\s!btx
:
\s!cite
:
author
:
year
}
732
\stopsetups
733 734
\startsetups
btx
:
apa
:
cite
:
author
:
years
735
\ifx
\currentbtxfirst
\empty
736
\def
\currentbtxfirst
{
\fastsetup
{
\s!btx
:
apa
:
nd
}}
737
\fi
738
\fastsetup
{
\s!btx
:
\s!cite
:
author
:
years
}
739
\stopsetups
740 741
% these setups need to be explicitly defined in order to get cite rendering
742 743
\startsetups
\s!btx
:
apa
:
\s!cite
:
organization
744
\fastsetup
{
\s!btx
:
\s!cite
:
normal
}
745
\stopsetups
746 747
\startsetups
\s!btx
:
apa
:
\s!cite
:
subtitle
748
\fastsetup
{
\s!btx
:
\s!cite
:
normal
}
749
\stopsetups
750 751
\startsetups
\s!btx
:
apa
:
\s!cite
:
booktitle
752
\fastsetup
{
\s!btx
:
\s!cite
:
normal
}
753
\stopsetups
754 755
\startsetups
\s!btx
:
apa
:
\s!cite
:
subbooktitle
756
\fastsetup
{
\s!btx
:
\s!cite
:
normal
}
757
\stopsetups
758 759
% are these needed?
760 761
\startsetups
\s!btx
:
apa
:
\s!cite
:
title
:
inbook
762
\fastsetup
{
\s!btx
:
\s!cite
:
normal
}
763
\stopsetups
764 765
\startsetups
\s!btx
:
apa
:
\s!cite
:
title
:
incollection
766
\fastsetup
{
\s!btx
:
\s!cite
:
normal
}
767
\stopsetups
768 769
\startsetups
\s!btx
:
apa
:
\s!cite
:
title
:
inproceedings
770
\fastsetup
{
\s!btx
:
\s!cite
:
normal
}
771
\stopsetups
772 773
\startsetups
\s!btx
:
apa
:
\s!cite
:
subtitle
:
inbook
774
\fastsetup
{
\s!btx
:
\s!cite
:
normal
}
775
\stopsetups
776 777
\startsetups
\s!btx
:
apa
:
\s!cite
:
subtitle
:
incollection
778
\fastsetup
{
\s!btx
:
\s!cite
:
normal
}
779
\stopsetups
780 781
\startsetups
\s!btx
:
apa
:
\s!cite
:
subtitle
:
inproceedings
782
\fastsetup
{
\s!btx
:
\s!cite
:
normal
}
783
\stopsetups
784 785
% used in publ-imp-page.mkvi
786 787
\startsetups
btx
:
apa
:
list
:
page
-
or
-
pages
788
\ifx
\currentbtxlastpage
\empty
789
\btxlabeltext
{
p
}
790
\else
791
\btxlabeltext
{
pp
}
792
\fi
793
\btxnbsp
794
\stopsetups
795 796
% The sameauthor feature may not be APA compliant
797
% (there is nothing in the manual cited above).
798
% It can be removed using the command:
799
% \resetsetups [apa:list:sameauthor]
800 801
% :rule, :empty or :ditto ...
802 803
\startsetups
apa
:
list
:
sameauthor
804
\fastsetup
{
apa
:
list
:
sameauthor
:
rule
}
805
\stopsetups
806 807
\startsetups
apa
:
list
:
sameauthor
:
rule
808
\blackrule
809
[
\c!width
=
\dimexpr
\listparameter
\c!margin
-
\interwordspace
\relax
,
810
\c!height
=
1
.
5
\linewidth
]
% \linewidth is just too thin with respect to font strokes...
811
\stopsetups
812 813
\startsetups
[
apa
:
list
:
sameauthor
:
\v!empty
]
814
\kern\dimexpr
\listparameter
\c!margin
-
\interwordspace
\relax
815
\stopsetups
816 817
% horrible !
818 819
\startsetups
apa
:
list
:
sameauthor
:
ditto
820
\inframed
821
[
\c!width
=
\dimexpr
\listparameter
\c!margin
-
\interwordspace
\relax
,
822
\c!frame
=
\v!off
,
823
\c!align
=
\v!middle
]
824
{
\doubleprime
}
825
\stopsetups
826 827
%D Instead of texdefinitions without arguments, we could have used setups but in my
828
%D editor (hh, scite) the commands stand out better. It also saves an additional
829
%D component in the name (e.g. common:) because commands and setups have a different
830
%D namespace, so similar calls don't clash. Performance of definitions is somewhat
831
%D better.
832 833
%D We use "texdefinitions" (with eventual arguments) for helpers that are used
834
%D in the rendering "setups" defined for each category below.
835 836
%D Note that \btxdoif... and \btxflush rely on the definitions in
837
%D publ-imp-apa.lua: fields that are not listed as required nor optional are
838
%D IGNORED. We also make heavy use of the notion of sets - comma-separated lists
839
%D of alternative fields to be used in hierarchal order. For example:
840
%D author = { "author", "editor", "publisher", "title" }, will return the
841
%D author field if it exists; if not, the editor field will be returned, if it
842
%D exists; if not, the publisher field will be returned, if it exists; if not,
843
%D the title field will be returned, it it exists; if not, nothing will be
844
%D returned. In lua syntax, it can be understood as
845
%D author or editor or publisher or title or ""
846 847
% #title can be title or booktitle
848 849
\starttexdefinition
unexpanded
btx
:
apa
:
translated
-
title
#
title
850
\ifx
\currentbtxlanguage
\empty
851
% no need for an extra
852
\else\ifx
\mainbtxlanguage
\currentbtxlanguage
853
% no need for an extra
854
\else
855
\btxdoif
{
#
title
:
\mainbtxlanguage
}
{
856
\begingroup
857
\language
[
\mainbtxlanguage
]
858
\btxleftbracket
859
\btxusecommand
[
apa
:
\s!list
:
#
title
:
\currentbtxcategory
]
{
860
\btxflush
{
#
title
:
\mainbtxlanguage
}
861
}
862
\btxrightbracket
863
\endgroup
864
}
865
\fi\fi
866
\stoptexdefinition
867 868
\starttexdefinition
unexpanded
btx
:
apa
:
composed
-
title
#
title
869
\btxstartstyleandcolor
[
apa
:
\s!list
:
#
title
:
\currentbtxcategory
]
870
\begingroup
871
\language
[
\currentbtxlanguage
]
872
\btxusecommand
[
apa
:
\s!list
:
#
title
:
\currentbtxcategory
]
{
873
\btxflush
{
#
title
}
874
\btxdoif
{
sub
#
title
}
{
875
\btxcolon
876
\btxflush
{
sub
#
title
}
877
}
878
}
879
\endgroup
880
% which namespace?
881
%\doif{\btxparameter{translate}}\v!yes {
882
\texdefinition
{
btx
:
apa
:
translated
-
title
}{
#
title
}
883
%}
884
\btxstopstyleandcolor
885
\stoptexdefinition
886 887
\starttexdefinition
unexpanded
btx
:
apa
:
title
888
\setmode
{
btx
:
apa
:
title
-
placed
}
889
% we make the title active, opening "file"
890
\btxdoifelse
{
file
}
{
891
\texdefinition
{
btx
:
format
:
inject
}
892
{
url
(
file
:
\btxflush
{
file
}
)
}
893
{
894
\texdefinition
{
btx
:
apa
:
composed
-
title
}{
title
}
895
}
896
}
{
897
\texdefinition
{
btx
:
apa
:
composed
-
title
}{
title
}
898
}
899
\btxdoif
{
title
}
{
900
% A book might have an editor AND an author
901
\doif
{
\currentbtxcategory
}
{
book
}
{
902
\doifnot
{
\btxfoundname
{
author
}}
{
editor
}
{
903
\btxdoif
{
ineditor
}
{
% ineditor specific authorconversion
904
\btxleftparenthesis
905
\btxflush
{
ineditor
}
906
\btxcomma
907
\btxsingularorplural
{
ineditor
}
{
908
\btxlabeltext
{
apa
:
Editor
}
909
}
{
910
\btxlabeltext
{
apa
:
Editors
}
911
}
912
\btxrightparenthesis
913
}
914
}
915
}
916
\btxdoif
{
translator
}
{
917
\btxleftparenthesis
918
\btxflush
{
translator
}
919
\btxcomma
920
\btxlabeltext
{
apa
:
Translator
}
921
\btxrightparenthesis
922
}
923
\btxperiod
924
% TODO: this period may NOT be wanted, as in: Title (2nd ed.).
925
}
926
\stoptexdefinition
927 928
\starttexdefinition
unexpanded
btx
:
apa
:
title
-
if
-
not
-
placed
929
\doifelsemode
{
btx
:
apa
:
title
-
placed
}
{
930
\resetmode
{
btx
:
apa
:
title
-
placed
}
931
}
{
932
\btxdoif
{
title
}
{
933
\btxspace
934
\texdefinition
{
btx
:
apa
:
title
}
935
}
936
}
937
\stoptexdefinition
938 939
\startsetups
btx
:
apa
:
nd
940
\btxlabeltext
{
apa
:
nd
}
941
\stopsetups
942 943
\starttexdefinition
unexpanded
btx
:
apa
:
suffixedyear
944
\btxdoifelse
{
year
}
{
945
\btxflush
{
year
}
946
\btxflushsuffix
947
\btxdoif
{
month
}
{
% month and day optional in publ-imp-apa.lua
948
\btxcomma
949
\btxflush
{
month
}
950
\btxdoif
{
day
}
{
951
\btxspace
952
\btxflush
{
day
}
953
}
954
}
955
}
{
956
\fastsetup
{
btx
:
apa
:
nd
}
957
% Hans: the following won't work but should.
958
\btxdoif
{
suffix
}
{
959
\btxspace
960
\btxflushsuffix
961
% Hans: similarly, why can't \btxflush{suffix} be made to work?
962
}
963
}
964
\stoptexdefinition
965 966
% #author may be author(set) or editor
967 968
\starttexdefinition
unexpanded
btx
:
apa
:
author
-
or
-
editor
#
author
969
\btxdoifelse
{
#
author
}
{
970
\btxstartstyleandcolor
[
apa
:
\s!list
:
#
author
]
971
\btxusecommand
[
apa
:
\s!list
:
#
author
]
{
972
\btxflush
{
#
author
}
973
}
974
\btxstopstyleandcolor
975
% use \processaction [] [] here?
976
\doifelse
{
\btxfoundname
{
#
author
}}
{
editor
}
{
977
\btxleftparenthesis
978
\btxsingularorplural
{
editor
}
{
979
\btxlabeltext
{
apa
:
Editor
}
980
}
{
981
\btxlabeltext
{
apa
:
Editors
}
982
}
983
\btxrightparenthesis
984
}
{
\doif
{
\btxfoundname
{
#
author
}}
{
ineditor
}
{
985
\btxleftparenthesis
986
\btxsingularorplural
{
ineditor
}
{
987
\btxlabeltext
{
apa
:
Editor
}
988
}
{
989
\btxlabeltext
{
apa
:
Editors
}
990
}
991
\btxrightparenthesis
992
}
}
993
\doif
{
\currentbtxcategory
}
{
film
}
{
994
\btxleftparenthesis
995
\doifelse
{
\btxfoundname
{
#
author
}}
{
director
}
{
996
\btxsingularorplural
{
director
}
{
997
\btxlabeltext
{
apa
:
Director
}
998
}
{
999
\btxlabeltext
{
apa
:
Directors
}
1000
}
1001
}
{
1002
\doif
{
\btxfoundname
{
#
author
}}
{
author
}
{
1003
\btxsingularorplural
{
author
}
{
1004
\btxlabeltext
{
apa
:
Writer
}
1005
}
{
1006
\btxlabeltext
{
apa
:
Writers
}
1007
}
1008
}
1009
\doif
{
\btxfoundname
{
#
author
}}
{
producer
}
{
1010
\btxsingularorplural
{
producer
}
{
1011
\btxlabeltext
{
apa
:
Producer
}
1012
}
{
1013
\btxlabeltext
{
apa
:
Producers
}
1014
}
1015
}
1016
\btxdoif
{
director
}
{
1017
\btxrightparenthesis
1018
\removeunwantedspaces
1019
\btxparameter
{
\c!separator
:
names
:
3
}
1020
\btxstartstyleandcolor
[
apa
:
\s!list
:
director
]
1021
\btxusecommand
[
apa
:
\s!list
:
director
]
{
1022
\btxflush
{
director
}
1023
}
1024
\btxstopstyleandcolor
1025
\btxleftparenthesis
1026
\btxsingularorplural
{
director
}
{
1027
\btxlabeltext
{
apa
:
Director
}
1028
}
{
1029
\btxlabeltext
{
apa
:
Directors
}
1030
}
1031
}
1032
}
1033
\btxrightparenthesis
1034
}
1035
\btxdoif
{
withauthor
}
{
1036
\btxleftparenthesis
1037
\btxlabeltext
{
with
}
1038
\btxspace
1039
\btxstartstyleandcolor
[
apa
:
\s!list
:
withauthor
]
1040
\btxusecommand
[
apa
:
\s!list
:
withauthor
]
{
1041
\btxflush
{
withauthor
}
1042
}
1043
\btxstopstyleandcolor
1044
\btxrightparenthesis
1045
}
1046
}
{
1047
\texdefinition
{
btx
:
apa
:
title
}
1048
}
1049
\stoptexdefinition
1050 1051
\starttexdefinition
unexpanded
btx
:
apa
:
authoryear
1052
% we make the authoryear active, pointing to the citation
1053
\texdefinition
{
btx
:
format
:
inject
}
1054
{
internal
(
\currentbtxinternal
)
}
1055
{
1056
\doifelsesetups
{
apa
:
list
:
sameauthor
}
{
1057
\btxdoifelsesameasprevious
{
author
}
{
1058
\fastsetup
{
apa
:
list
:
sameauthor
}
1059
}
{
1060
\texdefinition
{
btx
:
apa
:
author
-
or
-
editor
}
{
author
}
1061
}
1062
}
{
1063
\texdefinition
{
btx
:
apa
:
author
-
or
-
editor
}
{
author
}
1064
}
1065
\btxleftparenthesis
1066
\texdefinition
{
btx
:
apa
:
suffixedyear
}
1067
\btxrightparenthesis
1068
}
1069
% outside of interaction
1070
\btxperiod
1071
\doif
{
\btxfoundname
{
author
}}
{
title
}
{
1072
\setmode
{
btx
:
apa
:
title
-
placed
}
1073
}
1074
\stoptexdefinition
1075 1076
\starttexdefinition
unexpanded
btx
:
apa
:
editor
-
in
1077
\btxdoif
{
booktitle
}
{
1078
\btxlabeltext
{
In
}
1079
\btxspace
1080
\doifnot
{
\btxfoundname
{
author
}}
{
editor
}
{
1081
\texdefinition
{
btx
:
apa
:
author
-
or
-
editor
}
{
ineditor
}
1082
\btxcomma
1083
}
1084
\texdefinition
{
btx
:
apa
:
composed
-
title
}{
booktitle
}
1085
\btxperiod
1086
}
1087
\stoptexdefinition
1088 1089
\starttexdefinition
unexpanded
btx
:
apa
:
organization
-
if
-
not
-
author
1090
\btxdoif
{
organization
}
{
1091
\doifnot
{
\btxfoundname
{
author
}}
{
organization
}
{
1092
\btxspace
1093
\btxflush
{
organization
}
1094
\btxcomma
1095
}
1096
}
1097
\stoptexdefinition
1098 1099
% TODO: The title is terminated with period. However,
1100
% we probably don't want this before the parenthesis.
1101 1102
\starttexdefinition
unexpanded
btx
:
apa
:
leftparenthesis
-
or
-
comma
1103
\doifelsemode
{
btx
:
apa
:
editionset
-
is
-
empty
}
{
1104
\btxleftparenthesis
1105
\resetmode
{
btx
:
apa
:
editionset
-
is
-
empty
}
1106
}
{
1107
\btxcomma
1108
}
1109
\stoptexdefinition
1110 1111
\starttexdefinition
unexpanded
btx
:
apa
:
editionset
1112
\setmode
{
btx
:
apa
:
editionset
-
is
-
empty
}
1113
\doif
{
\currentbtxcategory
}
{
techreport
}
{
1114
\texdefinition
{
btx
:
apa
:
leftparenthesis
-
or
-
comma
}
1115
\btxdoifelse
{
type
}
{
1116
\btxusecommand
[
apa
:
\s!list
:
type
]
{
1117
\btxflush
{
type
}
1118
}
1119
}
{
1120
\btxlabeltext
{
technicalreport
}
1121
}
1122
}
1123
\btxdoif
{
volume
}
{
1124
\texdefinition
{
btx
:
apa
:
leftparenthesis
-
or
-
comma
}
1125
\btxoneorrange
{
volume
}
{
1126
\btxlabeltext
{
apa
:
Volume
}
1127
}
{
1128
\btxlabeltext
{
apa
:
Volumes
}
1129
}
1130
\btxspace
1131
\btxflush
{
volume
}
1132
}
1133
\btxdoif
{
number
}
{
1134
\texdefinition
{
btx
:
apa
:
leftparenthesis
-
or
-
comma
}
1135
\btxlabeltext
{
apa
:
number
}
1136
\btxspace
1137
\btxflush
{
number
}
1138
}
1139
\btxdoif
{
edition
}
{
1140
\texdefinition
{
btx
:
apa
:
leftparenthesis
-
or
-
comma
}
1141
\btxflush
{
edition
}
1142
\btxspace
1143
\btxlabeltext
{
apa
:
edition
}
1144
}
1145
\btxdoif
{
pages
}
{
1146
\texdefinition
{
btx
:
apa
:
leftparenthesis
-
or
-
comma
}
1147
\btxoneorrange
{
pages
}
{
1148
\btxlabeltext
{
p
}
1149
}
{
1150
\btxlabeltext
{
pp
}
1151
}
1152
\btxnbsp
1153
\btxflush
{
pages
}
1154
}
1155
\doifnotmode
{
btx
:
apa
:
editionset
-
is
-
empty
}
{
1156
\btxrightparenthesisperiod
1157
}
1158
\stoptexdefinition
1159 1160
\starttexdefinition
unexpanded
btx
:
apa
:
journal
1161
\btxstartstyleandcolor
[
apa
:
\s!list
:
journal
]
1162
\btxusecommand
[
apa
:
\s!list
:
journal
]
{
1163
\btxflush
{
journal
}
1164
}
1165
\btxstopstyleandcolor
1166
\stoptexdefinition
1167 1168
\starttexdefinition
unexpanded
btx
:
apa
:
volume
1169
\btxstartstyleandcolor
[
apa
:
\s!list
:
volume
]
1170
\btxflush
{
volume
}
1171
\btxstopstyleandcolor
1172
\stoptexdefinition
1173 1174
% this could be simplified!
1175 1176
\starttexdefinition
unexpanded
btx
:
apa
:
journal
-
volume
-
number
-
pages
1177
\btxdoif
{
journal
}
{
1178
\btxspace
1179
\texdefinition
{
btx
:
apa
:
journal
}
1180
\btxdoifelse
{
volume
}
{
1181
\btxcomma
1182
\texdefinition
{
btx
:
apa
:
volume
}
1183
\btxdoif
{
number
}
{
1184
%\btxleftparenthesis
1185
(
\btxflush
{
number
}
1186
\btxrightparenthesis
1187
}
1188
}
{
1189
\btxdoif
{
number
}
{
1190
\btxcomma
1191
\btxleftparenthesis
1192
\btxflush
{
number
}
1193
\btxrightparenthesis
1194
}
1195
}
1196
\btxdoif
{
pages
}
{
1197
\btxcomma
1198
\doif
{
\currentbtxcategory
}
{
newspaper
}
{
1199
\btxoneorrange
{
pages
}
{
1200
\btxlabeltext
{
p
}
1201
}
{
1202
\btxlabeltext
{
pp
}
1203
}
1204
\btxnbsp
1205
}
1206
\btxflush
{
pages
}
1207
}
1208
\btxperiod
1209
\doifnot
{
\currentbtxcategory
}
{
newspaper
}
{
1210
\btxdoifnot
{
volume
}
{
1211
\btxdoifnot
{
number
}
{
1212
\btxdoifnot
{
pages
}
{
1213
\btxdoif
{
doi
}
{
%set: doi or url
1214
\btxspace
1215
\btxlabeltext
{
apa
:
Advanced
}
1216
\btxperiod
1217
}
1218
}
1219
}
1220
}
1221
}
1222
}
1223
\stoptexdefinition
1224 1225
\starttexdefinition
unexpanded
btx
:
apa
:
wherefrom
-
publisher
1226
\btxdoifelse
{
address
}
{
1227
\btxflush
{
address
}
1228
\btxdoif
{
country
}
{
1229
\btxcomma
1230
\btxflush
{
country
}
1231
}
1232
\btxcolon
1233
}
{
1234
\btxdoif
{
country
}
{
1235
\btxflush
{
country
}
1236
\btxcolon
1237
}
1238
}
1239
\doifelse
{
\btxfoundname
{
author
}}
{
\btxfoundname
{
publisher
}}
{
1240
\btxlabeltext
{
apa
:
Author
}
1241
}
{
1242
\btxdoifelse
{
publisher
}
{
1243
\btxflush
{
publisher
}
1244
}
{
1245
\btxlabeltext
{
apa
:
Author
}
1246
}
1247
}
1248
\btxperiod
1249
\stoptexdefinition
1250 1251
\definebreakpoints
[
doi
]
1252
\definebreakpoint
[
doi
][
:
][
nleft
=
3
,
type
=
1
]
1253
\definebreakpoint
[
doi
][
/
][
nleft
=
3
,
type
=
1
]
1254
\definebreakpoint
[
doi
][
-
][
nleft
=
3
,
type
=
1
]
1255
\definebreakpoint
[
doi
][
.
][
nleft
=
3
,
type
=
1
]
1256 1257
% use \btxentry here?
1258 1259
\starttexdefinition
unexpanded
btx
:
apa
:
url
1260
\begingroup
1261
\setbreakpoints
[
doi
]
1262
\ifconditional
\btxinteractive
1263
\goto
{
1264
\hyphenatedurl
{
\btxflush
{
url
}}
1265
}
[
1266
url
(
\btxflush
{
url
}
)
1267
]
1268
\else
1269
\hyphenatedurl
{
\btxflush
{
url
}}
1270
\fi
1271
\endgroup
1272
\stoptexdefinition
1273 1274
% use \btxentry here?
1275 1276
\starttexdefinition
unexpanded
btx
:
apa
:
doi
1277
\begingroup
1278
\setbreakpoints
[
doi
]
1279
\ifconditional
\btxinteractive
1280
\goto
{
1281
\hyphenatedurl
{
doi
:
\btxflush
{
doi
}}
1282
}
[
1283
url
(
http
:
//
dx
.
doi
.
org
/
\btxflush
{
doi
}
)
1284
]
1285
\else
1286
\hyphenatedurl
{
doi
:
\btxflush
{
doi
}}
1287
\fi
1288
\endgroup
1289
\stoptexdefinition
1290 1291
\starttexdefinition
unexpanded
btx
:
apa
:
note
1292
\btxdoif
{
note
}
{
1293
\btxleftparenthesis
1294
\btxflush
{
note
}
1295
\btxrightparenthesis
1296
}
1297
\stoptexdefinition
1298 1299
\starttexdefinition
unexpanded
btx
:
apa
:
url
-
doi
-
note
1300
\doif
{
\btxfoundname
{
doi
}}
{
url
}
{
1301
\btxspace
1302
\btxlabeltext
{
apa
:
Retrieved
}
1303
\btxspace
1304
\texdefinition
{
btx
:
apa
:
url
}
1305
}
1306
\doif
{
\btxfoundname
{
doi
}}
{
doi
}
{
1307
\btxspace
1308
\texdefinition
{
btx
:
apa
:
doi
}
1309
}
1310
\texdefinition
{
btx
:
apa
:
note
}
1311
\removeunwantedspaces
1312
\stoptexdefinition
1313 1314
\starttexdefinition
unexpanded
btx
:
apa
:
type
1315
\btxdoif
{
type
}
{
1316
\btxleftbracket
1317
\btxflush
{
type
}
1318
\btxrightbracketperiod
1319
}
1320
\stoptexdefinition
1321 1322
% Then setups, by category
1323 1324
% An article from a journal
1325
% Required fields: author or organization or editor or title, journal, (year).
1326
% Optional fields: volume, number, pages, type, doi, url, note.
1327
% Note that bibtex (and tools) do not include editor (e.g. special issue or section)
1328 1329
\startsetups
btx
:
apa
:
list
:
article
1330
\texdefinition
{
btx
:
apa
:
authoryear
}
1331
\texdefinition
{
btx
:
apa
:
title
-
if
-
not
-
placed
}
1332
\texdefinition
{
btx
:
apa
:
type
}
1333
\texdefinition
{
btx
:
apa
:
journal
-
volume
-
number
-
pages
}
1334
\texdefinition
{
btx
:
apa
:
url
-
doi
-
note
}
1335
\stopsetups
1336 1337
% An article from a magazine.
1338
% Required fields: author or title, journal, (year).
1339
% Optional fields: number, pages, type, month, day, doi, url, note.
1340 1341
\startsetups
btx
:
apa
:
list
:
magazine
1342
\fastsetup
{
btx
:
apa
:
list
:
article
}
1343
\stopsetups
1344 1345
% An article from a newspaper.
1346
% Required fields: author or title, journal, (year).
1347
% Optional fields: volume, number, pages, type, month, day, doi, url, note.
1348 1349
\startsetups
btx
:
apa
:
list
:
newspaper
1350
\fastsetup
{
btx
:
apa
:
list
:
article
}
1351
\stopsetups
1352 1353
% A complete issue of a periodical, such as a special issue of a journal.
1354
% Required fields: title, year
1355
% Optional fields: editor, publisher, subtitle, series, volume, number, month, organization, doi, url, issn, note
1356 1357
% needs to be tuned...
1358 1359
\startsetups
btx
:
apa
:
list
:
periodical
1360
\fastsetup
{
btx
:
apa
:
list
:
article
}
1361
\stopsetups
1362 1363
% National and international standards issued by a standards body
1364
% Required fields: author, institution, or organization, year, title
1365
% Optional fields: subtitle, doi, url, note
1366 1367
\startsetups
btx
:
apa
:
list
:
standard
1368
\texdefinition
{
btx
:
apa
:
authoryear
}
1369
\texdefinition
{
btx
:
apa
:
title
-
if
-
not
-
placed
}
1370
\texdefinition
{
btx
:
apa
:
url
-
doi
-
note
}
1371
\stopsetups
1372 1373
% A book with an explicit publisher.
1374
% Required fields: author or editor or publisher, title, (year).
1375
% Optional fields: volume or number, series, address, edition, month, day, note.
1376
% APA ignores: month, day
1377 1378
% todo: series?
1379 1380
\startsetups
btx
:
apa
:
list
:
book
1381
\texdefinition
{
btx
:
apa
:
authoryear
}
1382
\texdefinition
{
btx
:
apa
:
title
-
if
-
not
-
placed
}
1383
\texdefinition
{
btx
:
apa
:
type
}
1384
\texdefinition
{
btx
:
apa
:
editionset
}
1385
\texdefinition
{
btx
:
apa
:
wherefrom
-
publisher
}
1386
\texdefinition
{
btx
:
apa
:
url
-
doi
-
note
}
1387
\stopsetups
1388 1389
% There is some debate about how inbook should differ from incollection
1390 1391
% A part of a book, which may be a chapter (or section or whatever) and/or a range of pages.
1392
% (note that inbook is handled differently by bibtex and biblatex)
1393
% Required fields: author or editor, title, chapter and/or pages, publisher, year.
1394
% Optional fields: volume or number, series, type, address, edition, month, note.
1395
% We add optional: booktitle.
1396
% APA ignores: chapter, month
1397 1398
\startsetups
btx
:
apa
:
list
:
inbook
1399
\texdefinition
{
btx
:
apa
:
authoryear
}
1400
\texdefinition
{
btx
:
apa
:
title
-
if
-
not
-
placed
}
1401
\texdefinition
{
btx
:
apa
:
type
}
1402
\texdefinition
{
btx
:
apa
:
editor
-
in
}
1403
\texdefinition
{
btx
:
apa
:
editionset
}
1404
\texdefinition
{
btx
:
apa
:
wherefrom
-
publisher
}
1405
\texdefinition
{
btx
:
apa
:
url
-
doi
-
note
}
1406
\stopsetups
1407 1408
% A part of a book having its own title.
1409
% Required fields: author, title, booktitle, publisher, year.
1410
% Optional fields: editor, volume or number, series, type, chapter, pages, address, edition, month, note.
1411
% APA ignores: chapter, month
1412 1413
\startsetups
btx
:
apa
:
list
:
incollection
1414
\fastsetup
{
btx
:
apa
:
list
:
inbook
}
1415
\stopsetups
1416 1417
% The proceedings of a conference.
1418
% Required fields: title, year.
1419
% Optional fields: editor, volume or number, series, address, month, organization, publisher, note.
1420
% todo: series?
1421 1422
\startsetups
btx
:
apa
:
list
:
proceedings
1423
\fastsetup
{
btx
:
apa
:
list
:
book
}
1424
\stopsetups
1425 1426
% An article in a conference proceedings.
1427
% Required fields: author, title, booktitle, year.
1428
% Optional fields: editor, volume or number, series, pages, address, month, organization, publisher, note.
1429 1430
\startsetups
btx
:
apa
:
list
:
inproceedings
1431
\texdefinition
{
btx
:
apa
:
authoryear
}
1432
\texdefinition
{
btx
:
apa
:
title
-
if
-
not
-
placed
}
1433
\texdefinition
{
btx
:
apa
:
editor
-
in
}
1434
\texdefinition
{
btx
:
apa
:
editionset
}
1435
\texdefinition
{
btx
:
apa
:
organization
-
if
-
not
-
author
}
1436
\texdefinition
{
btx
:
apa
:
wherefrom
-
publisher
}
1437
\texdefinition
{
btx
:
apa
:
url
-
doi
-
note
}
1438
\stopsetups
1439 1440
\startsetups
btx
:
apa
:
list
:
conference
1441
\fastsetup
{
btx
:
apa
:
list
:
inproceedings
}
1442
\stopsetups
1443 1444
% A thesis.
1445
% Required fields: author, title, school, year.
1446
% Optional fields: type, address, month, note.
1447 1448
\startsetups
btx
:
apa
:
list
:
thesis
1449
\texdefinition
{
btx
:
apa
:
authoryear
}
1450
\texdefinition
{
btx
:
apa
:
title
-
if
-
not
-
placed
}
1451
\btxleftparenthesis
1452
\btxdoifelse
{
type
}
{
1453
\btxusecommand
[
apa
:
\s!list
:
type
]
{
1454
\btxflush
{
type
}
1455
}
1456
}
{
1457
\btxlabeltext
{
\currentbtxcategory
}
1458
}
1459
\btxrightparenthesis
1460
\btxdoif
{
school
}
{
1461
\btxperiod
1462
\btxflush
{
school
}
1463
}
1464
\btxdoif
{
address
}
{
1465
\btxdoifelse
{
school
}
{
1466
\btxcomma
1467
}
{
1468
\btxperiod
1469
}
1470
\btxflush
{
address
}
1471
\btxdoif
{
country
}
{
1472
\btxcomma
1473
\btxflush
{
country
}
1474
}
1475
}
1476
\btxperiod
1477
\texdefinition
{
btx
:
apa
:
url
-
doi
-
note
}
1478
\stopsetups
1479 1480
\startsetups
btx
:
apa
:
list
:
phdthesis
1481
\fastsetup
{
btx
:
apa
:
list
:
thesis
}
1482
\stopsetups
1483 1484
\startsetups
btx
:
apa
:
list
:
mastersthesis
1485
\fastsetup
{
btx
:
apa
:
list
:
thesis
}
1486
\stopsetups
1487 1488
% A work that is printed and bound, but without a named publisher or sponsoring institution.
1489
% Required field: title.
1490
% Optional fields: author, howpublished, address, month, year, note.
1491 1492
\startsetups
btx
:
apa
:
list
:
booklet
1493
\fastsetup
{
btx
:
apa
:
list
:
book
}
1494
\stopsetups
1495 1496
% Technical documentation.
1497
% Required field: title.
1498
% Optional fields: author, organization, address, edition, month, year, note.
1499 1500
\startsetups
btx
:
apa
:
list
:
manual
1501
\fastsetup
{
btx
:
apa
:
list
:
book
}
1502
\stopsetups
1503 1504
% A report published by a school or other institution, usually numbered within a series.
1505
% Required fields: author, title, institution, year.
1506
% Optional fields: type, number, address, month, note.
1507 1508
\startsetups
btx
:
apa
:
list
:
techreport
1509
\fastsetup
{
btx
:
apa
:
list
:
book
}
1510
\stopsetups
1511 1512
% A document having an author and title, but not formally published.
1513
% Required fields: author, title, note.
1514
% Optional fields: month, year.
1515 1516
\startsetups
btx
:
apa
:
list
:
unpublished
1517
\fastsetup
{
btx
:
apa
:
list
:
book
}
1518
\stopsetups
1519 1520
% A patent. Note that this category was not defined with BIBTEX. Below from JabRef:
1521
% Required fields: nationality, number, year, yearfiled
1522
% Optional fields: author, title, assignee, address, type, number, day, dayfiled, month, monthfiled, note, url
1523
% Also optional: publisher
1524 1525
% todo: yearfiled, monthfiled, dayfiled
1526 1527
\startsetups
btx
:
apa
:
list
:
patent
1528
\texdefinition
{
btx
:
apa
:
authoryear
}
1529
\texdefinition
{
btx
:
apa
:
title
-
if
-
not
-
placed
}
1530
\begingroup
1531
\it
1532
\btxdoif
{
nationality
}
{
1533
\btxspace
1534
\btxflush
{
nationality
}
1535
}
1536
\btxspace
1537
\btxdoifelse
{
type
}{
1538
\btxflush
{
type
}
1539
}{
1540
\btxlabeltext
{
patent
}
1541
}
1542
\btxdoif
{
number
}
{
1543
\btxspace
1544
\btxlabeltext
{
apa
:
number
}
1545
\btxspace
1546
\btxflush
{
number
}
1547
}
1548
\btxperiod
1549
\italiccorrection
1550
\endgroup
1551
\texdefinition
{
btx
:
apa
:
wherefrom
-
publisher
}
1552
\texdefinition
{
btx
:
apa
:
url
}
1553
\texdefinition
{
btx
:
apa
:
note
}
1554
\stopsetups
1555 1556
% Electronic. Note that this category was not defined with BIBTEX. Below from JabRef:
1557
% Required fields: title
1558
% Optional fields: address, author, howpublished, month, note, organization, url, year, doi
1559
% Also optional: type
1560 1561
% Like Misc below but includes organization.
1562 1563
\startsetups
btx
:
apa
:
list
:
electronic
1564
\texdefinition
{
btx
:
apa
:
authoryear
}
1565
\texdefinition
{
btx
:
apa
:
title
-
if
-
not
-
placed
}
1566
\texdefinition
{
btx
:
apa
:
type
}
1567
\texdefinition
{
btx
:
apa
:
organization
-
if
-
not
-
author
}
1568
\btxdoif
{
howpublished
}
{
1569
\btxspace
1570
\btxflush
{
howpublished
}
1571
\btxperiod
1572
}
1573
\texdefinition
{
btx
:
apa
:
url
-
doi
-
note
}
1574
\stopsetups
1575 1576
% Film. Note that this category was not defined with BIBTEX.
1577
% Required fields: producer, director, title, year, address, publisher
1578
% Optional fields: subtitle, type, note, url, doi
1579 1580
\startsetups
btx
:
apa
:
list
:
film
1581
\texdefinition
{
btx
:
apa
:
authoryear
}
1582
\texdefinition
{
btx
:
apa
:
title
}
1583
\btxleftbracket
1584
\btxdoifelse
{
type
}
{
1585
\btxflush
{
type
}
1586
}
{
1587
\btxlabeltext
{
apa
:
MotionPicture
}
1588
}
1589
\btxrightbracketperiod
1590
\texdefinition
{
btx
:
apa
:
wherefrom
-
publisher
}
1591
\texdefinition
{
btx
:
apa
:
url
-
doi
-
note
}
1592
\stopsetups
1593 1594
% Music. Note that this category was not defined with BIBTEX.
1595
% Required fields: composer, artist, title, album, year, address, publisher
1596
% Optional fields: subtitle, type, note, url, doi
1597 1598
\startsetups
btx
:
apa
:
list
:
music
1599
\texdefinition
{
btx
:
apa
:
authoryear
}
1600
\texdefinition
{
btx
:
apa
:
title
-
if
-
not
-
placed
}
1601
\doifnot
{
\btxfoundname
{
author
}}
{
artist
}
{
1602
\btxdoif
{
artist
}
{
1603
\btxleftbracket
1604
\btxlabeltext
{
apa
:
Recordedby
}
1605
\btxspace
1606
\btxflush
{
artist
}
1607
\btxrightbracketperiod
1608
}
1609
}
1610
\doifnot
{
\btxfoundname
{
title
}}
{
album
}
{
1611
\btxdoif
{
album
}
{
1612
\btxlabeltext
{
In
}
1613
\btxspace
1614
\btxflush
{
album
}
1615
\btxperiod
1616
}
1617
}
1618
\texdefinition
{
btx
:
apa
:
type
}
1619
\texdefinition
{
btx
:
apa
:
wherefrom
-
publisher
}
1620
\texdefinition
{
btx
:
apa
:
url
-
doi
-
note
}
1621
\stopsetups
1622 1623
% Other. Note that this category was not defined with BIBTEX. Below from JabRef:
1624
% Required fields: author or title, year
1625
% Optional fields: note, doi, url
1626 1627
\startsetups
btx
:
apa
:
list
:
other
1628
\fastsetup
{
btx
:
apa
:
list
:
book
}
1629
\stopsetups
1630 1631
% Use this category when nothing else fits.
1632
% Required fields: none.
1633
% Optional fields: author, title, howpublished, month, year, note.
1634 1635
\startsetups
btx
:
apa
:
list
:
misc
1636
\texdefinition
{
btx
:
apa
:
authoryear
}
1637
\texdefinition
{
btx
:
apa
:
title
-
if
-
not
-
placed
}
1638
\btxdoif
{
howpublished
}
{
1639
\btxspace
1640
\btxflush
{
howpublished
}
1641
\btxperiod
1642
}
1643
\texdefinition
{
btx
:
apa
:
url
-
doi
-
note
}
1644
\stopsetups
1645 1646
% If all else fails to match:
1647 1648
\startsetups
btx
:
apa
:
list
:
literal
1649
%\btxleftparenthesis
1650
\removeunwantedspaces
(
1651
\btxflush
{
tag
}
1652
\btxrightparenthesis
1653
\btxdoif
{
text
}
{
1654
\btxflush
{
text
}
1655
}
1656
\stopsetups
1657 1658
% HH: an example of setting up translations using a sub rendering. Keep it here
1659
% till we find another spot as otherwise I forget about it and I don't want to
1660
% waste hours reinventing a wheel when something like this is needed.
1661
%
1662
% \definebtx
1663
% [apa:cite:title:translated]
1664
% [apa:cite:title]
1665
% [left=\btxleftbracket,
1666
% right=\btxrightbracket,
1667
% style=\v!bolditalic]
1668
%
1669
% \startsetups btx:apa:cite:title
1670
% % need to add concat, etc.
1671
% \btxcitereference
1672
% \currentbtxfirst
1673
% \doifmode {btx:apa:translatedtitles} {
1674
% \ifx\currentbtxlanguage\empty
1675
% % no need for an extra
1676
% \else\ifx\mainbtxlanguage\currentbtxlanguage
1677
% % no need for an extra
1678
% \else
1679
% \btxdoif {title:\mainbtxlanguage} {
1680
% \btxstartciterendering[title:translated]
1681
% \language[\mainbtxlanguage]
1682
% \btxflush{title:\mainbtxlanguage}
1683
% \btxstopciterendering
1684
% }
1685
% \fi\fi
1686
% }
1687
% \stopsetups
1688 1689
\stopbtxrenderingdefinitions
1690