publ-imp-aps.mkvi /size: 27 Kb    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=publ-imp-aps,
3
%D version=2015.03.22,
4
%D title=APS 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
[
aps
]
14 15
%D Reference:
16
%D \startTEX
17
%D @Book{APS2011,
18
%D title ={Physical Review Style and Notation Guide}
19
%D year ={2011},
20
%D month ={June}
21
%D edition ={Revised},
22
%D editor ={Waldron, A and Judd, P. and Miller, V.},
23
%D address ={Ridge, NY},
24
%D publisher={American Physical Society},
25
%D Xpages ={26},
26
%D url ={http://journals.aps.org/files/styleguide-pr.pdf}
27
%D }
28
%D \stopTEX
29 30
% set ALL specific APS compliant values
31 32
\definebtx
33
[
aps
]
34
[
\c!default
=
default
,
35
\c!specification
=
aps
,
36
\c!otherstext
=
{
\btxspace
{
\it
\btxlabeltext
{
others
}}}
,
37
\c!etallimit
=
1
0
,
38
\c!etaldisplay
=
\btxparameter
\c!etallimit
,
39
%c!journalconversion=\v!normal,
40
\c!monthconversion
=
\v!month
,
41
\c!title
=
\v!yes
,
42
\c!separator
:
names
:
2
=
{
\btxcomma
}
,
43
\c!separator
:
names
:
3
=
{
\btxcomma
\btxlabeltext
{
and
}
\space
}
,
44
\c!separator
:
names
:
4
=
{
\btxspace
\btxlabeltext
{
and
}
\space
}
]
45 46
% First, define and set list and rendering parameters
47 48
\definebtxrendering
49
[
aps
]
50
[
\c!specification
=
aps
,
51
\c!sorttype
=
\v!default
,
52
\c!numbering
=
num
]
53 54
\setupbtxlist
55
[
aps
]
56
[
\c!alternative
=
b
,
% spaces
57
\c!align
=
{
normal
,
verytolerant
,
stretch
}
]
58 59
\definebtx
60
[
aps
:
\s!list
]
61
[
aps
]
62
[
\c!authorconversion
=
normalshort
]
63 64
\definebtx
65
[
aps
:
\s!list
:
author
]
66
[
aps
:
\s!list
]
67 68
\definebtx
69
[
aps
:
\s!list
:
editor
]
70
[
aps
:
\s!list
:
author
]
71 72
\definebtx
73
[
aps
:
\s!list
:
suffix
]
74
[
aps
:
\s!list
]
75 76
\definebtx
77
[
aps
:
\s!list
:
url
]
78
[
aps
:
\s!list
]
79 80
\definebtx
81
[
aps
:
\s!list
:
doi
]
82
[
aps
:
\s!list
]
83 84
\definebtx
85
[
aps
:
\s!list
:
\s!page
]
86
[
aps
:
\s!list
]
87
[
\c!separator
:
2
=
{
\btxcomma
}
,
88
\c!separator
:
3
=
{
\btxcomma
\btxlabeltext
{
and
}
\space
}
,
89
\c!separator
:
4
=
{
\btxspace
\btxlabeltext
{
and
}
\space
}
,
90
\c!left
=
{
\btxleftparenthesis
}
,
91
\c!right
=
{
\btxrightparenthesis
}
,
92
\c!command
=
{
\wordright
}
]
93 94
\definebtx
95
[
aps
:
\s!list
:
numbering
]
96
[
aps
:
\s!list
]
97
[
left
=
{
[
}
,
98
right
=
{
]
}
]
99 100
\definebtx
101
[
aps
:
\s!list
:
numbering
:
default
]
102
[
aps
:
\s!list
:
numbering
]
103 104
\definebtx
105
[
aps
:
\s!list
:
numbering
:
num
]
106
[
aps
:
\s!list
:
numbering
]
107 108
\definebtx
109
[
aps
:
\s!list
:
numbering
:
short
]
110
[
aps
:
\s!list
:
numbering
]
111 112
\definebtx
113
[
aps
:
\s!list
:
numbering
:
tag
]
114
[
aps
:
\s!list
:
numbering
]
115 116
\definebtx
117
[
aps
:
\s!list
:
numbering
:
index
]
118
[
aps
:
\s!list
:
numbering
]
119 120
%D In order to be able to get journals expanded (or normalized or abbreviated) you need
121
%D to load a list:
122
%D
123
%D \starttyping
124
%D \btxloadjournallist[journals.txt] % the jabref list
125
%D \stoptyping
126 127
% TODO
128 129
\definebtx
130
[
aps
:
\s!list
:
journal
]
131
[
aps
:
\s!list
]
132
[
\c!style
=
\v!italic
]
133
%command=\btxexpandedjournal] % btxabbreviatedjournal
134 135
\definebtx
136
[
aps
:
\s!list
:
volume
]
137
[
aps
:
\s!list
]
138
[
\c!style
=
\v!bold
]
139 140
\definebtx
141
[
aps
:
\s!list
:
title
]
142
[
aps
:
\s!list
]
143
[
\c!style
=
\v!italic
,
144
\c!command
=
\Word
]
145 146
\definebtx
147
[
aps
:
\s!list
:
title
:
article
]
148
[
aps
:
\s!list
:
title
]
149
[
\c!style
=]
% journal is set in italics
150 151
\definebtx
152
[
aps
:
\s!list
:
title
:
magazine
]
153
[
aps
:
\s!list
:
title
]
154 155
\definebtx
156
[
aps
:
\s!list
:
title
:
newspaper
]
157
[
aps
:
\s!list
:
title
]
158 159
\definebtx
160
[
aps
:
\s!list
:
title
:
periodical
]
161
[
aps
:
\s!list
:
title
]
162 163
\definebtx
164
[
aps
:
\s!list
:
title
:
standard
]
165
[
aps
:
\s!list
:
title
]
166 167
\definebtx
168
[
aps
:
\s!list
:
title
:
book
]
169
[
aps
:
\s!list
:
title
]
170 171
\definebtx
172
[
aps
:
\s!list
:
title
:
inbook
]
173
[
aps
:
\s!list
:
title
]
174 175
\definebtx
176
[
aps
:
\s!list
:
title
:
incollection
]
177
[
aps
:
\s!list
:
title
]
178
[
\c!style
=]
% booktitle is set in italics
179 180
\definebtx
181
[
aps
:
\s!list
:
title
:
proceedings
]
182
[
aps
:
\s!list
:
title
]
183 184
\definebtx
185
[
aps
:
\s!list
:
title
:
inproceedings
]
186
[
aps
:
\s!list
:
title
]
187
[
\c!style
=]
% booktitle is set in italics
188 189
\definebtx
190
[
aps
:
\s!list
:
title
:
conference
]
191
[
aps
:
\s!list
:
title
]
192
[
\c!style
=]
% booktitle is set in italics
193 194
\definebtx
195
[
aps
:
\s!list
:
title
:
thesis
]
196
[
aps
:
\s!list
:
title
]
197 198
\definebtx
199
[
aps
:
\s!list
:
title
:
phdthesis
]
200
[
aps
:
\s!list
:
title
]
201 202
\definebtx
203
[
aps
:
\s!list
:
title
:
mastersthesis
]
204
[
aps
:
\s!list
:
title
]
205 206
\definebtx
207
[
aps
:
\s!list
:
title
:
booklet
]
208
[
aps
:
\s!list
:
title
]
209 210
\definebtx
211
[
aps
:
\s!list
:
title
:
manual
]
212
[
aps
:
\s!list
:
title
]
213 214
\definebtx
215
[
aps
:
\s!list
:
title
:
techreport
]
216
[
aps
:
\s!list
:
title
]
217 218
\definebtx
219
[
aps
:
\s!list
:
title
:
unpublished
]
220
[
aps
:
\s!list
:
title
]
221 222
\definebtx
223
[
aps
:
\s!list
:
title
:
patent
]
224
[
aps
:
\s!list
:
title
]
225 226
\definebtx
227
[
aps
:
\s!list
:
title
:
electronic
]
228
[
aps
:
\s!list
:
title
]
229 230
\definebtx
231
[
aps
:
\s!list
:
title
:
other
]
232
[
aps
:
\s!list
:
title
]
233 234
\definebtx
235
[
aps
:
\s!list
:
title
:
misc
]
236
[
aps
:
\s!list
:
title
]
237 238
\definebtx
239
[
aps
:
\s!list
:
title
:
literal
]
240
[
aps
:
\s!list
:
title
]
241 242
\definebtx
243
[
aps
:
\s!list
:
type
]
244
[
\c!command
=
\Word
]
245 246
% Then define and set all cite parameters
247 248
\definebtx
249
[
aps
:
\s!cite
]
250
[
aps
]
251
[
\c!alternative
=
num
,
252
\c!authorconversion
=
\v!name
,
253
\c!compress
=
\v!yes
,
254
\c!sorttype
=
normal
]
255 256
\definebtx
257
[
aps
:
\s!cite
:
name
]
258
[
aps
:
\s!cite
]
259
[
\c!authorconversion
=
\v!name
]
260 261
\definebtx
262
[
aps
:
\s!cite
:
inverted
]
263
[
aps
:
\s!cite
]
264
[
\c!authorconversion
=
\v!invertedshort
]
265 266
\definebtx
267
[
aps
:
\s!cite
:
invertedshort
]
268
[
aps
:
\s!cite
]
269
[
\c!authorconversion
=
\v!invertedshort
]
270 271
\definebtx
272
[
aps
:
\s!cite
:
normalshort
]
273
[
aps
:
\s!cite
]
274
[
\c!authorconversion
=
\v!normalshort
]
275 276
\definebtx
277
[
aps
:
\s!cite
:
normal
]
278
[
aps
:
\s!cite
]
279
[
\c!authorconversion
=
\v!normal
]
280 281
\definebtx
282
[
aps
:
\s!cite
:
author
]
283
[
aps
:
\s!cite
]
284 285
\definebtx
286
[
aps
:
\s!cite
:
organization
]
287
[
aps
:
\s!cite
]
288 289
\definebtx
290
[
aps
:
\s!cite
:
authoryear
]
291
[
aps
:
\s!cite
:
author
]
292
[
\c!left
=
{
(
}
,
293
\c!right
=
{
)
}
,
294
\c!inbetween
=
{
\btxcomma
}
]
295 296
\definebtx
297
[
aps
:
\s!cite
:
authoryears
]
298
[
aps
:
\s!cite
:
authoryear
]
299
[
\c!left
=
,
300
\c!right
=
,
301
\c!inbetween
=
{
\btxspace
}
]
302 303
\definebtx
304
[
aps
:
\s!cite
:
authornum
]
305
[
aps
:
\s!cite
:
author
]
306
[
\c!left
=
{
(
}
,
307
\c!right
=
{
)
}
]
308 309
\definebtx
310
[
aps
:
\s!cite
:
author
:
num
]
% todo
311
[
aps
:
\s!cite
:
authornum
]
312
[
\c!left
=
{
\btxspace
[
}
,
313
\c!right
=
{
]
}
]
314 315
\definebtx
316
[
aps
:
\s!cite
:
author
:
year
]
% todo
317
[
aps
:
\s!cite
:
authoryear
]
318
[
\c!left
=
,
319
\c!right
=]
320 321
\definebtx
322
[
aps
:
\s!cite
:
author
:
years
]
% todo
323
[
aps
:
\s!cite
:
authoryears
]
324
[
\c!inbetween
=
,
325
\c!left
=
{
\btxspace
(
}
,
326
\c!right
=
{
)
}
]
327 328
\definebtx
329
[
aps
:
\s!cite
:
year
]
330
[
aps
:
\s!cite
]
331 332
\definebtx
333
[
aps
:
\s!cite
:
title
]
334
[
aps
:
\s!cite
]
335
[
\c!command
=
{
\language
[
\currentbtxlanguage
]
}
,
% BAH
336
\c!sorttype
=
none
,
337
\c!style
=
\v!italic
]
338 339
\definebtx
340
[
aps
:
\s!cite
:
booktitle
]
341
[
aps
:
\s!cite
:
title
]
342 343
\definebtx
344
[
aps
:
\s!cite
:
tag
]
345
[
aps
:
\s!cite
]
346
[
\c!left
=
{
[
}
,
347
\c!right
=
{
]
}
]
348 349
\definebtx
350
[
aps
:
\s!cite
:
index
]
351
[
aps
:
\s!cite
]
352
[
\c!left
=
{
[
}
,
353
\c!right
=
{
]
}
]
354 355
\definebtx
356
[
aps
:
\s!cite
:
page
]
357
[
aps
:
\s!cite
]
358
[
\c!left
=
,
359
\c!right
=
,
360
\c!separator
:
2
=
{
\btxcomma
}
,
% :0 and :1 - between items of a list
361
\c!separator
:
3
=
{
\btxcomma
\btxlabeltext
{
and
}
\space
}
,
362
\c!separator
:
4
=
{
\btxspace
\btxlabeltext
{
and
}
\space
}
]
363 364
\definebtx
365
[
aps
:
\s!cite
:
pages
]
366
[
aps
:
\s!cite
:
page
]
367 368
\definebtx
369
[
aps
:
\s!cite
:
keywords
]
370
[
aps
:
\s!cite
]
371
[
\c!left
=
{
(
}
,
372
\c!right
=
{
)
}
]
373 374
\definebtx
375
[
aps
:
\s!cite
:
short
]
376
[
aps
:
\s!cite
]
377
[
\c!left
=
{
[
}
,
378
\c!right
=
{
]
}
]
379 380
\definebtx
381
[
aps
:
\s!cite
:
category
]
382
[
aps
:
\s!cite
]
383 384
\definebtx
385
[
aps
:
\s!cite
:
url
]
386
[
aps
:
\s!cite
]
387
[
\c!left
=
{
(
}
,
388
\c!right
=
{
)
}
]
389 390
\definebtx
391
[
aps
:
\s!cite
:
doi
]
392
[
aps
:
\s!cite
:
url
]
393 394
\definebtx
395
[
aps
:
\s!cite
:
num
]
396
[
aps
:
\s!cite
]
397
[
\c!left
=
{
[
}
,
398
\c!right
=
{
]
}
,
399
%\c!left=, % TODO: PRB uses superscript references...
400
%\c!right=, % and after punctuation, PRA, C, D, E, and L are before!
401
%\c!command={\high},
402
\c!separator
:
2
=
{
\btxcommabreak
}
,
403
\c!separator
:
3
=
\btxparameter
{
\c!separator
:
2
}
,
404
\c!separator
:
4
=
\btxparameter
{
\c!separator
:
2
}
]
405 406
\definebtx
407
[
aps
:
\s!cite
:
default
]
408
[
aps
:
\s!cite
:
num
]
409 410
\definebtx
411
[
aps
:
\s!cite
:
textnum
]
412
[
aps
:
\s!cite
:
num
]
413
[
\c!left
=
{
Ref
.
\nbsp
}
,
414
\c!command
=
,
415
\c!separator
:
2
=
{
\btxcomma
}
,
416
\c!separator
:
3
=
{
\btxspace
\btxlabeltext
{
and
}
\space
}
,
417
\c!separator
:
4
=
{
\btxspace
\btxlabeltext
{
and
}
\space
}
]
418 419
\definebtx
420
[
aps
:
\s!cite
:
entry
]
421
[
aps
:
\s!cite
]
422
[
\c!left
=
,
423
\c!right
=
,
424
\c!inbetween
=
{
\btxspace
}
,
425
\c!separator
:
2
=
{
\btxsemicolon
}
,
426
\c!separator
:
3
=
\btxparameter
{
\c!separator
:
2
}
,
427
\c!separator
:
4
=
\btxparameter
{
\c!separator
:
2
}
]
428 429
%D Sometimes we have verbose injections in an entry and these can be language
430
%D dependent, so we use labels.
431
%D
432
%D Because we want to mix rendering (in the manual) we need a namespace in label
433
%D texts:
434 435
\setupbtxlabeltext
436
[
en
]
437
[
aps
:
number
=
{
no
.
}
,
438
aps
:
edition
=
{
ed
.
}
,
439
aps
:
Editor
=
{
Ed
.
}
,
440
aps
:
Editors
=
{
Eds
.
}
,
441
aps
:
Volume
=
{
Vol
.
}
,
442
aps
:
Volumes
=
{
Vols
.
}
,
443
aps
:
supplement
=
{
Suppl
.
}
,
% Supplement (not used?)
444
aps
:
inpress
=
{
in
press
}
,
445
aps
:
tobe
=
{
to
be
published
}
,
446
aps
:
unpublished
=
{
unpublished
}
]
447 448
% Check this (google translate!!):
449 450
\setupbtxlabeltext
451
[
nl
]
452
[
aps
:
number
=
{
nr
.
}
,
453
aps
:
edition
=
{
ed
.
}
,
% editie
454
aps
:
Editor
=
Editor
,
% Ed./Eds.
455
aps
:
Editors
=
Editors
,
456
aps
:
Volume
=
{
Vol
.
}
,
457
aps
:
Volumes
=
{
Vols
.
}
,
458
aps
:
supplement
=
Supplement
,
459
aps
:
inpress
=
{
in
press
}
,
% CHECK THESE!
460
aps
:
tobe
=
{
worden
gepubliceerd
}
,
461
aps
:
unpublished
=
{
onuitgegeven
}
]
462 463
\setupbtxlabeltext
464
[
fr
]
465
[
aps
:
number
=
{
n
\high
{
o
}}
,
466
aps
:
edition
=
{
édition
}
,
467
aps
:
Editor
=
Éditeur
,
468
aps
:
Editors
=
Éditeurs
,
469
aps
:
Volume
=
Volume
,
470
aps
:
Volumes
=
Volumes
,
471
aps
:
supplement
=
Supplément
,
472
aps
:
inpress
=
{
sous
impression
}
,
473
aps
:
tobe
=
{
à
paraître
}
,
474
aps
:
unpublished
=
{
inédit
}
]
% pour un livre
475 476
\setupbtxlabeltext
477
[
de
]
478
[
aps
:
number
=
{
nr
.
}
,
479
aps
:
edition
=
Auf
\/
lage
,
480
aps
:
Editor
=
Herausgeber
,
% Hrsg./Hg.
481
aps
:
Editors
=
Herausgeber
,
482
aps
:
Volume
=
Band
,
% Bd.
483
aps
:
Volumes
=
{
Bände
}
,
484
aps
:
supplement
=
{
Beilage
}
,
% Supplement
485
aps
:
inpress
=
{
in
der
Presse
}
,
% CHECK THESE!
486
aps
:
tobe
=
{
veröffentlicht
werden
}
,
487
aps
:
unpublished
=
{
unveröffentlicht
}
]
488 489
% thanks: Andrea Valle
490 491
\setupbtxlabeltext
492
[
it
]
493
[
aps
:
number
=
{
}
,
494
aps
:
edition
=
{
ed
.
}
,
% edizione
495
aps
:
Editor
=
{
A
cura
di
}
,
496
aps
:
Editors
=
{
A
cura
di
}
,
497
aps
:
Volume
=
{
Vol
.
}
,
% Volume
498
aps
:
Volumes
=
{
Vol
.
}
,
% Volumi
499
aps
:
supplement
=
{
Supplemento
}
,
500
aps
:
inpress
=
{
in
press
}
,
% CHECK THESE!
501
aps
:
tobe
=
{
da
pubblicare
}
,
502
aps
:
unpublished
=
{
inedito
}
]
503 504
\setupbtxlabeltext
505
[
es
]
506
[
aps
:
number
=
{
}
,
507
aps
:
edition
=
{
ed
.
}
,
% edición
508
aps
:
Editor
=
Editor
,
% Ed./Eds.
509
aps
:
Editors
=
Editores
,
510
aps
:
Volume
=
{
Vol
.
}
,
% Volumen
511
aps
:
Volumes
=
{
Vols
.
}
,
% Volúmenes
512
aps
:
supplement
=
Suplemento
,
513
aps
:
inpress
=
{
en
prensa
}
,
% CHECK THESE!
514
aps
:
tobe
=
{
que
se
publicará
}
,
515
aps
:
unpublished
=
{
inédito
}
]
516 517
\setupbtxlabeltext
518
[
sv
]
519
[
aps
:
number
=
{
nr
.
}
,
520
aps
:
edition
=
{
Utgåva
}
,
521
aps
:
Editor
=
Redaktör
,
522
aps
:
Editors
=
Redaktörer
,
523
aps
:
Volume
=
Band
,
524
aps
:
Volumes
=
Band
,
525
aps
:
supplement
=
Bilaga
,
526
aps
:
inpress
=
{
under
tryckning
}
,
527
aps
:
tobe
=
{
att
publiceras
}
,
528
aps
:
unpublished
=
{
opublicerat
}
]
529 530 531
% cite setups
532 533
\startsetups
btx
:
aps
:
nd
534
\doifelse
{
\currentbtxcategory
}
{
article
}
{
535
\btxlabeltext
{
aps
:
tobe
}
536
}
{
537
\doifelse
{
\currentbtxcategory
}
{
book
}
{
538
\btxlabeltext
{
aps
:
inpress
}
539
}
{
540
\btxlabeltext
{
aps
:
unpublished
}
541
}
542
}
543
\stopsetups
544 545
\startsetups
btx
:
aps
:
cite
:
author
:
year
546
\texdefinition
{
\s!btx
:
\s!cite
:
concat
}
547
\ifx
\currentbtxfirst
\empty
548
\fastsetup
{
btx
:
aps
:
nd
}
549
\else
550
\texdefinition
{
\s!btx
:
\s!cite
:
inject
}
{
551
\btxcitereference
552
\currentbtxfirst
553
}
554
\ifx
\currentbtxsecond
\empty
\else
555
\btxparameter
\c!inbetween
556
\texdefinition
{
\s!btx
:
\s!cite
:
inject
}
{
557
\currentbtxsecond
558
}
559
\fi
560
\btxflushsuffix
561
\fi
562
\stopsetups
563 564
\startsetups
btx
:
aps
:
cite
:
author
:
years
565
\fastsetup
{
btx
:
aps
:
cite
:
author
:
year
}
566
\stopsetups
567 568
% used in publ-imp-page.mkvi
569 570
\startsetups
[
btx
:
aps
:
list
:
page
-
or
-
pages
]
571
\ifx
\currentbtxlastpage
\empty
572
\btxlabeltext
{
p
}
573
\else
574
\btxlabeltext
{
pp
}
575
\fi
576
\btxnbsp
577
\stopsetups
578 579
%D Instead of texdefinitions without arguments, we could have used setups but in my
580
%D editor (hh, scite) the commands stand out better. It also saves an additional
581
%D component in the name (e.g. common:) because commands and setups have a different
582
%D namespace, so similar calls don't clash. Performance of definitions is somewhat
583
%D better.
584 585
%D We use "texdefinitions" (with eventual arguments) for helpers that are used
586
%D in the rendering "setups" defined for each category below.
587 588
%D Note that \btxdoif... and \btxflush rely on the definitions in
589
%D publ-imp-aps.lua: fields that are not listed as required nor optional are
590
%D IGNORED. We also make heavy use of the notion of sets - comma-separated lists
591
%D of alternative fields to be used in hierarchal order. For example:
592
%D author = { "author", "editor", "publisher", "title" }, will return the
593
%D author field if it exists; if not, the editor field will be returned, if it
594
%D exists; if not, the publisher field will be returned, if it exists; if not,
595
%D the title field will be returned, it it exists; if not, nothing will be
596
%D returned. In lua syntax, it can be understood as
597
%D author or editor or publisher or title or ""
598 599
\starttexdefinition
unexpanded
btx
:
aps
:
composed
-
title
#
title
600
\btxstartstyleandcolor
[
aps
:
\s!list
:
title
:
\currentbtxcategory
]
601
\begingroup
602
\language
[
\currentbtxlanguage
]
603
\btxusecommand
[
aps
:
\s!list
:
title
:
\currentbtxcategory
]
{
604
\btxflush
{
#
title
}
605
\btxdoif
{
sub
#
title
}
{
606
\btxcolon
607
\btxflush
{
sub
#
title
}
608
}
609
}
610
\endgroup
611
\btxstopstyleandcolor
612
\stoptexdefinition
613 614
\starttexdefinition
unexpanded
btx
:
aps
:
title
615
\btxdoif
{
title
}
{
616
% we make the title active, opening file
617
\btxdoifelse
{
file
}
{
618
\texdefinition
{
btx
:
format
:
inject
}
619
{
url
(
file
:
\btxflush
{
file
}
)
}
620
{
621
\texdefinition
{
btx
:
aps
:
composed
-
title
}{
title
}
622
}
623
}
{
624
\texdefinition
{
btx
:
aps
:
composed
-
title
}{
title
}
625
}
626
\btxcomma
627
}
628
\stoptexdefinition
629 630
\starttexdefinition
unexpanded
btx
:
aps
:
optional
-
title
631
\doif
{
\btxparameter
{
\c!title
}}
\v!yes
{
632
\texdefinition
{
btx
:
aps
:
title
}
633
}
634
\stoptexdefinition
635 636
\starttexdefinition
unexpanded
btx
:
aps
:
year
637
\btxdoifelse
{
year
}
{
638
\btxflush
{
year
}
639
}
{
640
\fastsetup
{
btx
:
aps
:
nd
}
641
}
642
\stoptexdefinition
643 644
% #author may be author(set) or editor
645 646
\starttexdefinition
unexpanded
btx
:
aps
:
author
-
or
-
editor
#
author
647
\btxdoif
{
#
author
}
{
648
\btxflush
{
#
author
}
649
\doifelse
{
\btxfoundname
{
#
author
}}
{
editor
}
{
650
\btxleftparenthesis
651
\btxsingularorplural
{
editor
}
{
652
\btxlabeltext
{
aps
:
Editor
}
653
}
{
654
\btxlabeltext
{
aps
:
Editors
}
655
}
656
\btxrightparenthesis
657
}
{
658
\btxdoif
{
collaboration
}
{
659
\btxleftparenthesis
660
\btxflush
{
collaboration
}
661
\btxrightparenthesis
662
}
663
}
664
}
665
\stoptexdefinition
666 667
\starttexdefinition
unexpanded
btx
:
aps
:
author
668
\btxdoif
{
author
}
{
669
\btxflush
{
author
}
670
\btxcomma
671
}
672
\stoptexdefinition
673 674
\starttexdefinition
unexpanded
btx
:
aps
:
organization
-
if
-
not
-
author
675
\btxdoif
{
organization
}
{
676
\doifnot
{
\btxfoundname
{
author
}}
{
organization
}
{
677
\btxspace
678
\btxflush
{
organization
}
679
\btxcomma
680
}
681
}
682
\stoptexdefinition
683 684
\starttexdefinition
unexpanded
btx
:
aps
:
editor
-
in
685
\btxdoif
{
booktitle
}
{
686
\btxlabeltext
{
In
}
687
\doifnot
{
\btxfoundname
{
author
}}
{
editor
}
{
688
\btxspace
689
\texdefinition
{
btx
:
aps
:
author
-
or
-
editor
}
{
editor
}
690
}
691
\btxspace
692
\texdefinition
{
btx
:
aps
:
composed
-
title
}{
booktitle
}
693
\btxcomma
694
}
695
\stoptexdefinition
696 697
\starttexdefinition
unexpanded
btx
:
aps
:
editionset
698
\doif
{
\currentbtxcategory
}
{
techreport
}
{
699
\btxdoifelse
{
type
}
{
700
\btxusecommand
[
\currentbtx
:
type
]
{
701
\btxflush
{
type
}
702
}
703
}
{
704
\btxlabeltext
{
technicalreport
}
705
}
706
\btxcomma
707
}
708
\btxdoif
{
volume
}
{
709
\btxoneorrange
{
volume
}
{
710
\btxlabeltext
{
aps
:
Volume
}
711
}
{
712
\btxlabeltext
{
aps
:
Volumes
}
713
}
714
\btxspace
715
\btxflush
{
volume
}
716
\btxcomma
717
}
718
\btxdoif
{
number
}
{
719
\btxlabeltext
{
aps
:
number
}
720
\btxspace
721
\btxflush
{
number
}
722
\btxcomma
723
}
724
\btxdoif
{
edition
}
{
725
\btxflush
{
edition
}
726
\btxspace
727
\btxlabeltext
{
aps
:
edition
}
728
\btxcomma
729
}
730
\btxdoif
{
pages
}
{
731
\btxoneorrange
{
pages
}
{
732
\btxlabeltext
{
p
}
.
733
}
{
734
\btxlabeltext
{
pp
}
.
735
}
736
\btxnbsp
737
\btxflush
{
pages
}
738
\btxcomma
739
}
740
\stoptexdefinition
741 742
\starttexdefinition
unexpanded
btx
:
aps
:
journal
-
volume
-
year
743
\btxdoif
{
journal
}
{
744
\btxspace
745
\btxstartstyleandcolor
[
aps
:
\s!list
:
journal
]
746
% expandedjournal abbreviatedjournal
747
\btxflush
{
expandedjournal
-
>
journal
}
748
\btxstopstyleandcolor
749
\btxdoifelse
{
volume
}
{
750
\btxspace
751
\btxstartstyleandcolor
[
aps
:
\s!list
:
volume
]
752
\btxflush
{
volume
}
753
\btxstopstyleandcolor
754
\btxdoif
{
number
}
{
755
\removeunwantedspaces
(
756
\btxflush
{
number
}
757
\btxrightparenthesiscomma
758
}
759
}
{
760
\btxdoif
{
number
}
{
761
\btxspace
762
\btxflush
{
number
}
763
\btxcomma
764
}
765
}
766
\btxdoif
{
pages
}
{
767
\btxspace
768
\btxflush
{
pages
}
769
}
770
}
771
\btxleftparenthesis
772
\texdefinition
{
btx
:
aps
:
year
}
773
\btxrightparenthesis
774
\stoptexdefinition
775 776
\starttexdefinition
unexpanded
btx
:
aps
:
publisher
-
wherefrom
-
year
777
\removeunwantedspaces
778
\removepunctuation
779
\btxleftparenthesis
780
\btxflush
{
publisher
}
781
\btxdoifelse
{
address
}
{
782
\btxdoif
{
publisher
}
{
783
\btxcomma
784
}
785
\btxflush
{
address
}
786
\btxdoif
{
country
}
{
787
\btxcomma
788
\btxflush
{
country
}
789
}
790
\btxcomma
791
}
{
792
\btxdoif
{
publisher
}
{
793
\btxcomma
794
}
795
}
796
\texdefinition
{
btx
:
aps
:
year
}
797
\btxrightparenthesis
798
\stoptexdefinition
799 800
\starttexdefinition
unexpanded
btx
:
aps
:
note
801
\btxperiod
802
\btxdoif
{
note
}
{
803
\btxleftparenthesis
804
\btxflush
{
note
}
805
\btxrightparenthesis
806
}
807
\stoptexdefinition
808 809
\starttexdefinition
unexpanded
btx
:
aps
:
doi
-
url
#
text
810
\ifconditional
\btxinteractive
811
\btxdoifelse
{
doi
}
{
812
\goto
{
#
text
}
[
url
(
http
:
//
dx
.
doi
.
org
/
\btxflush
{
doi
}
)]
813
}
{
814
\btxdoifelse
{
url
}
{
815
\goto
{
#
text
}
[
url
(
\btxflush
{
url
}
)]
816
}
{
817
#
text
818
}
819
}
820
\else
821
#
text
822
\fi
823
\stoptexdefinition
824 825
% Then setups, by category
826 827
% An article from a journal
828
% Required fields: author or editor or title, journal, (year).
829
% Optional fields: volume, number, pages, type, doi, url, note.
830
% Note that bibtex (and tools) do not include editor (e.g. special issue or section)
831 832
\startsetups
btx
:
aps
:
list
:
article
833
\texdefinition
{
btx
:
aps
:
author
}
834
\texdefinition
{
btx
:
aps
:
optional
-
title
}
835
\texdefinition
{
btx
:
aps
:
doi
-
url
}
{
\texdefinition
{
btx
:
aps
:
journal
-
volume
-
year
}}
836
\texdefinition
{
btx
:
aps
:
note
}
837
\stopsetups
838 839
% An article from a magazine.
840
% Required fields: author or title, journal, (year).
841
% Optional fields: number, pages, type, month, day, doi, url, note.
842 843
\startsetups
btx
:
aps
:
list
:
magazine
844
\fastsetup
{
btx
:
aps
:
list
:
article
}
845
\stopsetups
846 847
% An article from a newspaper.
848
% Required fields: author or title, journal, (year).
849
% Optional fields: number, pages, type, month, day, doi, url, note.
850 851
\startsetups
btx
:
aps
:
list
:
newspaper
852
\fastsetup
{
btx
:
aps
:
list
:
article
}
853
\stopsetups
854 855
% A complete issue of a periodical, such as a special issue of a journal.
856
% Required fields: title, year
857
% Optional fields: editor, publisher, subtitle, series, volume, number, month, organization, doi, url, issn, note
858 859
% needs to be tuned...
860
\startsetups
btx
:
aps
:
list
:
periodical
861
\fastsetup
{
btx
:
aps
:
list
:
article
}
862
\stopsetups
863 864
% National and international standards issued by a standards body
865
% Required fields: author, institution, or organization, year, title
866
% Optional fields: subtitle, doi, url, note
867 868
\startsetups
btx
:
aps
:
list
:
standard
869
\texdefinition
{
btx
:
aps
:
author
}
870
\texdefinition
{
btx
:
aps
:
title
}
871
\texdefinition
{
btx
:
aps
:
note
}
872
\stopsetups
873
% year?
874 875
% A book with an explicit publisher.
876
% Required fields: author or editor or publisher, title, (year).
877
% Optional fields: volume or number, series, address, edition, month, day, note.
878
% APS? ignores: month, day
879 880
% todo: series?
881 882
\startsetups
btx
:
aps
:
list
:
book
883
\texdefinition
{
btx
:
aps
:
author
}
884
\texdefinition
{
btx
:
aps
:
title
}
885
\texdefinition
{
btx
:
aps
:
editionset
}
886
\texdefinition
{
btx
:
aps
:
doi
-
url
}
{
\texdefinition
{
btx
:
aps
:
publisher
-
wherefrom
-
year
}}
887
\texdefinition
{
btx
:
aps
:
note
}
888
\stopsetups
889 890
% There is some debate about how inbook should differ from incollection
891 892
% A part of a book, which may be a chapter (or section or whatever) and/or a range of pages.
893
% (note that inbook is handled differently by bibtex and biblatex)
894
% Required fields: author or editor, title, chapter and/or pages, publisher, year.
895
% Optional fields: volume or number, series, type, address, edition, month, note.
896
% We add optional: booktitle.
897
% APS? ignores: chapter, month
898 899
\startsetups
btx
:
aps
:
list
:
inbook
900
\texdefinition
{
btx
:
aps
:
author
}
901
\texdefinition
{
btx
:
aps
:
title
}
902
\texdefinition
{
btx
:
aps
:
editor
-
in
}
903
\texdefinition
{
btx
:
aps
:
editionset
}
904
\texdefinition
{
btx
:
aps
:
doi
-
url
}
{
\texdefinition
{
btx
:
aps
:
publisher
-
wherefrom
-
year
}}
905
\texdefinition
{
btx
:
aps
:
note
}
906
\stopsetups
907
% chapter?
908 909
% A part of a book having its own title.
910
% Required fields: author, title, booktitle, publisher, year.
911
% Optional fields: editor, volume or number, series, type, chapter, pages, address, edition, month, note.
912
% APS? ignores: chapter, month
913 914
\startsetups
btx
:
aps
:
list
:
incollection
915
\fastsetup
{
btx
:
aps
:
list
:
inbook
}
916
\stopsetups
917 918
% The proceedings of a conference.
919
% Required fields: title, year.
920
% Optional fields: editor, volume or number, series, address, month, organization, publisher, note.
921
% todo: series?
922 923
\startsetups
btx
:
aps
:
list
:
proceedings
924
\fastsetup
{
btx
:
aps
:
list
:
book
}
925
\stopsetups
926 927
% An article in a conference proceedings.
928
% Required fields: author, title, booktitle, year.
929
% Optional fields: editor, volume or number, series, pages, address, month, organization, publisher, note.
930 931
\startsetups
btx
:
aps
:
list
:
inproceedings
932
\texdefinition
{
btx
:
aps
:
author
}
933
\texdefinition
{
btx
:
aps
:
title
}
934
\texdefinition
{
btx
:
aps
:
editor
-
in
}
935
\texdefinition
{
btx
:
aps
:
editionset
}
936
%\texdefination{btx:aps:organization-if-not-author}% first check publ-imp-aps.lua
937
\btxdoif
{
organization
}
{
938
\btxspace
939
\btxflush
{
organization
}
940
\btxcomma
941
}
942
\texdefinition
{
btx
:
aps
:
doi
-
url
}
{
\texdefinition
{
btx
:
aps
:
publisher
-
wherefrom
-
year
}}
943
\texdefinition
{
btx
:
aps
:
note
}
944
\stopsetups
945 946
\startsetups
btx
:
aps
:
list
:
conference
947
\fastsetup
{
btx
:
aps
:
list
:
inproceedings
}
948
\stopsetups
949 950
% A thesis.
951
% Required fields: author, title, school, year.
952
% Optional fields: type, address, month, note.
953 954
\startsetups
btx
:
aps
:
list
:
thesis
955
\texdefinition
{
btx
:
aps
:
author
}
956
\texdefinition
{
btx
:
aps
:
title
}
957
\btxleftparenthesis
958
\btxdoifelse
{
type
}
{
959
\btxusecommand
[
aps
:
list
:
type
]
{
960
\btxflush
{
type
}
961
}
962
}
{
963
\btxlabeltext
{
\currentbtxcategory
}
964
}
965
\btxrightparenthesis
966
\btxdoif
{
school
}
{
967
\btxperiod
968
\btxflush
{
school
}
969
}
970
\btxdoif
{
address
}
{
971
\btxdoifelse
{
school
}
{
972
\btxcomma
973
}
{
974
\btxperiod
975
}
976
\btxflush
{
address
}
977
\btxdoif
{
country
}
{
978
\btxcomma
979
\btxflush
{
country
}
980
}
981
}
982
\btxleftparenthesis
983
\texdefinition
{
btx
:
aps
:
year
}
984
\btxrightparenthesis
985
\texdefinition
{
btx
:
aps
:
note
}
986
\stopsetups
987 988
\startsetups
btx
:
aps
:
list
:
phdthesis
989
\fastsetup
{
btx
:
aps
:
list
:
thesis
}
990
\stopsetups
991 992
\startsetups
btx
:
aps
:
list
:
mastersthesis
993
\fastsetup
{
btx
:
aps
:
list
:
thesis
}
994
\stopsetups
995 996
% A work that is printed and bound, but without a named publisher or sponsoring institution.
997
% Required field: title.
998
% Optional fields: author, howpublished, address, month, year, note.
999 1000
\startsetups
btx
:
aps
:
list
:
booklet
1001
\fastsetup
{
btx
:
aps
:
list
:
book
}
1002
\stopsetups
1003 1004
% Technical documentation.
1005
% Required field: title.
1006
% Optional fields: author, organization, address, edition, month, year, note.
1007 1008
\startsetups
btx
:
aps
:
list
:
manual
1009
\fastsetup
{
btx
:
aps
:
list
:
book
}
1010
\stopsetups
1011 1012
% A report published by a school or other institution, usually numbered within a series.
1013
% Required fields: author, title, institution, year.
1014
% Optional fields: type, number, address, month, note.
1015 1016
\startsetups
btx
:
aps
:
list
:
techreport
1017
\fastsetup
{
btx
:
aps
:
list
:
book
}
1018
\stopsetups
1019 1020
% A document having an author and title, but not formally published.
1021
% Required fields: author, title, note.
1022
% Optional fields: month, year.
1023 1024
\startsetups
btx
:
aps
:
list
:
unpublished
1025
\fastsetup
{
btx
:
aps
:
list
:
book
}
1026
\stopsetups
1027 1028
% A patent. Note that this category was not defined with BIBTEX. Below from JabRef:
1029
% Required fields: nationality, number, year, yearfiled
1030
% Optional fields: author, title, assignee, address, type, number, day, dayfiled, month, monthfiled, note, url
1031
% Also optional: publisher
1032 1033
% todo: yearfiled, monthfiled, dayfiled
1034 1035
\startsetups
btx
:
aps
:
list
:
patent
1036
\texdefinition
{
btx
:
aps
:
author
}
1037
\texdefinition
{
btx
:
aps
:
title
}
1038
\begingroup
1039
\it
1040
\btxdoif
{
nationality
}
{
1041
\btxspace
1042
\btxflush
{
nationality
}
1043
}
1044
\btxspace
1045
\btxlabeltext
{
patent
}
1046
\btxdoif
{
number
}
{
1047
\btxspace
1048
\btxlabeltext
{
aps
:
number
}
1049
\btxspace
1050
\btxflush
{
number
}
1051
}
1052
\btxperiod
1053
\italiccorrection
1054
\endgroup
1055
\texdefinition
{
btx
:
aps
:
doi
-
url
}
{
\texdefinition
{
btx
:
aps
:
publisher
-
wherefrom
-
year
}}
1056
\texdefinition
{
btx
:
aps
:
note
}
1057
\stopsetups
1058 1059
% Electronic. Note that this category was not defined with BIBTEX. Below from JabRef:
1060
% Required fields: title
1061
% Optional fields: address, author, howpublished, month, note, organization, url, year, doi
1062
% Also optional: type
1063 1064
% Like Misc below but includes organization.
1065 1066
\startsetups
btx
:
aps
:
list
:
electronic
1067
\texdefinition
{
btx
:
aps
:
author
}
1068
\texdefinition
{
btx
:
aps
:
title
}
1069
\texdefinition
{
btx
:
aps
:
organization
-
if
-
not
-
author
}
1070
\btxdoif
{
howpublished
}
{
1071
\texdefinition
{
btx
:
aps
:
doi
-
url
}
{
\btxspace
\btxflush
{
howpublished
}}
1072
}
1073
\btxleftparenthesis
1074
\texdefinition
{
btx
:
aps
:
year
}
1075
\btxrightparenthesis
1076
\texdefinition
{
btx
:
aps
:
note
}
1077
\stopsetups
1078 1079
% Other. Note that this category was not defined with BIBTEX. Below from JabRef:
1080
% Required fields: author or title, year
1081
% Optional fields: note, doi, url
1082 1083
\startsetups
btx
:
aps
:
list
:
other
1084
\fastsetup
{
btx
:
aps
:
list
:
book
}
1085
\stopsetups
1086 1087
% Use this type when nothing else fits.
1088
% Required fields: none.
1089
% Optional fields: author, title, howpublished, month, year, note.
1090 1091
\startsetups
btx
:
aps
:
list
:
misc
1092
\fastsetup
{
btx
:
aps
:
list
:
electronic
}
1093
% Note that organization is an "ignored" field.
1094
\stopsetups
1095 1096
% If all else fails to match:
1097 1098
\startsetups
btx
:
aps
:
list
:
literal
1099
%\btxleftparenthesis
1100
\removeunwantedspaces
(
1101
\btxflush
{
tag
}
1102
\btxrightparenthesis
1103
\btxdoif
{
text
}
{
1104
\btxflush
{
text
}
1105
}
1106
\stopsetups
1107 1108
\stopbtxrenderingdefinitions
1109