/utphys

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