tangled
alpha
login
or
join now
jonmsterling.com
/
reflexive-graph-lenses-paper
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
msclike-url.bst
jonmsterling.com
2 years ago
ae0e5d8a
c7dc4e9c
+1483
-1
2 changed files
expand all
collapse all
unified
split
msclike-url.bst
mscs.tex
+1479
msclike-url.bst
···
1
1
+
%%% Modification of BibTeX style file msclike.bst
2
2
+
%%% ... by urlbst, version 0.8 (marked with "% urlbst")
3
3
+
%%% See <http://purl.org/nxg/dist/urlbst>
4
4
+
%%% Modifications Copyright 2002-03, 2005-12, 2014, 2019, Norman Gray,
5
5
+
%%% and distributed under the terms of the LPPL; see README for discussion.
6
6
+
%%%
7
7
+
%%% Added webpage entry type, and url and lastchecked fields.
8
8
+
%%% Added eprint support.
9
9
+
%%% Added DOI support.
10
10
+
%%% Added PUBMED support.
11
11
+
%%% Original headers follow...
12
12
+
13
13
+
% BibTeX `apalike' bibliography style (version 0.99a, 8-Dec-10), adapted from
14
14
+
% the `alpha' style, version 0.99a; for BibTeX version 0.99a.
15
15
+
%
16
16
+
% Copyright (C) 1988, 2010 Oren Patashnik.
17
17
+
% Unlimited copying and redistribution of this file are permitted as long as
18
18
+
% it is unmodified. Modifications (and redistribution of modified versions)
19
19
+
% are also permitted, but only if the resulting file is renamed.
20
20
+
%
21
21
+
% Differences between this style and `alpha' are generally heralded by a `%'.
22
22
+
% The file btxbst.doc has the documentation for alpha.bst.
23
23
+
%
24
24
+
% This style should be used with the `apalike' LaTeX style (apalike.sty).
25
25
+
% \cite's come out like "(Jones, 1986)" in the text but there are no labels
26
26
+
% in the bibliography, and something like "(1986)" comes out immediately
27
27
+
% after the author. Author (and editor) names appear as last name, comma,
28
28
+
% initials. A `year' field is required for every entry, and so is either
29
29
+
% an author (or in some cases, an editor) field or a key field.
30
30
+
%
31
31
+
% Editorial note:
32
32
+
% Many journals require a style like `apalike', but I strongly, strongly,
33
33
+
% strongly recommend that you not use it if you have a choice---use something
34
34
+
% like `plain' instead. Mary-Claire van Leunen (A Handbook for Scholars,
35
35
+
% Knopf, 1979) argues convincingly that a style like `plain' encourages better
36
36
+
% writing than one like `apalike'. Furthermore the strongest arguments for
37
37
+
% using an author-date style like `apalike'---that it's "the most practical"
38
38
+
% (The Chicago Manual of Style, University of Chicago Press, thirteenth
39
39
+
% edition, 1982, pages 400--401)---fall flat on their face with the new
40
40
+
% computer-typesetting technology. For instance page 401 anachronistically
41
41
+
% states "The chief disadvantage of [a style like `plain'] is that additions
42
42
+
% or deletions cannot be made after the manuscript is typed without changing
43
43
+
% numbers in both text references and list." LaTeX sidesteps the disadvantage.
44
44
+
%
45
45
+
% History:
46
46
+
% 15-sep-86 (OP) Original version by Oren Patashnik, ideas from Susan King.
47
47
+
% 10-nov-86 (OP) Truncated the sort.key$ string to the correct length
48
48
+
% in bib.sort.order to eliminate error message.
49
49
+
% 24-jan-88 (OP) Updated for BibTeX version 0.99a, from alpha.bst 0.99a;
50
50
+
% apalike now sorts by author, then year, then title;
51
51
+
% THIS `apalike' VERSION DOES NOT WORK WITH BIBTEX 0.98i.
52
52
+
% 8-dec-10 (OP) Still version 0.99a, as the code itself was unchanged;
53
53
+
% this release clarified the license.
54
54
+
55
55
+
ENTRY
56
56
+
{ address
57
57
+
author
58
58
+
booktitle
59
59
+
chapter
60
60
+
edition
61
61
+
editor
62
62
+
howpublished
63
63
+
institution
64
64
+
journal
65
65
+
key
66
66
+
% month not used in apalike
67
67
+
note
68
68
+
number
69
69
+
organization
70
70
+
pages
71
71
+
publisher
72
72
+
school
73
73
+
series
74
74
+
title
75
75
+
type
76
76
+
volume
77
77
+
year
78
78
+
eprint % urlbst
79
79
+
doi % urlbst
80
80
+
pubmed % urlbst
81
81
+
url % urlbst
82
82
+
lastchecked % urlbst
83
83
+
}
84
84
+
{}
85
85
+
{ label extra.label sort.label }
86
86
+
87
87
+
INTEGERS { output.state before.all mid.sentence after.sentence after.block }
88
88
+
89
89
+
% urlbst...
90
90
+
% urlbst constants and state variables
91
91
+
STRINGS { urlintro
92
92
+
eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl
93
93
+
citedstring onlinestring linktextstring
94
94
+
openinlinelink closeinlinelink }
95
95
+
INTEGERS { hrefform inlinelinks makeinlinelink
96
96
+
addeprints adddoiresolver addpubmedresolver }
97
97
+
FUNCTION {init.urlbst.variables}
98
98
+
{
99
99
+
% The following constants may be adjusted by hand, if desired
100
100
+
101
101
+
% The first set allow you to enable or disable certain functionality.
102
102
+
#1 'addeprints := % 0=no eprints; 1=include eprints
103
103
+
#1 'adddoiresolver := % 0=no DOI resolver; 1=include it
104
104
+
#1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it
105
105
+
#0 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs
106
106
+
#0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles
107
107
+
108
108
+
% String constants, which you _might_ want to tweak.
109
109
+
"URL: " 'urlintro := % prefix before URL; typically "Available from:" or "URL":
110
110
+
"online" 'onlinestring := % indication that resource is online; typically "online"
111
111
+
"cited " 'citedstring := % indicator of citation date; typically "cited "
112
112
+
"[link]" 'linktextstring := % dummy link text; typically "[link]"
113
113
+
"http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref
114
114
+
"arXiv:" 'eprintprefix := % text prefix printed before eprint ref; typically "arXiv:"
115
115
+
"https://doi.org/" 'doiurl := % prefix to make URL from DOI
116
116
+
"doi:" 'doiprefix := % text prefix printed before DOI ref; typically "doi:"
117
117
+
"http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED
118
118
+
"PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref; typically "PMID:"
119
119
+
120
120
+
% The following are internal state variables, not configuration constants,
121
121
+
% so they shouldn't be fiddled with.
122
122
+
#0 'makeinlinelink := % state variable managed by possibly.setup.inlinelink
123
123
+
"" 'openinlinelink := % ditto
124
124
+
"" 'closeinlinelink := % ditto
125
125
+
}
126
126
+
INTEGERS {
127
127
+
bracket.state
128
128
+
outside.brackets
129
129
+
open.brackets
130
130
+
within.brackets
131
131
+
close.brackets
132
132
+
}
133
133
+
% ...urlbst to here
134
134
+
FUNCTION {init.state.consts}
135
135
+
{ #0 'outside.brackets := % urlbst...
136
136
+
#1 'open.brackets :=
137
137
+
#2 'within.brackets :=
138
138
+
#3 'close.brackets := % ...urlbst to here
139
139
+
140
140
+
#0 'before.all :=
141
141
+
#1 'mid.sentence :=
142
142
+
#2 'after.sentence :=
143
143
+
#3 'after.block :=
144
144
+
}
145
145
+
146
146
+
STRINGS { s t }
147
147
+
148
148
+
% urlbst
149
149
+
FUNCTION {output.nonnull.original}
150
150
+
{ 's :=
151
151
+
output.state mid.sentence =
152
152
+
{ ", " * write$ }
153
153
+
{ output.state after.block =
154
154
+
{ add.period$ write$
155
155
+
newline$
156
156
+
"\newblock " write$
157
157
+
}
158
158
+
{ output.state before.all =
159
159
+
'write$
160
160
+
{ add.period$ " " * write$ }
161
161
+
if$
162
162
+
}
163
163
+
if$
164
164
+
mid.sentence 'output.state :=
165
165
+
}
166
166
+
if$
167
167
+
s
168
168
+
}
169
169
+
170
170
+
% urlbst...
171
171
+
% The following three functions are for handling inlinelink. They wrap
172
172
+
% a block of text which is potentially output with write$ by multiple
173
173
+
% other functions, so we don't know the content a priori.
174
174
+
% They communicate between each other using the variables makeinlinelink
175
175
+
% (which is true if a link should be made), and closeinlinelink (which holds
176
176
+
% the string which should close any current link. They can be called
177
177
+
% at any time, but start.inlinelink will be a no-op unless something has
178
178
+
% previously set makeinlinelink true, and the two ...end.inlinelink functions
179
179
+
% will only do their stuff if start.inlinelink has previously set
180
180
+
% closeinlinelink to be non-empty.
181
181
+
% (thanks to 'ijvm' for suggested code here)
182
182
+
FUNCTION {uand}
183
183
+
{ 'skip$ { pop$ #0 } if$ } % 'and' (which isn't defined at this point in the file)
184
184
+
FUNCTION {possibly.setup.inlinelink}
185
185
+
{ makeinlinelink hrefform #0 > uand
186
186
+
{ doi empty$ adddoiresolver uand
187
187
+
{ pubmed empty$ addpubmedresolver uand
188
188
+
{ eprint empty$ addeprints uand
189
189
+
{ url empty$
190
190
+
{ "" }
191
191
+
{ url }
192
192
+
if$ }
193
193
+
{ eprinturl eprint * }
194
194
+
if$ }
195
195
+
{ pubmedurl pubmed * }
196
196
+
if$ }
197
197
+
{ doiurl doi * }
198
198
+
if$
199
199
+
% an appropriately-formatted URL is now on the stack
200
200
+
hrefform #1 = % hypertex
201
201
+
{ "\special {html:<a href=" quote$ * swap$ * quote$ * "> }{" * 'openinlinelink :=
202
202
+
"\special {html:</a>}" 'closeinlinelink := }
203
203
+
{ "\href {" swap$ * "} {" * 'openinlinelink := % hrefform=#2 -- hyperref
204
204
+
% the space between "} {" matters: a URL of just the right length can cause "\% newline em"
205
205
+
"}" 'closeinlinelink := }
206
206
+
if$
207
207
+
#0 'makeinlinelink :=
208
208
+
}
209
209
+
'skip$
210
210
+
if$ % makeinlinelink
211
211
+
}
212
212
+
FUNCTION {add.inlinelink}
213
213
+
{ openinlinelink empty$
214
214
+
'skip$
215
215
+
{ openinlinelink swap$ * closeinlinelink *
216
216
+
"" 'openinlinelink :=
217
217
+
}
218
218
+
if$
219
219
+
}
220
220
+
FUNCTION {output.nonnull}
221
221
+
{ % Save the thing we've been asked to output
222
222
+
's :=
223
223
+
% If the bracket-state is close.brackets, then add a close-bracket to
224
224
+
% what is currently at the top of the stack, and set bracket.state
225
225
+
% to outside.brackets
226
226
+
bracket.state close.brackets =
227
227
+
{ "]" *
228
228
+
outside.brackets 'bracket.state :=
229
229
+
}
230
230
+
'skip$
231
231
+
if$
232
232
+
bracket.state outside.brackets =
233
233
+
{ % We're outside all brackets -- this is the normal situation.
234
234
+
% Write out what's currently at the top of the stack, using the
235
235
+
% original output.nonnull function.
236
236
+
s
237
237
+
add.inlinelink
238
238
+
output.nonnull.original % invoke the original output.nonnull
239
239
+
}
240
240
+
{ % Still in brackets. Add open-bracket or (continuation) comma, add the
241
241
+
% new text (in s) to the top of the stack, and move to the close-brackets
242
242
+
% state, ready for next time (unless inbrackets resets it). If we come
243
243
+
% into this branch, then output.state is carefully undisturbed.
244
244
+
bracket.state open.brackets =
245
245
+
{ " [" * }
246
246
+
{ ", " * } % bracket.state will be within.brackets
247
247
+
if$
248
248
+
s *
249
249
+
close.brackets 'bracket.state :=
250
250
+
}
251
251
+
if$
252
252
+
}
253
253
+
254
254
+
% Call this function just before adding something which should be presented in
255
255
+
% brackets. bracket.state is handled specially within output.nonnull.
256
256
+
FUNCTION {inbrackets}
257
257
+
{ bracket.state close.brackets =
258
258
+
{ within.brackets 'bracket.state := } % reset the state: not open nor closed
259
259
+
{ open.brackets 'bracket.state := }
260
260
+
if$
261
261
+
}
262
262
+
263
263
+
FUNCTION {format.lastchecked}
264
264
+
{ lastchecked empty$
265
265
+
{ "" }
266
266
+
{ inbrackets citedstring lastchecked * }
267
267
+
if$
268
268
+
}
269
269
+
% ...urlbst to here
270
270
+
271
271
+
FUNCTION {output}
272
272
+
{ duplicate$ empty$
273
273
+
'pop$
274
274
+
'output.nonnull
275
275
+
if$
276
276
+
}
277
277
+
278
278
+
FUNCTION {output.check}
279
279
+
{ 't :=
280
280
+
duplicate$ empty$
281
281
+
{ pop$ "empty " t * " in " * cite$ * warning$ }
282
282
+
'output.nonnull
283
283
+
if$
284
284
+
}
285
285
+
286
286
+
% apalike needs this function because
287
287
+
% the year has special punctuation;
288
288
+
% apalike ignores the month
289
289
+
FUNCTION {output.year.check}
290
290
+
{ year empty$
291
291
+
{ "empty year in " cite$ * warning$ }
292
292
+
{ write$
293
293
+
" " year * extra.label *
294
294
+
mid.sentence 'output.state :=
295
295
+
}
296
296
+
if$
297
297
+
}
298
298
+
299
299
+
FUNCTION {output.bibitem.original} % urlbst (renamed from output.bibitem, so it can be wrapped below)
300
300
+
{ newline$
301
301
+
"\bibitem[" write$
302
302
+
label write$
303
303
+
"]{" write$
304
304
+
cite$ write$
305
305
+
"}" write$
306
306
+
newline$
307
307
+
""
308
308
+
before.all 'output.state :=
309
309
+
}
310
310
+
311
311
+
FUNCTION {fin.entry.original} % urlbst (renamed from fin.entry, so it can be wrapped below)
312
312
+
{ add.period$
313
313
+
write$
314
314
+
newline$
315
315
+
}
316
316
+
317
317
+
FUNCTION {new.block}
318
318
+
{ output.state before.all =
319
319
+
'skip$
320
320
+
{ after.block 'output.state := }
321
321
+
if$
322
322
+
}
323
323
+
324
324
+
FUNCTION {new.sentence}
325
325
+
{ output.state after.block =
326
326
+
'skip$
327
327
+
{ output.state before.all =
328
328
+
'skip$
329
329
+
{ after.sentence 'output.state := }
330
330
+
if$
331
331
+
}
332
332
+
if$
333
333
+
}
334
334
+
335
335
+
FUNCTION {not}
336
336
+
{ { #0 }
337
337
+
{ #1 }
338
338
+
if$
339
339
+
}
340
340
+
341
341
+
FUNCTION {and}
342
342
+
{ 'skip$
343
343
+
{ pop$ #0 }
344
344
+
if$
345
345
+
}
346
346
+
347
347
+
FUNCTION {or}
348
348
+
{ { pop$ #1 }
349
349
+
'skip$
350
350
+
if$
351
351
+
}
352
352
+
353
353
+
FUNCTION {new.block.checkb}
354
354
+
{ empty$
355
355
+
swap$ empty$
356
356
+
and
357
357
+
'skip$
358
358
+
'new.block
359
359
+
if$
360
360
+
}
361
361
+
362
362
+
FUNCTION {field.or.null}
363
363
+
{ duplicate$ empty$
364
364
+
{ pop$ "" }
365
365
+
'skip$
366
366
+
if$
367
367
+
}
368
368
+
369
369
+
FUNCTION {emphasize}
370
370
+
{ duplicate$ empty$
371
371
+
{ pop$ "" }
372
372
+
{ "{\em " swap$ * "}" * }
373
373
+
if$
374
374
+
}
375
375
+
376
376
+
INTEGERS { nameptr namesleft numnames }
377
377
+
378
378
+
FUNCTION {format.names}
379
379
+
{ 's :=
380
380
+
#1 'nameptr :=
381
381
+
s num.names$ 'numnames :=
382
382
+
numnames 'namesleft :=
383
383
+
{ namesleft #0 > }
384
384
+
{ "{\bf " s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ * "}" * 't := % last name first
385
385
+
nameptr #1 >
386
386
+
{ namesleft #1 >
387
387
+
{ ", " * t * }
388
388
+
{ numnames #2 >
389
389
+
{ "," * }
390
390
+
'skip$
391
391
+
if$
392
392
+
t "others" =
393
393
+
{ " \textbf{et~al.}" * }
394
394
+
{ " \textbf{and} " * t * }
395
395
+
if$
396
396
+
}
397
397
+
if$
398
398
+
}
399
399
+
't
400
400
+
if$
401
401
+
nameptr #1 + 'nameptr :=
402
402
+
namesleft #1 - 'namesleft :=
403
403
+
}
404
404
+
while$
405
405
+
}
406
406
+
407
407
+
FUNCTION {format.authors}
408
408
+
{ author empty$
409
409
+
{ "" }
410
410
+
{ author format.names }
411
411
+
if$
412
412
+
}
413
413
+
414
414
+
FUNCTION {format.key} % this function is just for apalike
415
415
+
{ empty$
416
416
+
{ key field.or.null }
417
417
+
{ "" }
418
418
+
if$
419
419
+
}
420
420
+
421
421
+
FUNCTION {format.editors}
422
422
+
{ editor empty$
423
423
+
{ "" }
424
424
+
{ editor format.names
425
425
+
editor num.names$ #1 >
426
426
+
{ ", editors" * }
427
427
+
{ ", editor" * }
428
428
+
if$
429
429
+
}
430
430
+
if$
431
431
+
}
432
432
+
433
433
+
FUNCTION {format.title}
434
434
+
{ title empty$
435
435
+
{ "" }
436
436
+
{ title "t" change.case$ }
437
437
+
if$
438
438
+
}
439
439
+
440
440
+
FUNCTION {n.dashify}
441
441
+
{ 't :=
442
442
+
""
443
443
+
{ t empty$ not }
444
444
+
{ t #1 #1 substring$ "-" =
445
445
+
{ t #1 #2 substring$ "--" = not
446
446
+
{ "--" *
447
447
+
t #2 global.max$ substring$ 't :=
448
448
+
}
449
449
+
{ { t #1 #1 substring$ "-" = }
450
450
+
{ "-" *
451
451
+
t #2 global.max$ substring$ 't :=
452
452
+
}
453
453
+
while$
454
454
+
}
455
455
+
if$
456
456
+
}
457
457
+
{ t #1 #1 substring$ *
458
458
+
t #2 global.max$ substring$ 't :=
459
459
+
}
460
460
+
if$
461
461
+
}
462
462
+
while$
463
463
+
}
464
464
+
465
465
+
FUNCTION {format.btitle}
466
466
+
{ title emphasize
467
467
+
}
468
468
+
469
469
+
FUNCTION {tie.or.space.connect}
470
470
+
{ duplicate$ text.length$ #3 <
471
471
+
{ "~" }
472
472
+
{ " " }
473
473
+
if$
474
474
+
swap$ * *
475
475
+
}
476
476
+
477
477
+
FUNCTION {either.or.check}
478
478
+
{ empty$
479
479
+
'pop$
480
480
+
{ "can't use both " swap$ * " fields in " * cite$ * warning$ }
481
481
+
if$
482
482
+
}
483
483
+
484
484
+
FUNCTION {format.bvolume}
485
485
+
{ volume empty$
486
486
+
{ "" }
487
487
+
{ "volume" volume tie.or.space.connect
488
488
+
series empty$
489
489
+
'skip$
490
490
+
{ " of " * series emphasize * }
491
491
+
if$
492
492
+
"volume and number" number either.or.check
493
493
+
}
494
494
+
if$
495
495
+
}
496
496
+
497
497
+
FUNCTION {format.number.series}
498
498
+
{ volume empty$
499
499
+
{ number empty$
500
500
+
{ series field.or.null }
501
501
+
{ output.state mid.sentence =
502
502
+
{ "number" }
503
503
+
{ "Number" }
504
504
+
if$
505
505
+
number tie.or.space.connect
506
506
+
series empty$
507
507
+
{ "there's a number but no series in " cite$ * warning$ }
508
508
+
{ " in " * series * }
509
509
+
if$
510
510
+
}
511
511
+
if$
512
512
+
}
513
513
+
{ "" }
514
514
+
if$
515
515
+
}
516
516
+
517
517
+
FUNCTION {format.edition}
518
518
+
{ edition empty$
519
519
+
{ "" }
520
520
+
{ output.state mid.sentence =
521
521
+
{ edition "l" change.case$ " edition" * }
522
522
+
{ edition "t" change.case$ " edition" * }
523
523
+
if$
524
524
+
}
525
525
+
if$
526
526
+
}
527
527
+
528
528
+
INTEGERS { multiresult }
529
529
+
530
530
+
FUNCTION {multi.page.check}
531
531
+
{ 't :=
532
532
+
#0 'multiresult :=
533
533
+
{ multiresult not
534
534
+
t empty$ not
535
535
+
and
536
536
+
}
537
537
+
{ t #1 #1 substring$
538
538
+
duplicate$ "-" =
539
539
+
swap$ duplicate$ "," =
540
540
+
swap$ "+" =
541
541
+
or or
542
542
+
{ #1 'multiresult := }
543
543
+
{ t #2 global.max$ substring$ 't := }
544
544
+
if$
545
545
+
}
546
546
+
while$
547
547
+
multiresult
548
548
+
}
549
549
+
550
550
+
FUNCTION {format.pages}
551
551
+
{ pages empty$
552
552
+
{ "" }
553
553
+
{ pages multi.page.check
554
554
+
{ "pp." pages n.dashify tie.or.space.connect }
555
555
+
{ "" pages tie.or.space.connect }
556
556
+
if$
557
557
+
}
558
558
+
if$
559
559
+
}
560
560
+
561
561
+
FUNCTION {format.vol.num.pages}
562
562
+
{ volume field.or.null
563
563
+
number empty$
564
564
+
'skip$
565
565
+
{ "(" number * ")" * *
566
566
+
volume empty$
567
567
+
{ "there's a number but no volume in " cite$ * warning$ }
568
568
+
'skip$
569
569
+
if$
570
570
+
}
571
571
+
if$
572
572
+
pages empty$
573
573
+
'skip$
574
574
+
{ duplicate$ empty$
575
575
+
{ pop$ format.pages }
576
576
+
{ ":" * pages n.dashify * }
577
577
+
if$
578
578
+
}
579
579
+
if$
580
580
+
}
581
581
+
582
582
+
FUNCTION {format.chapter.pages}
583
583
+
{ chapter empty$
584
584
+
'format.pages
585
585
+
{ type empty$
586
586
+
{ "chapter" }
587
587
+
{ type "l" change.case$ }
588
588
+
if$
589
589
+
chapter tie.or.space.connect
590
590
+
pages empty$
591
591
+
'skip$
592
592
+
{ ", " * format.pages * }
593
593
+
if$
594
594
+
}
595
595
+
if$
596
596
+
}
597
597
+
598
598
+
FUNCTION {format.in.ed.booktitle}
599
599
+
{ booktitle empty$
600
600
+
{ "" }
601
601
+
{ editor empty$
602
602
+
{ "In " booktitle emphasize * }
603
603
+
{ "In " format.editors * ", " * booktitle emphasize * }
604
604
+
if$
605
605
+
}
606
606
+
if$
607
607
+
}
608
608
+
609
609
+
FUNCTION {format.thesis.type}
610
610
+
{ type empty$
611
611
+
'skip$
612
612
+
{ pop$
613
613
+
type "t" change.case$
614
614
+
}
615
615
+
if$
616
616
+
}
617
617
+
618
618
+
FUNCTION {format.tr.number}
619
619
+
{ type empty$
620
620
+
{ "Technical Report" }
621
621
+
'type
622
622
+
if$
623
623
+
number empty$
624
624
+
{ "t" change.case$ }
625
625
+
{ number tie.or.space.connect }
626
626
+
if$
627
627
+
}
628
628
+
629
629
+
FUNCTION {format.article.crossref}
630
630
+
{ "In" % this is for apalike
631
631
+
" \cite{" * crossref * "}" *
632
632
+
}
633
633
+
634
634
+
FUNCTION {format.book.crossref}
635
635
+
{ volume empty$
636
636
+
{ "empty volume in " cite$ * "'s crossref of " * crossref * warning$
637
637
+
"In "
638
638
+
}
639
639
+
{ "Volume" volume tie.or.space.connect
640
640
+
" of " *
641
641
+
}
642
642
+
if$
643
643
+
"\cite{" * crossref * "}" * % this is for apalike
644
644
+
}
645
645
+
646
646
+
FUNCTION {format.incoll.inproc.crossref}
647
647
+
{ "In" % this is for apalike
648
648
+
" \cite{" * crossref * "}" *
649
649
+
}
650
650
+
651
651
+
FUNCTION {format.date}
652
652
+
{ year empty$
653
653
+
'skip$
654
654
+
{ %write$
655
655
+
"(" year * ")" *
656
656
+
}
657
657
+
if$
658
658
+
}
659
659
+
% urlbst...
660
660
+
% Functions for making hypertext links.
661
661
+
% In all cases, the stack has (link-text href-url)
662
662
+
%
663
663
+
% make 'null' specials
664
664
+
FUNCTION {make.href.null}
665
665
+
{
666
666
+
pop$
667
667
+
}
668
668
+
% make hypertex specials
669
669
+
FUNCTION {make.href.hypertex}
670
670
+
{
671
671
+
"\special {html:<a href=" quote$ *
672
672
+
swap$ * quote$ * "> }" * swap$ *
673
673
+
"\special {html:</a>}" *
674
674
+
}
675
675
+
% make hyperref specials
676
676
+
FUNCTION {make.href.hyperref}
677
677
+
{
678
678
+
"\href {" swap$ * "} {\path{" * swap$ * "}}" *
679
679
+
}
680
680
+
FUNCTION {make.href}
681
681
+
{ hrefform #2 =
682
682
+
'make.href.hyperref % hrefform = 2
683
683
+
{ hrefform #1 =
684
684
+
'make.href.hypertex % hrefform = 1
685
685
+
'make.href.null % hrefform = 0 (or anything else)
686
686
+
if$
687
687
+
}
688
688
+
if$
689
689
+
}
690
690
+
691
691
+
% If inlinelinks is true, then format.url should be a no-op, since it's
692
692
+
% (a) redundant, and (b) could end up as a link-within-a-link.
693
693
+
FUNCTION {format.url}
694
694
+
{ inlinelinks #1 = url empty$ or
695
695
+
{ "" }
696
696
+
{ hrefform #1 =
697
697
+
{ % special case -- add HyperTeX specials
698
698
+
urlintro "\url{" url * "}" * url make.href.hypertex * }
699
699
+
{ urlintro "\url{" * url * "}" * }
700
700
+
if$
701
701
+
}
702
702
+
if$
703
703
+
}
704
704
+
FUNCTION {format.eprint}
705
705
+
{ eprint empty$
706
706
+
{ "" }
707
707
+
{ eprintprefix eprint * eprinturl eprint * make.href }
708
708
+
if$
709
709
+
}
710
710
+
711
711
+
FUNCTION {format.doi}
712
712
+
{ doi empty$
713
713
+
{ "" }
714
714
+
{ doiprefix doi * doiurl doi * make.href }
715
715
+
if$
716
716
+
}
717
717
+
718
718
+
FUNCTION {format.pubmed}
719
719
+
{ pubmed empty$
720
720
+
{ "" }
721
721
+
{ pubmedprefix pubmed * pubmedurl pubmed * make.href }
722
722
+
if$
723
723
+
}
724
724
+
725
725
+
% Output a URL. We can't use the more normal idiom (something like
726
726
+
% `format.url output'), because the `inbrackets' within
727
727
+
% format.lastchecked applies to everything between calls to `output',
728
728
+
% so that `format.url format.lastchecked * output' ends up with both
729
729
+
% the URL and the lastchecked in brackets.
730
730
+
FUNCTION {output.url}
731
731
+
{ url empty$
732
732
+
'skip$
733
733
+
{ new.block
734
734
+
format.url output
735
735
+
format.lastchecked output
736
736
+
}
737
737
+
if$
738
738
+
}
739
739
+
740
740
+
FUNCTION {output.web.refs}
741
741
+
{
742
742
+
new.block
743
743
+
inlinelinks
744
744
+
'skip$ % links were inline -- don't repeat them
745
745
+
{ % If the generated DOI will be the same as the URL,
746
746
+
% then don't print the URL (thanks to Joseph Wright for this code,
747
747
+
% at http://tex.stackexchange.com/questions/5660)
748
748
+
adddoiresolver
749
749
+
doiurl doi empty$ { "X" } { doi } if$ * % DOI URL to be generated
750
750
+
url empty$ { "Y" } { url } if$ % the URL, or "Y" if empty
751
751
+
= % are the strings equal?
752
752
+
and
753
753
+
'skip$
754
754
+
{ output.url }
755
755
+
if$
756
756
+
addeprints eprint empty$ not and
757
757
+
{ format.eprint output.nonnull }
758
758
+
'skip$
759
759
+
if$
760
760
+
adddoiresolver doi empty$ not and
761
761
+
{ format.doi output.nonnull }
762
762
+
'skip$
763
763
+
if$
764
764
+
addpubmedresolver pubmed empty$ not and
765
765
+
{ format.pubmed output.nonnull }
766
766
+
'skip$
767
767
+
if$
768
768
+
}
769
769
+
if$
770
770
+
}
771
771
+
772
772
+
% Wrapper for output.bibitem.original.
773
773
+
% If the URL field is not empty, set makeinlinelink to be true,
774
774
+
% so that an inline link will be started at the next opportunity
775
775
+
FUNCTION {output.bibitem}
776
776
+
{ outside.brackets 'bracket.state :=
777
777
+
output.bibitem.original
778
778
+
inlinelinks url empty$ not doi empty$ not or pubmed empty$ not or eprint empty$ not or and
779
779
+
{ #1 'makeinlinelink := }
780
780
+
{ #0 'makeinlinelink := }
781
781
+
if$
782
782
+
}
783
783
+
784
784
+
% Wrapper for fin.entry.original
785
785
+
FUNCTION {fin.entry}
786
786
+
{ output.web.refs % urlbst
787
787
+
makeinlinelink % ooops, it appears we didn't have a title for inlinelink
788
788
+
{ possibly.setup.inlinelink % add some artificial link text here, as a fallback
789
789
+
linktextstring output.nonnull }
790
790
+
'skip$
791
791
+
if$
792
792
+
bracket.state close.brackets = % urlbst
793
793
+
{ "]" * }
794
794
+
'skip$
795
795
+
if$
796
796
+
fin.entry.original
797
797
+
}
798
798
+
799
799
+
% Webpage entry type.
800
800
+
% Title and url fields required;
801
801
+
% author, note, year, month, and lastchecked fields optional
802
802
+
% See references
803
803
+
% ISO 690-2 http://www.nlc-bnc.ca/iso/tc46sc9/standard/690-2e.htm
804
804
+
% http://www.classroom.net/classroom/CitingNetResources.html
805
805
+
% http://neal.ctstateu.edu/history/cite.html
806
806
+
% http://www.cas.usf.edu/english/walker/mla.html
807
807
+
% for citation formats for web pages.
808
808
+
FUNCTION {webpage}
809
809
+
{ output.bibitem
810
810
+
author empty$
811
811
+
{ editor empty$
812
812
+
'skip$ % author and editor both optional
813
813
+
{ format.editors output.nonnull }
814
814
+
if$
815
815
+
}
816
816
+
{ editor empty$
817
817
+
{ format.authors output.nonnull }
818
818
+
{ "can't use both author and editor fields in " cite$ * warning$ }
819
819
+
if$
820
820
+
}
821
821
+
if$
822
822
+
new.block
823
823
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$
824
824
+
format.title "title" output.check
825
825
+
inbrackets onlinestring output
826
826
+
new.block
827
827
+
year empty$
828
828
+
'skip$
829
829
+
{ format.date "year" output.check }
830
830
+
if$
831
831
+
% We don't need to output the URL details ('lastchecked' and 'url'),
832
832
+
% because fin.entry does that for us, using output.web.refs. The only
833
833
+
% reason we would want to put them here is if we were to decide that
834
834
+
% they should go in front of the rather miscellaneous information in 'note'.
835
835
+
new.block
836
836
+
note output
837
837
+
fin.entry
838
838
+
}
839
839
+
% ...urlbst to here
840
840
+
841
841
+
842
842
+
FUNCTION {article}
843
843
+
{ output.bibitem
844
844
+
format.authors "author" output.check
845
845
+
author format.key output % special for
846
846
+
output.year.check % apalike
847
847
+
new.block
848
848
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
849
849
+
format.title "title" output.check
850
850
+
new.block
851
851
+
crossref missing$
852
852
+
{ journal emphasize "journal" output.check
853
853
+
possibly.setup.inlinelink format.vol.num.pages output% urlbst
854
854
+
}
855
855
+
{ format.article.crossref output.nonnull
856
856
+
format.pages output
857
857
+
}
858
858
+
if$
859
859
+
new.block
860
860
+
note output
861
861
+
fin.entry
862
862
+
}
863
863
+
864
864
+
FUNCTION {book}
865
865
+
{ output.bibitem
866
866
+
author empty$
867
867
+
{ format.editors "author and editor" output.check
868
868
+
editor format.key output
869
869
+
}
870
870
+
{ format.authors output.nonnull
871
871
+
crossref missing$
872
872
+
{ "author and editor" editor either.or.check }
873
873
+
'skip$
874
874
+
if$
875
875
+
}
876
876
+
if$
877
877
+
output.year.check % special for apalike
878
878
+
new.block
879
879
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
880
880
+
format.btitle "title" output.check
881
881
+
crossref missing$
882
882
+
{ format.bvolume output
883
883
+
new.block
884
884
+
format.number.series output
885
885
+
new.sentence
886
886
+
publisher "publisher" output.check
887
887
+
address output
888
888
+
}
889
889
+
{ new.block
890
890
+
format.book.crossref output.nonnull
891
891
+
}
892
892
+
if$
893
893
+
format.edition output
894
894
+
new.block
895
895
+
note output
896
896
+
fin.entry
897
897
+
}
898
898
+
899
899
+
FUNCTION {booklet}
900
900
+
{ output.bibitem
901
901
+
format.authors output
902
902
+
author format.key output % special for
903
903
+
output.year.check % apalike
904
904
+
new.block
905
905
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
906
906
+
format.title "title" output.check
907
907
+
new.block
908
908
+
howpublished output
909
909
+
address output
910
910
+
new.block
911
911
+
note output
912
912
+
fin.entry
913
913
+
}
914
914
+
915
915
+
FUNCTION {inbook}
916
916
+
{ output.bibitem
917
917
+
author empty$
918
918
+
{ format.editors "author and editor" output.check
919
919
+
editor format.key output
920
920
+
}
921
921
+
{ format.authors output.nonnull
922
922
+
crossref missing$
923
923
+
{ "author and editor" editor either.or.check }
924
924
+
'skip$
925
925
+
if$
926
926
+
}
927
927
+
if$
928
928
+
output.year.check % special for apalike
929
929
+
new.block
930
930
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
931
931
+
format.btitle "title" output.check
932
932
+
crossref missing$
933
933
+
{ format.bvolume output
934
934
+
format.chapter.pages "chapter and pages" output.check
935
935
+
new.block
936
936
+
format.number.series output
937
937
+
new.sentence
938
938
+
publisher "publisher" output.check
939
939
+
address output
940
940
+
}
941
941
+
{ format.chapter.pages "chapter and pages" output.check
942
942
+
new.block
943
943
+
format.book.crossref output.nonnull
944
944
+
}
945
945
+
if$
946
946
+
format.edition output
947
947
+
new.block
948
948
+
note output
949
949
+
fin.entry
950
950
+
}
951
951
+
952
952
+
FUNCTION {incollection}
953
953
+
{ output.bibitem
954
954
+
format.authors "author" output.check
955
955
+
author format.key output % special for
956
956
+
output.year.check % apalike
957
957
+
new.block
958
958
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
959
959
+
format.title "title" output.check
960
960
+
new.block
961
961
+
crossref missing$
962
962
+
{ format.in.ed.booktitle "booktitle" output.check
963
963
+
format.bvolume output
964
964
+
format.number.series output
965
965
+
format.chapter.pages output
966
966
+
new.sentence
967
967
+
publisher "publisher" output.check
968
968
+
address output
969
969
+
format.edition output
970
970
+
}
971
971
+
{ format.incoll.inproc.crossref output.nonnull
972
972
+
format.chapter.pages output
973
973
+
}
974
974
+
if$
975
975
+
new.block
976
976
+
note output
977
977
+
fin.entry
978
978
+
}
979
979
+
980
980
+
FUNCTION {inproceedings}
981
981
+
{ output.bibitem
982
982
+
format.authors "author" output.check
983
983
+
author format.key output % special for
984
984
+
output.year.check % apalike
985
985
+
new.block
986
986
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
987
987
+
format.title "title" output.check
988
988
+
new.block
989
989
+
crossref missing$
990
990
+
{ format.in.ed.booktitle "booktitle" output.check
991
991
+
format.bvolume output
992
992
+
format.number.series output
993
993
+
format.pages output
994
994
+
address output % for apalike
995
995
+
new.sentence % there's no year
996
996
+
organization output % here so things
997
997
+
publisher output % are simpler
998
998
+
}
999
999
+
{ format.incoll.inproc.crossref output.nonnull
1000
1000
+
format.pages output
1001
1001
+
}
1002
1002
+
if$
1003
1003
+
new.block
1004
1004
+
note output
1005
1005
+
fin.entry
1006
1006
+
}
1007
1007
+
1008
1008
+
FUNCTION {conference} { inproceedings }
1009
1009
+
1010
1010
+
FUNCTION {manual}
1011
1011
+
{ output.bibitem
1012
1012
+
format.authors output
1013
1013
+
author format.key output % special for
1014
1014
+
output.year.check % apalike
1015
1015
+
new.block
1016
1016
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
1017
1017
+
format.btitle "title" output.check
1018
1018
+
organization address new.block.checkb
1019
1019
+
organization output
1020
1020
+
address output
1021
1021
+
format.edition output
1022
1022
+
new.block
1023
1023
+
note output
1024
1024
+
fin.entry
1025
1025
+
}
1026
1026
+
1027
1027
+
FUNCTION {mastersthesis}
1028
1028
+
{ output.bibitem
1029
1029
+
format.authors "author" output.check
1030
1030
+
author format.key output % special for
1031
1031
+
output.year.check % apalike
1032
1032
+
new.block
1033
1033
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
1034
1034
+
format.title "title" output.check
1035
1035
+
new.block
1036
1036
+
"Master's thesis" format.thesis.type output.nonnull
1037
1037
+
school "school" output.check
1038
1038
+
address output
1039
1039
+
new.block
1040
1040
+
note output
1041
1041
+
fin.entry
1042
1042
+
}
1043
1043
+
1044
1044
+
FUNCTION {misc}
1045
1045
+
{ output.bibitem
1046
1046
+
format.authors output
1047
1047
+
author format.key output % special for
1048
1048
+
output.year.check % apalike
1049
1049
+
new.block
1050
1050
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
1051
1051
+
format.title output
1052
1052
+
new.block
1053
1053
+
howpublished output
1054
1054
+
new.block
1055
1055
+
note output
1056
1056
+
fin.entry
1057
1057
+
}
1058
1058
+
1059
1059
+
FUNCTION {phdthesis}
1060
1060
+
{ output.bibitem
1061
1061
+
format.authors "author" output.check
1062
1062
+
author format.key output % special for
1063
1063
+
output.year.check % apalike
1064
1064
+
new.block
1065
1065
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
1066
1066
+
format.btitle "title" output.check
1067
1067
+
new.block
1068
1068
+
"PhD thesis" format.thesis.type output.nonnull
1069
1069
+
school "school" output.check
1070
1070
+
address output
1071
1071
+
new.block
1072
1072
+
note output
1073
1073
+
fin.entry
1074
1074
+
}
1075
1075
+
1076
1076
+
FUNCTION {proceedings}
1077
1077
+
{ output.bibitem
1078
1078
+
format.editors output
1079
1079
+
editor format.key output % special for
1080
1080
+
output.year.check % apalike
1081
1081
+
new.block
1082
1082
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
1083
1083
+
format.btitle "title" output.check
1084
1084
+
format.bvolume output
1085
1085
+
format.number.series output
1086
1086
+
address output % for apalike
1087
1087
+
new.sentence % we always output
1088
1088
+
organization output % a nonempty organization
1089
1089
+
publisher output % here
1090
1090
+
new.block
1091
1091
+
note output
1092
1092
+
fin.entry
1093
1093
+
}
1094
1094
+
1095
1095
+
FUNCTION {techreport}
1096
1096
+
{ output.bibitem
1097
1097
+
format.authors "author" output.check
1098
1098
+
author format.key output % special for
1099
1099
+
output.year.check % apalike
1100
1100
+
new.block
1101
1101
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
1102
1102
+
format.title "title" output.check
1103
1103
+
new.block
1104
1104
+
format.tr.number output.nonnull
1105
1105
+
institution "institution" output.check
1106
1106
+
address output
1107
1107
+
new.block
1108
1108
+
note output
1109
1109
+
fin.entry
1110
1110
+
}
1111
1111
+
1112
1112
+
FUNCTION {unpublished}
1113
1113
+
{ output.bibitem
1114
1114
+
format.authors "author" output.check
1115
1115
+
author format.key output % special for
1116
1116
+
output.year.check % apalike
1117
1117
+
new.block
1118
1118
+
title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
1119
1119
+
format.title "title" output.check
1120
1120
+
new.block
1121
1121
+
note "note" output.check
1122
1122
+
fin.entry
1123
1123
+
}
1124
1124
+
1125
1125
+
FUNCTION {default.type} { misc }
1126
1126
+
1127
1127
+
MACRO {jan} {"January"}
1128
1128
+
1129
1129
+
MACRO {feb} {"February"}
1130
1130
+
1131
1131
+
MACRO {mar} {"March"}
1132
1132
+
1133
1133
+
MACRO {apr} {"April"}
1134
1134
+
1135
1135
+
MACRO {may} {"May"}
1136
1136
+
1137
1137
+
MACRO {jun} {"June"}
1138
1138
+
1139
1139
+
MACRO {jul} {"July"}
1140
1140
+
1141
1141
+
MACRO {aug} {"August"}
1142
1142
+
1143
1143
+
MACRO {sep} {"September"}
1144
1144
+
1145
1145
+
MACRO {oct} {"October"}
1146
1146
+
1147
1147
+
MACRO {nov} {"November"}
1148
1148
+
1149
1149
+
MACRO {dec} {"December"}
1150
1150
+
1151
1151
+
MACRO {acmcs} {"ACM Computing Surveys"}
1152
1152
+
1153
1153
+
MACRO {acta} {"Acta Informatica"}
1154
1154
+
1155
1155
+
MACRO {cacm} {"Communications of the ACM"}
1156
1156
+
1157
1157
+
MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1158
1158
+
1159
1159
+
MACRO {ibmsj} {"IBM Systems Journal"}
1160
1160
+
1161
1161
+
MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1162
1162
+
1163
1163
+
MACRO {ieeetc} {"IEEE Transactions on Computers"}
1164
1164
+
1165
1165
+
MACRO {ieeetcad}
1166
1166
+
{"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1167
1167
+
1168
1168
+
MACRO {ipl} {"Information Processing Letters"}
1169
1169
+
1170
1170
+
MACRO {jacm} {"Journal of the ACM"}
1171
1171
+
1172
1172
+
MACRO {jcss} {"Journal of Computer and System Sciences"}
1173
1173
+
1174
1174
+
MACRO {scp} {"Science of Computer Programming"}
1175
1175
+
1176
1176
+
MACRO {sicomp} {"SIAM Journal on Computing"}
1177
1177
+
1178
1178
+
MACRO {tocs} {"ACM Transactions on Computer Systems"}
1179
1179
+
1180
1180
+
MACRO {tods} {"ACM Transactions on Database Systems"}
1181
1181
+
1182
1182
+
MACRO {tog} {"ACM Transactions on Graphics"}
1183
1183
+
1184
1184
+
MACRO {toms} {"ACM Transactions on Mathematical Software"}
1185
1185
+
1186
1186
+
MACRO {toois} {"ACM Transactions on Office Information Systems"}
1187
1187
+
1188
1188
+
MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1189
1189
+
1190
1190
+
MACRO {tcs} {"Theoretical Computer Science"}
1191
1191
+
1192
1192
+
READ
1193
1193
+
1194
1194
+
FUNCTION {sortify}
1195
1195
+
{ purify$
1196
1196
+
"l" change.case$
1197
1197
+
}
1198
1198
+
1199
1199
+
INTEGERS { len }
1200
1200
+
1201
1201
+
FUNCTION {chop.word}
1202
1202
+
{ 's :=
1203
1203
+
'len :=
1204
1204
+
s #1 len substring$ =
1205
1205
+
{ s len #1 + global.max$ substring$ }
1206
1206
+
's
1207
1207
+
if$
1208
1208
+
}
1209
1209
+
1210
1210
+
% There are three apalike cases: one person (Jones),
1211
1211
+
% two (Jones and de~Bruijn), and more (Jones et~al.).
1212
1212
+
% This function is much like format.crossref.editors.
1213
1213
+
%
1214
1214
+
FUNCTION {format.lab.names}
1215
1215
+
{ 's :=
1216
1216
+
s #1 "{vv~}{ll}" format.name$
1217
1217
+
s num.names$ duplicate$
1218
1218
+
#2 >
1219
1219
+
{ pop$ " et~al." * }
1220
1220
+
{ #2 <
1221
1221
+
'skip$
1222
1222
+
{ s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1223
1223
+
{ " et~al." * }
1224
1224
+
{ " and " * s #2 "{vv~}{ll}" format.name$ * }
1225
1225
+
if$
1226
1226
+
}
1227
1227
+
if$
1228
1228
+
}
1229
1229
+
if$
1230
1230
+
}
1231
1231
+
1232
1232
+
FUNCTION {author.key.label}
1233
1233
+
{ author empty$
1234
1234
+
{ key empty$
1235
1235
+
{ cite$ #1 #3 substring$ }
1236
1236
+
'key % apalike uses the whole key
1237
1237
+
if$
1238
1238
+
}
1239
1239
+
{ author format.lab.names }
1240
1240
+
if$
1241
1241
+
}
1242
1242
+
1243
1243
+
FUNCTION {author.editor.key.label}
1244
1244
+
{ author empty$
1245
1245
+
{ editor empty$
1246
1246
+
{ key empty$
1247
1247
+
{ cite$ #1 #3 substring$ }
1248
1248
+
'key % apalike uses the whole key
1249
1249
+
if$
1250
1250
+
}
1251
1251
+
{ editor format.lab.names }
1252
1252
+
if$
1253
1253
+
}
1254
1254
+
{ author format.lab.names }
1255
1255
+
if$
1256
1256
+
}
1257
1257
+
1258
1258
+
FUNCTION {editor.key.label}
1259
1259
+
{ editor empty$
1260
1260
+
{ key empty$
1261
1261
+
{ cite$ #1 #3 substring$ }
1262
1262
+
'key % apalike uses the whole key, no organization
1263
1263
+
if$
1264
1264
+
}
1265
1265
+
{ editor format.lab.names }
1266
1266
+
if$
1267
1267
+
}
1268
1268
+
1269
1269
+
FUNCTION {calc.label}
1270
1270
+
{ type$ "book" =
1271
1271
+
type$ "inbook" =
1272
1272
+
or
1273
1273
+
'author.editor.key.label
1274
1274
+
{ type$ "proceedings" =
1275
1275
+
'editor.key.label % apalike ignores organization
1276
1276
+
'author.key.label % for labeling and sorting
1277
1277
+
if$
1278
1278
+
}
1279
1279
+
if$
1280
1280
+
", " % these three lines are
1281
1281
+
* % for apalike, which
1282
1282
+
year field.or.null purify$ #-1 #4 substring$ % uses all four digits
1283
1283
+
*
1284
1284
+
'label :=
1285
1285
+
}
1286
1286
+
1287
1287
+
FUNCTION {sort.format.names}
1288
1288
+
{ 's :=
1289
1289
+
#1 'nameptr :=
1290
1290
+
""
1291
1291
+
s num.names$ 'numnames :=
1292
1292
+
numnames 'namesleft :=
1293
1293
+
{ namesleft #0 > }
1294
1294
+
{ nameptr #1 >
1295
1295
+
{ " " * }
1296
1296
+
'skip$
1297
1297
+
if$ % apalike uses initials
1298
1298
+
s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't := % <= here
1299
1299
+
nameptr numnames = t "others" = and
1300
1300
+
{ "et al" * }
1301
1301
+
{ t sortify * }
1302
1302
+
if$
1303
1303
+
nameptr #1 + 'nameptr :=
1304
1304
+
namesleft #1 - 'namesleft :=
1305
1305
+
}
1306
1306
+
while$
1307
1307
+
}
1308
1308
+
1309
1309
+
FUNCTION {sort.format.title}
1310
1310
+
{ 't :=
1311
1311
+
"A " #2
1312
1312
+
"An " #3
1313
1313
+
"The " #4 t chop.word
1314
1314
+
chop.word
1315
1315
+
chop.word
1316
1316
+
sortify
1317
1317
+
#1 global.max$ substring$
1318
1318
+
}
1319
1319
+
1320
1320
+
FUNCTION {author.sort}
1321
1321
+
{ author empty$
1322
1322
+
{ key empty$
1323
1323
+
{ "to sort, need author or key in " cite$ * warning$
1324
1324
+
""
1325
1325
+
}
1326
1326
+
{ key sortify }
1327
1327
+
if$
1328
1328
+
}
1329
1329
+
{ author sort.format.names }
1330
1330
+
if$
1331
1331
+
}
1332
1332
+
1333
1333
+
FUNCTION {author.editor.sort}
1334
1334
+
{ author empty$
1335
1335
+
{ editor empty$
1336
1336
+
{ key empty$
1337
1337
+
{ "to sort, need author, editor, or key in " cite$ * warning$
1338
1338
+
""
1339
1339
+
}
1340
1340
+
{ key sortify }
1341
1341
+
if$
1342
1342
+
}
1343
1343
+
{ editor sort.format.names }
1344
1344
+
if$
1345
1345
+
}
1346
1346
+
{ author sort.format.names }
1347
1347
+
if$
1348
1348
+
}
1349
1349
+
1350
1350
+
FUNCTION {editor.sort}
1351
1351
+
{ editor empty$
1352
1352
+
{ key empty$
1353
1353
+
{ "to sort, need editor or key in " cite$ * warning$
1354
1354
+
""
1355
1355
+
}
1356
1356
+
{ key sortify }
1357
1357
+
if$
1358
1358
+
}
1359
1359
+
{ editor sort.format.names }
1360
1360
+
if$
1361
1361
+
}
1362
1362
+
1363
1363
+
% apalike uses two sorting passes; the first one sets the
1364
1364
+
% labels so that the `a's, `b's, etc. can be computed;
1365
1365
+
% the second pass puts the references in "correct" order.
1366
1366
+
% The presort function is for the first pass. It computes
1367
1367
+
% label, sort.label, and title, and then concatenates.
1368
1368
+
FUNCTION {presort}
1369
1369
+
{ calc.label
1370
1370
+
label sortify
1371
1371
+
" "
1372
1372
+
*
1373
1373
+
type$ "book" =
1374
1374
+
type$ "inbook" =
1375
1375
+
or
1376
1376
+
'author.editor.sort
1377
1377
+
{ type$ "proceedings" =
1378
1378
+
'editor.sort
1379
1379
+
'author.sort
1380
1380
+
if$
1381
1381
+
}
1382
1382
+
if$
1383
1383
+
#1 entry.max$ substring$ % for
1384
1384
+
'sort.label := % apalike
1385
1385
+
sort.label % style
1386
1386
+
*
1387
1387
+
" "
1388
1388
+
*
1389
1389
+
title field.or.null
1390
1390
+
sort.format.title
1391
1391
+
*
1392
1392
+
#1 entry.max$ substring$
1393
1393
+
'sort.key$ :=
1394
1394
+
}
1395
1395
+
1396
1396
+
ITERATE {presort}
1397
1397
+
1398
1398
+
SORT % by label, sort.label, title---for final label calculation
1399
1399
+
1400
1400
+
STRINGS { last.label next.extra } % apalike labels are only for the text;
1401
1401
+
1402
1402
+
INTEGERS { last.extra.num } % there are none in the bibliography
1403
1403
+
1404
1404
+
FUNCTION {initialize.extra.label.stuff} % and hence there is no `longest.label'
1405
1405
+
{ #0 int.to.chr$ 'last.label :=
1406
1406
+
"" 'next.extra :=
1407
1407
+
#0 'last.extra.num :=
1408
1408
+
}
1409
1409
+
1410
1410
+
FUNCTION {forward.pass}
1411
1411
+
{ last.label label =
1412
1412
+
{ last.extra.num #1 + 'last.extra.num :=
1413
1413
+
last.extra.num int.to.chr$ 'extra.label :=
1414
1414
+
}
1415
1415
+
{ "a" chr.to.int$ 'last.extra.num :=
1416
1416
+
"" 'extra.label :=
1417
1417
+
label 'last.label :=
1418
1418
+
}
1419
1419
+
if$
1420
1420
+
}
1421
1421
+
1422
1422
+
FUNCTION {reverse.pass}
1423
1423
+
{ next.extra "b" =
1424
1424
+
{ "a" 'extra.label := }
1425
1425
+
'skip$
1426
1426
+
if$
1427
1427
+
label extra.label * 'label :=
1428
1428
+
extra.label 'next.extra :=
1429
1429
+
}
1430
1430
+
1431
1431
+
EXECUTE {initialize.extra.label.stuff}
1432
1432
+
1433
1433
+
ITERATE {forward.pass}
1434
1434
+
1435
1435
+
REVERSE {reverse.pass}
1436
1436
+
1437
1437
+
% Now that the label is right we sort for real,
1438
1438
+
% on sort.label then year then title. This is
1439
1439
+
% for the second sorting pass.
1440
1440
+
FUNCTION {bib.sort.order}
1441
1441
+
{ sort.label
1442
1442
+
" "
1443
1443
+
*
1444
1444
+
year field.or.null sortify
1445
1445
+
*
1446
1446
+
" "
1447
1447
+
*
1448
1448
+
title field.or.null
1449
1449
+
sort.format.title
1450
1450
+
*
1451
1451
+
#1 entry.max$ substring$
1452
1452
+
'sort.key$ :=
1453
1453
+
}
1454
1454
+
1455
1455
+
ITERATE {bib.sort.order}
1456
1456
+
1457
1457
+
SORT % by sort.label, year, title---giving final bibliography order
1458
1458
+
1459
1459
+
FUNCTION {begin.bib}
1460
1460
+
{ preamble$ empty$ % no \etalchar in apalike
1461
1461
+
'skip$
1462
1462
+
{ preamble$ write$ newline$ }
1463
1463
+
if$
1464
1464
+
"\begin{thebibliography}{}" write$ newline$ % no labels in apalike
1465
1465
+
}
1466
1466
+
1467
1467
+
EXECUTE {begin.bib}
1468
1468
+
1469
1469
+
EXECUTE {init.urlbst.variables} % urlbst
1470
1470
+
EXECUTE {init.state.consts}
1471
1471
+
1472
1472
+
ITERATE {call.type$}
1473
1473
+
1474
1474
+
FUNCTION {end.bib}
1475
1475
+
{ newline$
1476
1476
+
"\end{thebibliography}" write$ newline$
1477
1477
+
}
1478
1478
+
1479
1479
+
EXECUTE {end.bib}
+4
-1
mscs.tex
···
65
65
\maketitle
66
66
\input{nodes/body}
67
67
68
68
-
\bibliographystyle{msclike}
68
68
+
\section*{Competing interests}
69
69
+
The author declares none
70
70
+
71
71
+
\bibliographystyle{msclike-url}
69
72
\bibliography{references/refs-bibtex}
70
73
71
74
\end{document}