/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 utmath.bst

  • Committer: Jacques Distler
  • Date: 2010-07-23 05:15:26 UTC
  • Revision ID: distler@golem.ph.utexas.edu-20100723051526-bdwovutom4p1wamx
New Styles

utmath.bst        The hypertex style preferred by Dan Freed
                  (based on ...)
hyperamsalpha.bst Hypertex version of amsalpha.bst
hyperamsplain.bst Hypertex version of amsplain.bst
                  (preferred by Marco Gualtieri)

Show diffs side-by-side

added added

removed removed

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