/utphys

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/utphys/

« back to all changes in this revision

Viewing changes to hyperamsalpha.bst

  • Committer: Jacques Distler
  • Date: 2010-07-04 17:42:01 UTC
  • Revision ID: distler@golem.ph.utexas.edu-20100704174201-ddwfyriylmkj6br9
Journal Number

Restore journal number output.
Also fix some deprecated font constructions.
Both reported by Mateus Araujo.

Show diffs side-by-side

added added

removed removed

1
 
% Hypertex version of the AMSalpha bibliographic style, ver. 0.8, Based on:
2
 
%
3
 
%%% ====================================================================
4
 
%%%  @BibTeX-style-file{
5
 
%%%     filename        = "amsalpha.bst",
6
 
%%%     version         = "2.0",
7
 
%%%     date            = "2000/03/27",
8
 
%%%     time            = "13:49:36 EST",
9
 
%%%     checksum        = "00166 1404 4124 29978",
10
 
%%%     author          = "American Mathematical Society",
11
 
%%%     address         = "American Mathematical Society,
12
 
%%%                        Technical Support,
13
 
%%%                        Electronic Products and Services,
14
 
%%%                        P. O. Box 6248,
15
 
%%%                        Providence, RI 02940,
16
 
%%%                        USA",
17
 
%%%     telephone       = "401-455-4080 or (in the USA and Canada)
18
 
%%%                        800-321-4AMS (321-4267)",
19
 
%%%     FAX             = "401-331-3842",
20
 
%%%     email           = "tech-support@ams.org (Internet)",
21
 
%%%     copyright       = "Copyright 1995 American Mathematical Society,
22
 
%%%                        all rights reserved.  Copying of this file is
23
 
%%%                        authorized only if either:
24
 
%%%                        (1) you make absolutely no changes to your copy,
25
 
%%%                        including name; OR
26
 
%%%                        (2) if you do make changes, you first rename it
27
 
%%%                        to some other name.",
28
 
%%%     codetable       = "ISO/ASCII",
29
 
%%%     keywords        = "bibtex, bibliography, amslatex, ams-latex",
30
 
%%%     supported       = "yes",
31
 
%%%     abstract        = "BibTeX bibliography style `amsalpha' for BibTeX
32
 
%%%                        versions 0.99a or later and LaTeX version 2e.
33
 
%%%                        Produces alphabetic-label bibliography items in
34
 
%%%                        a form typical for American Mathematical Society
35
 
%%%                        publications.",
36
 
%%%     docstring       = "The checksum field above contains a CRC-16
37
 
%%%                        checksum as the first value, followed by the
38
 
%%%                        equivalent of the standard UNIX wc (word
39
 
%%%                        count) utility output of lines, words, and
40
 
%%%                        characters.  This is produced by Robert
41
 
%%%                        Solovay's checksum utility.",
42
 
%%%  }
43
 
%%% ====================================================================
44
 
 
45
 
%    Modified by Jacques Distler, 7/2010
46
 
%
47
 
%  Added support for Eprint archives.
48
 
%     doi support
49
 
%     url, collaboration, report and SLACcitation fields 
50
 
%
51
 
% HyperTeX Wizardry:
52
 
%
53
 
% The following are equivalent:
54
 
%   archive  =  arXiv
55
 
%   eprint   = "hep-th/9605023"
56
 
% and
57
 
%   eprint   = "hep-th/9605023"
58
 
% both produce 
59
 
%
60
 
%    \href{http://arxiv.org/abs/hep-th/9605023}{{\tt hep-th/9605023}}
61
 
%
62
 
% in the bibliographic output at the appropriate point. More generally,
63
 
% if the archive field is present, we produce a URL of the form
64
 
% "archive/eprint" as the first argument of the \href. If absent, the base
65
 
% URL defaults to "http://arxiv.org/abs"
66
 
% If you are using a hypertex macropackage, like hyperref.sty, this command
67
 
% will create a link to the eprint at Los Alamos (or wherever).
68
 
%
69
 
% "New-style" arXiv identifiers are also supported.
70
 
%
71
 
%     archivePrefix = "arXiv",
72
 
%     eprint    = "0707.3168",
73
 
%     primaryClass = "hep-th",
74
 
%
75
 
% produces
76
 
%
77
 
%     \href{http://arxiv.org/abs/0707.3168}{{\tt arXiv:0707.3168 [hep-th]}}
78
 
%
79
 
% Another (non-arXiv) example:
80
 
%
81
 
%     archive = "http://cogprints.org",
82
 
%     eprint = "5542",
83
 
%     archivePrefix = "Cogprints",
84
 
%
85
 
%  produces
86
 
%
87
 
%     \href{http://cogprints.org/5542}{{\tt Cogprints:5542}}
88
 
%
89
 
%  If a
90
 
%
91
 
%       doi = "10.xxxx"
92
 
%
93
 
%  field is present, then the journal reference becomes a
94
 
%  clickable hyperlink to the online journal version of the paper.
95
 
%
96
 
% The bibtex output produced by SPIRES, while far from perfect, is pretty
97
 
% suitable for use with this style. Indeed, this style was designed with
98
 
% SPIRES in mind.
99
 
 
100
 
 
101
 
% See the file btxbst.doc for extra documentation other than
102
 
% what is included here.  And see btxhak.tex for a description
103
 
% of the BibTeX language and how to use it.
104
 
 
105
 
% This defines the types of fields that can occur in a database entry
106
 
% for this particular bibliography style.  Except for `language',
107
 
% this is the standard list from alpha.bst.
108
 
 
109
 
%% Types of entries currently allowed in a BibTeX file:
110
 
%%
111
 
%% ARTICLE -- An article from a journal or magazine.
112
 
%%
113
 
%% BOOK -- A book with an explicit publisher.
114
 
%%
115
 
%% BOOKLET -- A work that is printed and bound,
116
 
%% but without a named publisher or sponsoring institution.
117
 
%%
118
 
%% CONFERENCE -- The same as INPROCEEDINGS,
119
 
%% included for Scribe compatibility.
120
 
%%
121
 
%% INBOOK -- A part of a book,
122
 
%% which may be a chapter (or section or whatever) and/or a range of pages.
123
 
%%
124
 
%% INCOLLECTION -- A part of a book having its own title.
125
 
%%
126
 
%% INPROCEEDINGS -- An article in a conference proceedings.
127
 
%%
128
 
%% MANUAL -- Technical documentation.
129
 
%%
130
 
%% MASTERSTHESIS -- A Master's thesis.
131
 
%%
132
 
%% MISC -- Use this type when nothing else fits.
133
 
%%
134
 
%% PHDTHESIS -- A PhD thesis.
135
 
%%
136
 
%% PROCEEDINGS -- The proceedings of a conference.
137
 
%%
138
 
%% TECHREPORT -- A report published by a school or other institution,
139
 
%% usually numbered within a series.
140
 
%%
141
 
%% UNPUBLISHED -- A document having an author and title, but not formally
142
 
%% published.
143
 
 
144
 
ENTRY
145
 
 { address
146
 
   author
147
 
   booktitle
148
 
   chapter
149
 
   edition
150
 
   editor
151
 
   howpublished
152
 
   institution
153
 
   journal
154
 
   key
155
 
   language
156
 
   month
157
 
   mrnumber
158
 
   note
159
 
   number
160
 
   organization
161
 
   pages
162
 
   publisher
163
 
   school
164
 
   series
165
 
   title
166
 
   type
167
 
   volume
168
 
   year
169
 
    archive
170
 
    archivePrefix
171
 
    collaboration
172
 
    doi
173
 
    eprint
174
 
    primaryClass
175
 
    report
176
 
    SLACcitation
177
 
    url
178
 
 }
179
 
 {}
180
 
 { label extra.label sort.label bysame }
181
 
 
182
 
% Removed after.sentence, after.block---not needed.
183
 
 
184
 
INTEGERS { output.state before.all mid.sentence after.quote after.sentence
185
 
                after.quoted.block after.block }
186
 
 
187
 
FUNCTION {init.state.consts}
188
 
{ #0 'before.all :=
189
 
  #1 'mid.sentence :=
190
 
  #2 'after.quote :=
191
 
  #3 'after.sentence :=
192
 
  #4 'after.quoted.block :=
193
 
  #5 'after.block :=
194
 
}
195
 
 
196
 
% Scratch variables:
197
 
 
198
 
STRINGS { s t }
199
 
 
200
 
% Utility functions
201
 
 
202
 
FUNCTION {shows}
203
 
{ duplicate$ "::::  `" swap$ * "'" * top$
204
 
}
205
 
 
206
 
FUNCTION {showstack}
207
 
{"STACK====================================================================="
208
 
top$
209
 
stack$
210
 
"ENDSTACK=================================================================="
211
 
top$
212
 
}
213
 
 
214
 
FUNCTION {not}
215
 
{   { #0 }
216
 
   { #1 }
217
 
 if$
218
 
}
219
 
 
220
 
FUNCTION {and}
221
 
{   'skip$
222
 
   { pop$ #0 }
223
 
 if$
224
 
}
225
 
 
226
 
FUNCTION {or}
227
 
{   { pop$ #1 }
228
 
   'skip$
229
 
 if$
230
 
}
231
 
 
232
 
FUNCTION {field.or.null}
233
 
{ duplicate$ empty$
234
 
   { pop$ "" }
235
 
   'skip$
236
 
 if$
237
 
}
238
 
 
239
 
FUNCTION {emphasize}
240
 
{ duplicate$ empty$
241
 
   { pop$ "" }
242
 
   { "\emph{" swap$ * "}" * }
243
 
 if$
244
 
}
245
 
 
246
 
FUNCTION {tt}
247
 
{ duplicate$ empty$
248
 
   { pop$ "" }
249
 
   { "{\tt " swap$ * "}" * }
250
 
 if$
251
 
}
252
 
 
253
 
% n.dashify is used to make sure page ranges get the TeX code
254
 
% (two hyphens) for en-dashes.
255
 
 
256
 
FUNCTION {n.dashify}
257
 
{ 't :=
258
 
 ""
259
 
   { t empty$ not }
260
 
   { t #1 #1 substring$ "-" =
261
 
        { t #1 #2 substring$ "--" = not
262
 
            { "--" *
263
 
              t #2 global.max$ substring$ 't :=
264
 
            }
265
 
            {   { t #1 #1 substring$ "-" = }
266
 
                { "-" *
267
 
                  t #2 global.max$ substring$ 't :=
268
 
                }
269
 
              while$
270
 
            }
271
 
          if$
272
 
        }
273
 
        { t #1 #1 substring$ *
274
 
          t #2 global.max$ substring$ 't :=
275
 
        }
276
 
     if$
277
 
   }
278
 
 while$
279
 
}
280
 
 
281
 
% tie.or.space.connect connects two items with a ~ if the
282
 
% second item is less than 3 letters long, otherwise it just puts an
283
 
% ordinary space.
284
 
 
285
 
FUNCTION {tie.or.space.connect}
286
 
{ duplicate$ text.length$ #3 <
287
 
   { "~" }
288
 
   { " " }
289
 
 if$
290
 
 swap$ * *
291
 
}
292
 
 
293
 
FUNCTION {add.space.if.necessary}
294
 
{ duplicate$ "" =
295
 
   'skip$
296
 
   { " " * }
297
 
 if$
298
 
}
299
 
 
300
 
% either.or.check gives a warning if two mutually exclusive fields
301
 
% were used in the database.
302
 
 
303
 
FUNCTION {either.or.check}
304
 
{ empty$
305
 
   'pop$
306
 
   { "can't use both " swap$ * " fields in " * cite$ * warning$ }
307
 
 if$
308
 
}
309
 
 
310
 
% output.nonnull is called by output.
311
 
 
312
 
FUNCTION {output.nonnull}
313
 
% remove the top item from the stack because it's in the way.
314
 
{ 's :=
315
 
 output.state mid.sentence =
316
 
% If we're in mid-sentence, add a comma to the new top item and write it
317
 
   { ", " * write$ }
318
 
% Otherwise, if we're at the beginning of a bibitem,
319
 
   { output.state before.all =
320
 
% just write out the top item from the stack;
321
 
     'write$
322
 
% and the last alternative is that we're at the end of the current
323
 
% bibitem, so we add a period to the top stack item and write it out.
324
 
       { add.period$ " " * write$ }
325
 
     if$
326
 
     mid.sentence 'output.state :=
327
 
   }
328
 
 if$
329
 
% Put the top item back on the stack that we removed earlier.
330
 
 s
331
 
}
332
 
 
333
 
% Output checks to see if the stack top is empty; if not, it
334
 
% calls output.nonnull to write it out.
335
 
 
336
 
FUNCTION {output}
337
 
{ duplicate$ empty$
338
 
   'pop$
339
 
   'output.nonnull
340
 
 if$
341
 
}
342
 
 
343
 
% Standard warning message for a missing or empty field. For the user
344
 
% we call any such field `missing' without respect to the distinction
345
 
% made by BibTeX between missing and empty.
346
 
 
347
 
FUNCTION {missing.warning}
348
 
{ "missing " swap$ * " in " * cite$ * warning$ }
349
 
 
350
 
% Output.check is like output except that it gives a warning on-screen
351
 
% if the given field in the database entry is empty.  t is the field
352
 
% name.
353
 
 
354
 
FUNCTION {output.check}
355
 
{ 't :=
356
 
 duplicate$ empty$
357
 
   { pop$ t missing.warning }
358
 
   'output.nonnull
359
 
 if$
360
 
}
361
 
 
362
 
FUNCTION {output.bibitem}
363
 
{ newline$
364
 
 "\bibitem[" write$
365
 
  label write$
366
 
 "]{" write$
367
 
 cite$ write$
368
 
 "}" write$
369
 
 newline$
370
 
% This empty string is the first thing that will be written
371
 
% the next time write$ is called.  Done this way because each
372
 
% item is saved on the stack until we find out what punctuation
373
 
% should be added after it.  Therefore we need an empty first item.
374
 
 ""
375
 
 before.all 'output.state :=
376
 
}
377
 
 
378
 
FUNCTION {output.nonempty.mrnumber}
379
 
{ duplicate$ missing$
380
 
   { pop$ "" }
381
 
   'skip$
382
 
 if$
383
 
 duplicate$ empty$
384
 
   'pop$
385
 
   { " \MR{" swap$ * "}" * write$ }
386
 
 if$
387
 
}
388
 
 
389
 
FUNCTION {blank.sep}
390
 
{ after.quote 'output.state :=
391
 
}
392
 
 
393
 
FUNCTION {fin.entry}
394
 
{ add.period$
395
 
 write$
396
 
%  mrnumber output.nonempty.mrnumber
397
 
 newline$
398
 
}
399
 
 
400
 
% Removed new.block, new.block.checka, new.block.checkb, new.sentence,
401
 
% new.sentence.checka, and new.sentence.checkb functions here, since they
402
 
% don't seem to be needed in the AMS style.  Also moved some real
403
 
% basic functions like `and' and 'or' earlier in the file.
404
 
 
405
 
FUNCTION {new.block}
406
 
{ output.state before.all =
407
 
    'skip$
408
 
    { output.state after.quote =
409
 
        { after.quoted.block 'output.state := }
410
 
        { after.block 'output.state := }
411
 
      if$
412
 
    }
413
 
  if$
414
 
}
415
 
 
416
 
FUNCTION {new.sentence}
417
 
{ output.state after.block =
418
 
    'skip$
419
 
    { output.state before.all =
420
 
        'skip$
421
 
        { after.sentence 'output.state := }
422
 
      if$
423
 
    }
424
 
  if$
425
 
}
426
 
 
427
 
INTEGERS { nameptr namesleft numnames }
428
 
 
429
 
% The extra section to write out a language field was added
430
 
% for AMSPLAIN.BST.  Not present in plain.bst.
431
 
 
432
 
FUNCTION {format.language}
433
 
{ language empty$
434
 
   { "" }
435
 
   { " (" language * ")" * }
436
 
 if$
437
 
}
438
 
 
439
 
% This version of format.names puts names in the format
440
 
%
441
 
% First von Last, Jr.
442
 
%
443
 
% (i.e., first name first, no abbreviating to initials).
444
 
 
445
 
FUNCTION {format.names}
446
 
{ 's :=
447
 
 #1 'nameptr :=
448
 
 s num.names$ 'numnames :=
449
 
 numnames 'namesleft :=
450
 
   { namesleft #0 > }
451
 
   { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
452
 
     nameptr #1 >
453
 
        { namesleft #1 >
454
 
            { ", " * t * }
455
 
            { numnames #2 >
456
 
                { "," * }
457
 
                'skip$
458
 
              if$
459
 
              t "others" =
460
 
                { " et~al." * }
461
 
                { " and " * t * }
462
 
              if$
463
 
            }
464
 
          if$
465
 
        }
466
 
        't
467
 
     if$
468
 
     nameptr #1 + 'nameptr :=
469
 
     namesleft #1 - 'namesleft :=
470
 
   }
471
 
 while$
472
 
}
473
 
 
474
 
FUNCTION {format.authors}
475
 
{ author empty$
476
 
   { "" }
477
 
   { bysame "\bysame" =
478
 
        { bysame }
479
 
        { author format.names }
480
 
    if$
481
 
   }
482
 
 if$
483
 
}
484
 
 
485
 
FUNCTION {format.editors}
486
 
{ editor empty$
487
 
   { "" }
488
 
   { editor format.names
489
 
     editor num.names$ #1 >
490
 
        { " (eds.)" * }
491
 
        { " (ed.)" * }
492
 
     if$
493
 
   }
494
 
 if$
495
 
}
496
 
 
497
 
FUNCTION {format.nonauthor.editors}
498
 
{ editor empty$
499
 
   { "" }
500
 
   { editor format.names
501
 
     editor num.names$ #1 >
502
 
        { ", eds." * }
503
 
        { ", ed." * }
504
 
     if$
505
 
   }
506
 
 if$
507
 
}
508
 
 
509
 
FUNCTION {format.archive}
510
 
{
511
 
  archivePrefix empty$
512
 
      { "" }
513
 
      { archivePrefix ":" *}
514
 
  if$            
515
 
}
516
 
 
517
 
FUNCTION {format.title}
518
 
{ title empty$
519
 
   { "" }
520
 
   { title "t" change.case$ emphasize }
521
 
 if$
522
 
}
523
 
 
524
 
FUNCTION {format.primaryClass}
525
 
{
526
 
  primaryClass empty$
527
 
      { "" }
528
 
      { " [" primaryClass * "]" *}
529
 
  if$            
530
 
}
531
 
 
532
 
FUNCTION {format.eprint}
533
 
{ eprint empty$
534
 
     { ""}
535
 
     { archive empty$
536
 
          {"\href{http://arxiv.org/abs/" eprint * "}" * 
537
 
             "{{\tt " * format.archive * eprint *
538
 
              format.primaryClass * "}}" *}
539
 
          {"\href{" archive *  "/" * eprint * "}" * 
540
 
             "{{\tt " * format.archive * eprint *
541
 
              format.primaryClass * "}}" *}
542
 
       if$
543
 
     }
544
 
     if$
545
 
}
546
 
 
547
 
FUNCTION {format.url}
548
 
{ url empty$
549
 
    { "" }
550
 
    {"\url{" url * "}" *}
551
 
  if$
552
 
}
553
 
 
554
 
FUNCTION {add.doi}
555
 
{ duplicate$ empty$
556
 
    { skip$ }
557
 
    { doi empty$
558
 
        {}
559
 
        {"\href{http://dx.doi.org/" doi * "}{" * swap$ * "}" *}
560
 
      if$
561
 
    }
562
 
  if$
563
 
}
564
 
 
565
 
FUNCTION {format.report}
566
 
{ report empty$
567
 
     { ""}
568
 
     { report}
569
 
     if$
570
 
}
571
 
 
572
 
FUNCTION {format.journal.vol.year}
573
 
{ journal empty$
574
 
   { "" "journal name" missing.warning }
575
 
   { journal
576
 
     volume empty$
577
 
       'skip$
578
 
       { " \textbf{" * volume * "}" * }
579
 
     if$
580
 
     year empty$
581
 
       { "year" missing.warning }
582
 
       { " (" * year * ")" * }
583
 
     if$
584
 
   }
585
 
 if$
586
 
}
587
 
 
588
 
% For formatting the issue number for a journal article.
589
 
 
590
 
FUNCTION {format.number}
591
 
{ number empty$
592
 
   { "" }
593
 
   { "no.~" number * }
594
 
 if$
595
 
}
596
 
 
597
 
% For formatting miscellaneous dates
598
 
 
599
 
FUNCTION {format.date}
600
 
{ year empty$
601
 
   { month empty$
602
 
        { "" }
603
 
        { "there's a month but no year in " cite$ * warning$
604
 
          month
605
 
        }
606
 
     if$
607
 
   }
608
 
   { month empty$
609
 
        'year
610
 
        { month " " * year * }
611
 
     if$
612
 
   }
613
 
 if$
614
 
}
615
 
 
616
 
FUNCTION {format.collaboration}
617
 
{ collaboration empty$
618
 
    { "" }
619
 
    { "{\bf " collaboration * "} " * "Collaboration" * }
620
 
  if$
621
 
}
622
 
 
623
 
FUNCTION {format.SLACcitation}
624
 
{ SLACcitation empty$
625
 
  {""}
626
 
   { newline$ SLACcitation output "" newline$ }
627
 
  if$
628
 
}
629
 
 
630
 
%%      The volume, series and number information is sort of tricky.
631
 
%%      This code handles it as follows:
632
 
%%      If the series is present, and the volume, but not the number,
633
 
%%        then we do "\emph{Book title}, Series Name, vol. 000"
634
 
%%      If the series is present, and the number, but not the volume,
635
 
%%        then we do "\emph{Book title}, Series Name, no. 000"
636
 
%%      If the series is present, and both number and volume,
637
 
%%        then we do "\emph{Book title}, vol. XX, Series Name, no. 000"
638
 
%%      Finally, if the series is absent,
639
 
%%        then we do "\emph{Book title}, vol. XX"
640
 
%%        or         "\emph{Book title}, no. 000"
641
 
%%        and if both volume and number are present, give a warning message.
642
 
 
643
 
FUNCTION {format.bookvolume.series.number}
644
 
{ volume empty$
645
 
   { "" % Push the empty string as a placeholder in case everything else
646
 
        % is empty too.
647
 
     series empty$
648
 
       'skip$
649
 
       { pop$ series } % if series is not empty put in stack
650
 
     if$
651
 
     number empty$
652
 
       'skip$
653
 
       { duplicate$ empty$ % if no preceding material,
654
 
           'skip$          % do nothing, otherwise
655
 
           { ", " * }      % add a comma and space to separate.
656
 
         if$
657
 
         "no." number tie.or.space.connect * % add the number information
658
 
       }
659
 
     if$
660
 
   }
661
 
%% If the volume is NOT EMPTY:
662
 
   { "vol." volume tie.or.space.connect % vol. XX
663
 
     number empty$
664
 
       { series empty$
665
 
           'skip$
666
 
           { series ", " * swap$ *}    % Series Name, vol. XX
667
 
         if$
668
 
       }
669
 
       { series empty$
670
 
           { "can't use both volume and number if series info is missing"
671
 
             warning$
672
 
             "in BibTeX entry type `" type$ * "'" * top$
673
 
           }
674
 
           { ", " * series * ", no." * number tie.or.space.connect }
675
 
         if$
676
 
       }
677
 
     if$
678
 
   }
679
 
 if$
680
 
 
681
 
}  % end of format.bookvolume.series.number
682
 
 
683
 
%% format.inproc.title.where.editors is used by inproceedings entry types
684
 
 
685
 
%%      No case changing or emphasizing for the title.  We want initial
686
 
%%      caps, roman.
687
 
%%      We add parentheses around the address (place where conference
688
 
%%      was held).
689
 
%%      Likewise we add parentheses around the editors' names.
690
 
 
691
 
FUNCTION {format.inproc.title.address.editors}
692
 
{ booktitle empty$
693
 
   { "" }
694
 
   { booktitle
695
 
     address empty$
696
 
       'skip$
697
 
       { add.space.if.necessary "(" * address * ")" * }
698
 
     if$
699
 
     editor empty$
700
 
       'skip$
701
 
       { add.space.if.necessary "(" * format.nonauthor.editors * ")" * }
702
 
     if$
703
 
   }
704
 
 if$
705
 
}
706
 
 
707
 
%% format.incoll.title.editors is similar to format.inproc... but
708
 
%% omits the address. For collections that are not proceedings volumes.
709
 
 
710
 
FUNCTION {format.incoll.title.editors}
711
 
{ booktitle empty$
712
 
   { "" }
713
 
   { editor empty$
714
 
       { booktitle }
715
 
       { booktitle
716
 
         add.space.if.necessary "(" * format.nonauthor.editors * ")" *
717
 
       }
718
 
     if$
719
 
   }
720
 
 if$
721
 
}
722
 
 
723
 
FUNCTION {format.edition}
724
 
{ edition empty$
725
 
   { "" }
726
 
   { output.state mid.sentence =
727
 
        { edition "l" change.case$ " ed." * }
728
 
        { edition "t" change.case$ " ed." * }
729
 
     if$
730
 
   }
731
 
 if$
732
 
}
733
 
 
734
 
INTEGERS { multiresult }
735
 
 
736
 
FUNCTION {multi.page.check}
737
 
{ 't :=
738
 
 #0 'multiresult :=
739
 
   { multiresult not
740
 
     t empty$ not
741
 
     and
742
 
   }
743
 
   { t #1 #1 substring$
744
 
     duplicate$ "-" =
745
 
     swap$ duplicate$ "," =
746
 
     swap$ "+" =
747
 
     or or
748
 
        { #1 'multiresult := }
749
 
        { t #2 global.max$ substring$ 't := }
750
 
     if$
751
 
   }
752
 
 while$
753
 
 multiresult
754
 
}
755
 
 
756
 
FUNCTION {format.pages}
757
 
{ pages empty$
758
 
   { "" }
759
 
   { pages n.dashify }
760
 
 if$
761
 
}
762
 
 
763
 
FUNCTION {format.book.pages}
764
 
{ pages empty$
765
 
   { "" }
766
 
   { pages multi.page.check
767
 
        { "pp.~" pages n.dashify * }
768
 
        { "p.~" pages * }
769
 
     if$
770
 
   }
771
 
 if$
772
 
}
773
 
 
774
 
FUNCTION {format.chapter.pages}
775
 
{ chapter empty$
776
 
   'format.book.pages
777
 
   { type empty$
778
 
        { "ch.~" }
779
 
        { type "l" change.case$ " " * }
780
 
     if$
781
 
     chapter *
782
 
     pages empty$
783
 
        'skip$
784
 
        { ", " * format.book.pages * }
785
 
     if$
786
 
   }
787
 
 if$
788
 
}
789
 
 
790
 
FUNCTION {empty.misc.check}
791
 
{ author empty$ title empty$ howpublished empty$
792
 
 month empty$ year empty$ note empty$
793
 
 and and and and and
794
 
 key empty$ not and
795
 
   { "all relevant fields are empty in " cite$ * warning$ }
796
 
   'skip$
797
 
 if$
798
 
}
799
 
 
800
 
FUNCTION {format.thesis.type}
801
 
{ type empty$
802
 
   'skip$
803
 
   { pop$
804
 
     type "t" change.case$
805
 
   }
806
 
 if$
807
 
}
808
 
 
809
 
FUNCTION {format.tr.number}
810
 
{ type empty$
811
 
   { "Tech. Report" }
812
 
   'type
813
 
 if$
814
 
 number empty$
815
 
   { "t" change.case$ }
816
 
   { number tie.or.space.connect }
817
 
 if$
818
 
}
819
 
 
820
 
% The format.crossref functions haven't been paid much attention
821
 
% at the present time (June 1990) and could probably use some
822
 
% work.  MJD
823
 
 
824
 
FUNCTION {format.article.crossref}
825
 
{ key empty$
826
 
   { journal empty$
827
 
        { "need key or journal for " cite$ * " to crossref " * crossref *
828
 
          warning$
829
 
          ""
830
 
        }
831
 
        { "in " journal * }
832
 
     if$
833
 
   }
834
 
   { "in " key * }
835
 
 if$
836
 
 " \cite{" * crossref * "}" *
837
 
}
838
 
 
839
 
FUNCTION {format.crossref.editor}
840
 
{ editor #1 "{vv~}{ll}" format.name$
841
 
 editor num.names$ duplicate$
842
 
 #2 >
843
 
   { pop$ " et~al." * }
844
 
   { #2 <
845
 
        'skip$
846
 
        { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
847
 
            { " et~al." * }
848
 
            { " and " * editor #2 "{vv~}{ll}" format.name$ * }
849
 
          if$
850
 
        }
851
 
     if$
852
 
   }
853
 
 if$
854
 
}
855
 
 
856
 
FUNCTION {format.book.crossref}
857
 
{ volume empty$
858
 
   { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
859
 
     "in "
860
 
   }
861
 
   { "vol." volume tie.or.space.connect
862
 
     " of " *
863
 
   }
864
 
 if$
865
 
 editor empty$
866
 
 editor field.or.null author field.or.null =
867
 
 or
868
 
   { key empty$
869
 
        { series empty$
870
 
            { "need editor, key, or series for " cite$ * " to crossref " *
871
 
              crossref * warning$
872
 
              "" *
873
 
            }
874
 
            { series * }
875
 
          if$
876
 
        }
877
 
        { key * }
878
 
     if$
879
 
   }
880
 
   { format.crossref.editor * }
881
 
 if$
882
 
 " \cite{" * crossref * "}" *
883
 
}
884
 
 
885
 
FUNCTION {format.incoll.inproc.crossref}
886
 
{ editor empty$
887
 
 editor field.or.null author field.or.null =
888
 
 or
889
 
   { key empty$
890
 
        { booktitle empty$
891
 
            { "need editor, key, or booktitle for " cite$ * " to crossref " *
892
 
              crossref * warning$
893
 
              ""
894
 
            }
895
 
            { "in \emph{" booktitle * "}" * }
896
 
          if$
897
 
        }
898
 
        { "in " key * }
899
 
     if$
900
 
   }
901
 
   { "in " format.crossref.editor * }
902
 
 if$
903
 
 " \cite{" * crossref * "}" *
904
 
}
905
 
 
906
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
907
 
 
908
 
% The main functions for each entry type.
909
 
 
910
 
% journal, vol and year are formatted together because they are
911
 
% not separated by commas.
912
 
 
913
 
FUNCTION {article}
914
 
{ output.bibitem
915
 
 format.collaboration output
916
 
 format.authors "author" output.check
917
 
 format.title "title" output.check
918
 
 crossref missing$
919
 
 { journal missing$ 
920
 
     {}
921
 
     { format.journal.vol.year add.doi "journal, volume, and year" output.check
922
 
       format.number output
923
 
       format.pages "pages" output.check
924
 
      }
925
 
     if$
926
 
    report missing$
927
 
        {format.eprint output}
928
 
        {blank.sep format.report output format.eprint output}
929
 
      if$
930
 
  }
931
 
  { format.article.crossref output.nonnull
932
 
     format.pages "pages" output.check
933
 
     format.eprint output
934
 
   }
935
 
 if$
936
 
 new.sentence
937
 
 format.language *
938
 
  new.sentence
939
 
  format.url output
940
 
  new.sentence
941
 
  note output
942
 
  new.sentence
943
 
  format.SLACcitation output
944
 
  fin.entry
945
 
}
946
 
 
947
 
FUNCTION {book}
948
 
{ output.bibitem
949
 
  format.collaboration output
950
 
 author empty$
951
 
   { format.editors "author and editor" output.check }
952
 
   { format.authors output.nonnull
953
 
     crossref missing$
954
 
        { "author and editor" editor either.or.check }
955
 
        'skip$
956
 
     if$
957
 
   }
958
 
 if$
959
 
 format.title add.doi "title" output.check
960
 
 format.edition output
961
 
 crossref missing$
962
 
   { format.bookvolume.series.number output
963
 
     publisher "publisher" output.check
964
 
     address output
965
 
   }
966
 
   { format.book.crossref output.nonnull
967
 
   }
968
 
 if$
969
 
 format.date "year" output.check
970
 
 format.language *
971
 
  new.block
972
 
 format.eprint output
973
 
  new.block
974
 
 format.url output
975
 
 new.block
976
 
 note output
977
 
 new.sentence
978
 
 format.SLACcitation output
979
 
 fin.entry
980
 
}
981
 
 
982
 
FUNCTION {booklet}
983
 
{ output.bibitem
984
 
 format.authors output
985
 
 format.title "title" output.check
986
 
 howpublished output
987
 
 address output
988
 
 format.date output
989
 
 new.block
990
 
 format.eprint output
991
 
 new.block
992
 
  format.url output
993
 
  new.block
994
 
 note output
995
 
 new.sentence
996
 
 format.SLACcitation output
997
 
 fin.entry
998
 
}
999
 
 
1000
 
FUNCTION {inbook}
1001
 
{ output.bibitem
1002
 
  format.collaboration output
1003
 
 author empty$
1004
 
   { format.editors "author and editor" output.check }
1005
 
   { format.authors output.nonnull
1006
 
     crossref missing$
1007
 
        { "author and editor" editor either.or.check }
1008
 
        'skip$
1009
 
     if$
1010
 
   }
1011
 
 if$
1012
 
 format.title "title" output.check
1013
 
 format.edition output
1014
 
 crossref missing$
1015
 
   { format.bookvolume.series.number output
1016
 
     format.chapter.pages "chapter and pages" output.check
1017
 
     publisher "publisher" output.check
1018
 
     address output
1019
 
   }
1020
 
   { format.chapter.pages "chapter and pages" output.check
1021
 
     format.book.crossref output.nonnull
1022
 
   }
1023
 
 if$
1024
 
 format.date "year" output.check
1025
 
 format.language *
1026
 
  new.block
1027
 
 format.eprint output
1028
 
  new.block
1029
 
 format.url output
1030
 
  new.block
1031
 
 note output
1032
 
 new.sentence
1033
 
 format.SLACcitation output
1034
 
 fin.entry
1035
 
}
1036
 
 
1037
 
FUNCTION {incollection}
1038
 
{ output.bibitem
1039
 
  format.collaboration output
1040
 
 format.authors "author" output.check
1041
 
 format.title add.doi "title" output.check
1042
 
 crossref missing$
1043
 
   { format.incoll.title.editors "booktitle" output.check
1044
 
     format.bookvolume.series.number output
1045
 
     publisher "publisher" output.check
1046
 
     address output
1047
 
     format.edition output
1048
 
     format.date "year" output.check
1049
 
   }
1050
 
   { format.incoll.inproc.crossref output.nonnull
1051
 
   }
1052
 
 if$
1053
 
 format.book.pages output
1054
 
 format.language *
1055
 
  new.block
1056
 
 format.eprint output
1057
 
 new.block
1058
 
  format.url output
1059
 
  new.block
1060
 
 note output
1061
 
 new.sentence
1062
 
 format.SLACcitation output
1063
 
 fin.entry
1064
 
}
1065
 
 
1066
 
FUNCTION {inproceedings}
1067
 
{ output.bibitem
1068
 
  format.collaboration output
1069
 
 format.authors "author" output.check
1070
 
 format.title add.doi "title" output.check
1071
 
 crossref missing$
1072
 
   { format.inproc.title.address.editors "booktitle" output.check
1073
 
     format.bookvolume.series.number output
1074
 
     organization output
1075
 
     publisher output
1076
 
     format.date "year" output.check
1077
 
   }
1078
 
   { format.incoll.inproc.crossref output.nonnull
1079
 
   }
1080
 
 if$
1081
 
 format.book.pages output
1082
 
  new.block
1083
 
 format.eprint output
1084
 
  new.block
1085
 
 format.url output
1086
 
  new.block
1087
 
 format.language *
1088
 
  note output
1089
 
  new.sentence
1090
 
  format.SLACcitation output
1091
 
 fin.entry
1092
 
}
1093
 
 
1094
 
FUNCTION {conference} { inproceedings }
1095
 
 
1096
 
FUNCTION {manual}
1097
 
{ output.bibitem
1098
 
  format.collaboration output
1099
 
 author empty$
1100
 
   { organization empty$
1101
 
        'skip$
1102
 
        { organization output.nonnull
1103
 
          address output
1104
 
        }
1105
 
     if$
1106
 
   }
1107
 
   { format.authors output.nonnull }
1108
 
 if$
1109
 
 format.title "title" output.check
1110
 
 author empty$
1111
 
   { organization empty$
1112
 
        { address output }
1113
 
        'skip$
1114
 
     if$
1115
 
   }
1116
 
   { organization output
1117
 
     address output
1118
 
   }
1119
 
 if$
1120
 
 format.edition output
1121
 
 format.date output
1122
 
  new.block
1123
 
 format.eprint output
1124
 
  new.block
1125
 
  format.url output
1126
 
  new.block
1127
 
 note output
1128
 
 fin.entry
1129
 
}
1130
 
 
1131
 
FUNCTION {mastersthesis}
1132
 
{ output.bibitem
1133
 
 format.authors "author" output.check
1134
 
 format.title add.doi "title" output.check
1135
 
 "Master's thesis" format.thesis.type output.nonnull
1136
 
 school "school" output.check
1137
 
 address output
1138
 
 format.date "year" output.check
1139
 
 format.book.pages output
1140
 
 new.block
1141
 
 format.eprint output
1142
 
 new.block
1143
 
  format.url output
1144
 
  new.block
1145
 
  note output
1146
 
 fin.entry
1147
 
}
1148
 
 
1149
 
FUNCTION {misc}
1150
 
{ output.bibitem
1151
 
  format.collaboration output
1152
 
 format.authors output
1153
 
 format.title add.doi output
1154
 
 howpublished output
1155
 
 format.date output
1156
 
 format.book.pages output
1157
 
 new.block
1158
 
 format.eprint output
1159
 
 new.block
1160
 
  format.url output
1161
 
  new.sentence
1162
 
  note output
1163
 
  new.sentence
1164
 
 fin.entry
1165
 
 empty.misc.check
1166
 
}
1167
 
 
1168
 
FUNCTION {phdthesis}
1169
 
{ output.bibitem
1170
 
 format.authors "author" output.check
1171
 
 format.title add.doi "title" output.check
1172
 
 "Ph.D. thesis" format.thesis.type output.nonnull
1173
 
 school "school" output.check
1174
 
 address output
1175
 
 format.date "year" output.check
1176
 
 format.book.pages output
1177
 
 new.block
1178
 
 format.eprint output
1179
 
 new.block
1180
 
  format.url output
1181
 
  new.block
1182
 
  note output
1183
 
  new.sentence
1184
 
  format.SLACcitation output
1185
 
 fin.entry
1186
 
}
1187
 
 
1188
 
FUNCTION {proceedings}
1189
 
{ output.bibitem
1190
 
 editor empty$
1191
 
   { organization output }
1192
 
   { format.editors output.nonnull }
1193
 
 if$
1194
 
 format.title add.doi "title" output.check
1195
 
 format.bookvolume.series.number output
1196
 
 address empty$
1197
 
   { editor empty$
1198
 
       'skip$
1199
 
        { organization output }
1200
 
     if$
1201
 
     publisher output
1202
 
     format.date "year" output.check
1203
 
   }
1204
 
   { address output.nonnull
1205
 
     editor empty$
1206
 
        'skip$
1207
 
        { organization output }
1208
 
     if$
1209
 
     publisher output
1210
 
     format.date "year" output.check
1211
 
   }
1212
 
 if$
1213
 
 format.eprint output
1214
 
%  new.block
1215
 
  format.url output
1216
 
  note output
1217
 
  new.sentence
1218
 
  format.SLACcitation output
1219
 
 
1220
 
 fin.entry
1221
 
}
1222
 
 
1223
 
FUNCTION {techreport}
1224
 
{ output.bibitem
1225
 
 format.authors "author" output.check
1226
 
 format.title "title" output.check
1227
 
 format.tr.number output.nonnull
1228
 
 institution "institution" output.check
1229
 
 address output
1230
 
 format.date "year" output.check
1231
 
 format.eprint output
1232
 
%  new.block
1233
 
 note output
1234
 
 fin.entry
1235
 
}
1236
 
 
1237
 
FUNCTION {unpublished}
1238
 
{ output.bibitem
1239
 
 format.authors "author" output.check
1240
 
 format.title "title" output.check
1241
 
 note "note" output.check
1242
 
 format.date output
1243
 
 format.eprint output
1244
 
 format.url output
1245
 
  new.sentence
1246
 
  format.SLACcitation output
1247
 
 fin.entry
1248
 
}
1249
 
 
1250
 
FUNCTION {default.type} { misc }
1251
 
 
1252
 
MACRO {jan} {"January"}
1253
 
 
1254
 
MACRO {feb} {"February"}
1255
 
 
1256
 
MACRO {mar} {"March"}
1257
 
 
1258
 
MACRO {apr} {"April"}
1259
 
 
1260
 
MACRO {may} {"May"}
1261
 
 
1262
 
MACRO {jun} {"June"}
1263
 
 
1264
 
MACRO {jul} {"July"}
1265
 
 
1266
 
MACRO {aug} {"August"}
1267
 
 
1268
 
MACRO {sep} {"September"}
1269
 
 
1270
 
MACRO {oct} {"October"}
1271
 
 
1272
 
MACRO {nov} {"November"}
1273
 
 
1274
 
MACRO {dec} {"December"}
1275
 
 
1276
 
READ
1277
 
 
1278
 
FUNCTION {sortify}
1279
 
{ purify$
1280
 
 "l" change.case$
1281
 
}
1282
 
 
1283
 
INTEGERS { len }
1284
 
 
1285
 
FUNCTION {chop.word}
1286
 
{ 's :=
1287
 
 'len :=
1288
 
 s #1 len substring$ =
1289
 
   { s len #1 + global.max$ substring$ }
1290
 
   's
1291
 
 if$
1292
 
}
1293
 
 
1294
 
INTEGERS { et.al.char.used }
1295
 
 
1296
 
FUNCTION {initialize.et.al.char.used}
1297
 
{ #0 'et.al.char.used :=
1298
 
}
1299
 
 
1300
 
EXECUTE {initialize.et.al.char.used}
1301
 
 
1302
 
FUNCTION {format.lab.names}
1303
 
{ 's :=
1304
 
 s num.names$ 'numnames :=
1305
 
 numnames #1 >
1306
 
   { numnames #4 >
1307
 
        { #3 'namesleft := }
1308
 
        { numnames 'namesleft := }
1309
 
     if$
1310
 
     #1 'nameptr :=
1311
 
     ""
1312
 
        { namesleft #0 > }
1313
 
        { nameptr numnames =
1314
 
            { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1315
 
                { "{\etalchar{+}}" *
1316
 
                  #1 'et.al.char.used :=
1317
 
                }
1318
 
                { s nameptr "{v{}}{l{}}" format.name$ * }
1319
 
              if$
1320
 
            }
1321
 
            { s nameptr "{v{}}{l{}}" format.name$ * }
1322
 
          if$
1323
 
          nameptr #1 + 'nameptr :=
1324
 
          namesleft #1 - 'namesleft :=
1325
 
        }
1326
 
     while$
1327
 
     numnames #4 >
1328
 
        { "{\etalchar{+}}" *
1329
 
          #1 'et.al.char.used :=
1330
 
        }
1331
 
        'skip$
1332
 
     if$
1333
 
   }
1334
 
   { s #1 "{v{}}{l{}}" format.name$
1335
 
     duplicate$ text.length$ #2 <
1336
 
        { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
1337
 
        'skip$
1338
 
     if$
1339
 
   }
1340
 
 if$
1341
 
}
1342
 
 
1343
 
FUNCTION {author.key.label}
1344
 
{ author empty$
1345
 
   { key empty$
1346
 
        { cite$ #1 #3 substring$ }
1347
 
        { key #3 text.prefix$ }
1348
 
     if$
1349
 
   }
1350
 
   { author format.lab.names }
1351
 
 if$
1352
 
}
1353
 
 
1354
 
FUNCTION {author.editor.key.label}
1355
 
{ author empty$
1356
 
   { editor empty$
1357
 
        { key empty$
1358
 
            { cite$ #1 #3 substring$ }
1359
 
            { key #3 text.prefix$ }
1360
 
          if$
1361
 
        }
1362
 
        { editor format.lab.names }
1363
 
     if$
1364
 
   }
1365
 
   { author format.lab.names }
1366
 
 if$
1367
 
}
1368
 
 
1369
 
FUNCTION {author.key.organization.label}
1370
 
{ author empty$
1371
 
   { key empty$
1372
 
        { organization empty$
1373
 
            { cite$ #1 #3 substring$ }
1374
 
            { "The " #4 organization chop.word #3 text.prefix$ }
1375
 
          if$
1376
 
        }
1377
 
        { key #3 text.prefix$ }
1378
 
     if$
1379
 
   }
1380
 
   { author format.lab.names }
1381
 
 if$
1382
 
}
1383
 
 
1384
 
FUNCTION {editor.key.organization.label}
1385
 
{ editor empty$
1386
 
   { key empty$
1387
 
        { organization empty$
1388
 
            { cite$ #1 #3 substring$ }
1389
 
            { "The " #4 organization chop.word #3 text.prefix$ }
1390
 
          if$
1391
 
        }
1392
 
        { key #3 text.prefix$ }
1393
 
     if$
1394
 
   }
1395
 
   { editor format.lab.names }
1396
 
 if$
1397
 
}
1398
 
 
1399
 
FUNCTION {calc.label}
1400
 
{ type$ "book" =
1401
 
 type$ "inbook" =
1402
 
 or
1403
 
   'author.editor.key.label
1404
 
   { type$ "proceedings" =
1405
 
        'editor.key.organization.label
1406
 
        { type$ "manual" =
1407
 
            'author.key.organization.label
1408
 
            'author.key.label
1409
 
          if$
1410
 
        }
1411
 
     if$
1412
 
   }
1413
 
 if$
1414
 
 duplicate$
1415
 
 year field.or.null purify$ #-1 #2 substring$
1416
 
 *
1417
 
 'label :=
1418
 
 year field.or.null purify$ #-1 #4 substring$
1419
 
 *
1420
 
 sortify 'sort.label :=
1421
 
}
1422
 
 
1423
 
FUNCTION {sort.format.names}
1424
 
{ 's :=
1425
 
 #1 'nameptr :=
1426
 
 ""
1427
 
 s num.names$ 'numnames :=
1428
 
 numnames 'namesleft :=
1429
 
   { namesleft #0 > }
1430
 
   { nameptr #1 >
1431
 
        { "   " * }
1432
 
        'skip$
1433
 
     if$
1434
 
     s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
1435
 
     nameptr numnames = t "others" = and
1436
 
        { "et al" * }
1437
 
        { t sortify * }
1438
 
     if$
1439
 
     nameptr #1 + 'nameptr :=
1440
 
     namesleft #1 - 'namesleft :=
1441
 
   }
1442
 
 while$
1443
 
}
1444
 
 
1445
 
FUNCTION {sort.format.title}
1446
 
{ 't :=
1447
 
 "A " #2
1448
 
   "An " #3
1449
 
     "The " #4 t chop.word
1450
 
   chop.word
1451
 
 chop.word
1452
 
 sortify
1453
 
 #1 global.max$ substring$
1454
 
}
1455
 
 
1456
 
FUNCTION {author.sort}
1457
 
{ author empty$
1458
 
   { key empty$
1459
 
        { "to sort, need author or key in " cite$ * warning$
1460
 
          ""
1461
 
        }
1462
 
        { key sortify }
1463
 
     if$
1464
 
   }
1465
 
   { author sort.format.names }
1466
 
 if$
1467
 
}
1468
 
 
1469
 
FUNCTION {author.editor.sort}
1470
 
{ author empty$
1471
 
   { editor empty$
1472
 
        { key empty$
1473
 
            { "to sort, need author, editor, or key in " cite$ * warning$
1474
 
              ""
1475
 
            }
1476
 
            { key sortify }
1477
 
          if$
1478
 
        }
1479
 
        { editor sort.format.names }
1480
 
     if$
1481
 
   }
1482
 
   { author sort.format.names }
1483
 
 if$
1484
 
}
1485
 
 
1486
 
FUNCTION {author.organization.sort}
1487
 
{ author empty$
1488
 
   { organization empty$
1489
 
        { key empty$
1490
 
            { "to sort, need author, organization, or key in " cite$ * warning$
1491
 
              ""
1492
 
            }
1493
 
            { key sortify }
1494
 
          if$
1495
 
        }
1496
 
        { "The " #4 organization chop.word sortify }
1497
 
     if$
1498
 
   }
1499
 
   { author sort.format.names }
1500
 
 if$
1501
 
}
1502
 
 
1503
 
FUNCTION {editor.organization.sort}
1504
 
{ editor empty$
1505
 
   { organization empty$
1506
 
        { key empty$
1507
 
            { "to sort, need editor, organization, or key in " cite$ * warning$
1508
 
              ""
1509
 
            }
1510
 
            { key sortify }
1511
 
          if$
1512
 
        }
1513
 
        { "The " #4 organization chop.word sortify }
1514
 
     if$
1515
 
   }
1516
 
   { editor sort.format.names }
1517
 
 if$
1518
 
}
1519
 
 
1520
 
FUNCTION {presort}
1521
 
{ calc.label
1522
 
 sort.label
1523
 
 "    "
1524
 
 *
1525
 
 type$ "book" =
1526
 
 type$ "inbook" =
1527
 
 or
1528
 
   'author.editor.sort
1529
 
   { type$ "proceedings" =
1530
 
        'editor.organization.sort
1531
 
        { type$ "manual" =
1532
 
            'author.organization.sort
1533
 
            'author.sort
1534
 
          if$
1535
 
        }
1536
 
     if$
1537
 
   }
1538
 
 if$
1539
 
 *
1540
 
 "    "
1541
 
 *
1542
 
 year field.or.null sortify
1543
 
 *
1544
 
 "    "
1545
 
 *
1546
 
 title field.or.null
1547
 
 sort.format.title
1548
 
 *
1549
 
 #1 entry.max$ substring$
1550
 
 'sort.key$ :=
1551
 
}
1552
 
 
1553
 
ITERATE {presort}
1554
 
 
1555
 
SORT
1556
 
 
1557
 
STRINGS {
1558
 
 longest.label last.sort.label next.extra prev.author this.author
1559
 
}
1560
 
 
1561
 
INTEGERS { longest.label.width last.extra.num }
1562
 
 
1563
 
FUNCTION {initialize.longest.label}
1564
 
{ "" 'longest.label :=
1565
 
 #0 int.to.chr$ 'last.sort.label :=
1566
 
 "" 'next.extra :=
1567
 
 #0 'longest.label.width :=
1568
 
 #0 'last.extra.num :=
1569
 
 "abcxyz" 'prev.author :=
1570
 
 "" 'this.author :=
1571
 
}
1572
 
 
1573
 
FUNCTION {forward.pass}
1574
 
{ last.sort.label sort.label =
1575
 
   { last.extra.num #1 + 'last.extra.num :=
1576
 
     last.extra.num int.to.chr$ 'extra.label :=
1577
 
   }
1578
 
   { "a" chr.to.int$ 'last.extra.num :=
1579
 
     "" 'extra.label :=
1580
 
     sort.label 'last.sort.label :=
1581
 
   }
1582
 
 if$
1583
 
 author empty$ { editor empty$ { "" } 'editor if$ } 'author if$
1584
 
 'this.author :=
1585
 
 this.author prev.author =
1586
 
   { "\bysame" 'bysame := }
1587
 
   { "" 'bysame :=
1588
 
     this.author "" =
1589
 
       { "abcxyz" }
1590
 
       'this.author
1591
 
     if$
1592
 
     'prev.author :=
1593
 
   }
1594
 
 if$
1595
 
}
1596
 
 
1597
 
FUNCTION {reverse.pass}
1598
 
{ next.extra "b" =
1599
 
   { "a" 'extra.label := }
1600
 
   'skip$
1601
 
 if$
1602
 
 label extra.label * 'label :=
1603
 
 label width$ longest.label.width >
1604
 
   { label 'longest.label :=
1605
 
     label width$ 'longest.label.width :=
1606
 
   }
1607
 
   'skip$
1608
 
 if$
1609
 
 extra.label 'next.extra :=
1610
 
}
1611
 
 
1612
 
EXECUTE {initialize.longest.label}
1613
 
 
1614
 
ITERATE {forward.pass}
1615
 
 
1616
 
REVERSE {reverse.pass}
1617
 
 
1618
 
FUNCTION {begin.bib}
1619
 
{ et.al.char.used
1620
 
   { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
1621
 
   'skip$
1622
 
 if$
1623
 
 preamble$ empty$
1624
 
   'skip$
1625
 
   { preamble$ write$ newline$ }
1626
 
 if$
1627
 
 "\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}"
1628
 
   write$ newline$
1629
 
 "\providecommand{\MR}{\relax\ifhmode\unskip\space\fi MR }"
1630
 
   write$ newline$
1631
 
 "% \MRhref is called by the amsart/book/proc definition of \MR."
1632
 
   write$ newline$
1633
 
 "\providecommand{\MRhref}[2]{%"
1634
 
   write$ newline$
1635
 
 "  \href{http://www.ams.org/mathscinet-getitem?mr=#1}{#2}"
1636
 
   write$ newline$
1637
 
 "}"
1638
 
   write$ newline$
1639
 
 "\providecommand{\href}[2]{#2}"
1640
 
   write$ newline$
1641
 
 "\begin{thebibliography}{"  longest.label  * "}" *
1642
 
   write$ newline$
1643
 
}
1644
 
 
1645
 
EXECUTE {begin.bib}
1646
 
 
1647
 
EXECUTE {init.state.consts}
1648
 
 
1649
 
ITERATE {call.type$}
1650
 
 
1651
 
FUNCTION {end.bib}
1652
 
{ newline$
1653
 
 "\end{thebibliography}" write$ newline$
1654
 
}
1655
 
 
1656
 
EXECUTE {end.bib}
1657
 
%% \CharacterTable
1658
 
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
1659
 
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
1660
 
%%   Digits        \0\1\2\3\4\5\6\7\8\9
1661
 
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
1662
 
%%   Dollar        \$     Percent       \%     Ampersand     \&
1663
 
%%   Acute accent  \'     Left paren    \(     Right paren   \)
1664
 
%%   Asterisk      \*     Plus          \+     Comma         \,
1665
 
%%   Minus         \-     Point         \.     Solidus       \/
1666
 
%%   Colon         \:     Semicolon     \;     Less than     \<
1667
 
%%   Equals        \=     Greater than  \>     Question mark \?
1668
 
%%   Commercial at \@     Left bracket  \[     Backslash     \\
1669
 
%%   Right bracket \]     Circumflex    \^     Underscore    \_
1670
 
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
1671
 
%%   Right brace   \}     Tilde         \~}
 
 
'\\ No newline at end of file'