1
%%% ====================================================================
2
%%% @BibTeX-style-file{
3
%%% filename = "amsplain.bst",
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,
13
%%% Providence, RI 02940,
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
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.",
41
%%% ====================================================================
42
% Modified by Jacques Distler, 7/2010
44
% Added support for Eprint archives.
46
% url, collaboration, report and SLACcitation fields
50
% The following are equivalent:
52
% eprint = "hep-th/9605023"
54
% eprint = "hep-th/9605023"
57
% \href{http://arxiv.org/abs/hep-th/9605023}{{\tt hep-th/9605023}}
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).
66
% "New-style" arXiv identifiers are also supported.
68
% archivePrefix = "arXiv",
69
% eprint = "0707.3168",
70
% primaryClass = "hep-th",
74
% \href{http://arxiv.org/abs/0707.3168}{{\tt arXiv:0707.3168 [hep-th]}}
76
% Another (non-arXiv) example:
78
% archive = "http://cogprints.org",
80
% archivePrefix = "Cogprints",
84
% \href{http://cogprints.org/5542}{{\tt Cogprints:5542}}
90
% field is present, then the journal reference becomes a
91
% clickable hyperlink to the online journal version of the paper.
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
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.
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.
105
%% Types of entries currently allowed in a BibTeX file:
107
%% ARTICLE -- An article from a journal or magazine.
109
%% BOOK -- A book with an explicit publisher.
111
%% BOOKLET -- A work that is printed and bound,
112
%% but without a named publisher or sponsoring institution.
114
%% CONFERENCE -- The same as INPROCEEDINGS,
115
%% included for Scribe compatibility.
117
%% INBOOK -- A part of a book,
118
%% which may be a chapter (or section or whatever) and/or a range of pages.
120
%% INCOLLECTION -- A part of a book having its own title.
122
%% INPROCEEDINGS -- An article in a conference proceedings.
124
%% MANUAL -- Technical documentation.
126
%% MASTERSTHESIS -- A Master's thesis.
128
%% MISC -- Use this type when nothing else fits.
130
%% PHDTHESIS -- A PhD thesis.
132
%% PROCEEDINGS -- The proceedings of a conference.
134
%% TECHREPORT -- A report published by a school or other institution,
135
%% usually numbered within a series.
137
%% UNPUBLISHED -- A document having an author and title, but not formally
178
% Removed after.sentence, after.block---not needed.
180
INTEGERS { output.state before.all mid.sentence after.quote after.sentence
181
after.quoted.block after.block }
183
FUNCTION {init.state.consts}
187
#3 'after.sentence :=
188
#4 'after.quoted.block :=
199
{ duplicate$ ":::: `" swap$ * "'" * top$
203
{"STACK====================================================================="
206
"ENDSTACK=================================================================="
228
FUNCTION {field.or.null}
238
{ "\emph{" swap$ * "}" * }
245
{ "{\tt " swap$ * "}" * }
249
% n.dashify is used to make sure page ranges get the TeX code
250
% (two hyphens) for en-dashes.
256
{ t #1 #1 substring$ "-" =
257
{ t #1 #2 substring$ "--" = not
259
t #2 global.max$ substring$ 't :=
261
{ { t #1 #1 substring$ "-" = }
263
t #2 global.max$ substring$ 't :=
269
{ t #1 #1 substring$ *
270
t #2 global.max$ substring$ 't :=
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
281
FUNCTION {tie.or.space.connect}
282
{ duplicate$ text.length$ #3 <
289
FUNCTION {add.space.if.necessary}
296
% either.or.check gives a warning if two mutually exclusive fields
297
% were used in the database.
299
FUNCTION {either.or.check}
302
{ "can't use both " swap$ * " fields in " * cite$ * warning$ }
306
% output.nonnull is called by output.
308
FUNCTION {output.nonnull}
309
% remove the top item from the stack because it's in the way.
311
output.state mid.sentence =
312
% If we're in mid-sentence, add a comma to the new top item and write it
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;
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$ }
322
mid.sentence 'output.state :=
325
% Put the top item back on the stack that we removed earlier.
329
% Output checks to see if the stack top is empty; if not, it
330
% calls output.nonnull to write it out.
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.
343
FUNCTION {missing.warning}
344
{ "missing " swap$ * " in " * cite$ * warning$ }
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
350
FUNCTION {output.check}
353
{ pop$ t missing.warning }
358
FUNCTION {output.bibitem}
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.
369
before.all 'output.state :=
372
FUNCTION {output.nonempty.mrnumber}
373
{ duplicate$ missing$
379
{ " \MR{" swap$ * "}" * write$ }
384
{ after.quote 'output.state :=
390
% mrnumber output.nonempty.mrnumber
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.
400
{ output.state before.all =
402
{ output.state after.quote =
403
{ after.quoted.block 'output.state := }
404
{ after.block 'output.state := }
410
FUNCTION {new.sentence}
411
{ output.state after.block =
413
{ output.state before.all =
415
{ after.sentence 'output.state := }
421
INTEGERS { nameptr namesleft numnames }
423
% The extra section to write out a language field was added
424
% for AMSPLAIN.BST. Not present in plain.bst.
426
FUNCTION {format.language}
429
{ " (" language * ")" * }
433
% This version of format.names puts names in the format
435
% First von Last, Jr.
437
% (i.e., first name first, no abbreviating to initials).
439
FUNCTION {format.names}
442
s num.names$ 'numnames :=
443
numnames 'namesleft :=
445
{ s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
462
nameptr #1 + 'nameptr :=
463
namesleft #1 - 'namesleft :=
468
FUNCTION {format.authors}
473
{ author format.names }
479
FUNCTION {format.editors}
482
{ editor format.names
483
editor num.names$ #1 >
491
FUNCTION {format.nonauthor.editors}
494
{ editor format.names
495
editor num.names$ #1 >
503
FUNCTION {format.archive}
507
{ archivePrefix ":" *}
511
FUNCTION {format.title}
514
% { title "t" change.case$ emphasize }
519
FUNCTION {format.primaryClass}
523
{ " [" primaryClass * "]" *}
527
FUNCTION {format.eprint}
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 * "}}" *}
542
FUNCTION {format.url}
545
{"\url{" url * "}" *}
554
{"\href{http://dx.doi.org/" doi * "}{" * swap$ * "}" *}
560
FUNCTION {format.report}
567
FUNCTION {format.journal.vol.year}
569
{ "" "journal name" missing.warning }
573
{ " \textbf{" * volume * "}" * }
576
{ "year" missing.warning }
577
{ " (" * year * ")" * }
583
% For formatting the issue number for a journal article.
585
FUNCTION {format.number}
592
% For formatting miscellaneous dates
594
FUNCTION {format.date}
598
{ "there's a month but no year in " cite$ * warning$
605
{ month " " * year * }
611
FUNCTION {format.collaboration}
612
{ collaboration empty$
614
{ "{\bf " collaboration * "} " * "Collaboration" * }
618
FUNCTION {format.SLACcitation}
619
{ SLACcitation empty$
621
{ newline$ SLACcitation output "" newline$ }
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.
638
FUNCTION {format.bookvolume.series.number}
640
{ "" % Push the empty string as a placeholder in case everything else
644
{ pop$ series } % if series is not empty put in stack
648
{ duplicate$ empty$ % if no preceding material,
649
'skip$ % do nothing, otherwise
650
{ ", " * } % add a comma and space to separate.
652
"no." number tie.or.space.connect * % add the number information
656
%% If the volume is NOT EMPTY:
657
{ "vol." volume tie.or.space.connect % vol. XX
661
{ series ", " * swap$ *} % Series Name, vol. XX
665
{ "can't use both volume and number if series info is missing"
667
"in BibTeX entry type `" type$ * "'" * top$
669
{ ", " * series * ", no." * number tie.or.space.connect }
676
} % end of format.bookvolume.series.number
678
%% format.inproc.title.where.editors is used by inproceedings entry types
680
%% No case changing or emphasizing for the title. We want initial
682
%% We add parentheses around the address (place where conference
684
%% Likewise we add parentheses around the editors' names.
686
FUNCTION {format.inproc.title.address.editors}
692
{ add.space.if.necessary "(" * address * ")" * }
696
{ add.space.if.necessary "(" * format.nonauthor.editors * ")" * }
702
%% format.incoll.title.editors is similar to format.inproc... but
703
%% omits the address. For collections that are not proceedings volumes.
705
FUNCTION {format.incoll.title.editors}
711
add.space.if.necessary "(" * format.nonauthor.editors * ")" *
718
FUNCTION {format.edition}
721
{ output.state mid.sentence =
722
{ edition "l" change.case$ " ed." * }
723
{ edition "t" change.case$ " ed." * }
729
INTEGERS { multiresult }
731
FUNCTION {multi.page.check}
740
swap$ duplicate$ "," =
743
{ #1 'multiresult := }
744
{ t #2 global.max$ substring$ 't := }
751
FUNCTION {format.pages}
758
FUNCTION {format.book.pages}
761
{ pages multi.page.check
762
{ "pp.~" pages n.dashify * }
769
FUNCTION {format.chapter.pages}
774
{ type "l" change.case$ " " * }
779
{ ", " * format.book.pages * }
785
FUNCTION {empty.misc.check}
786
{ author empty$ title empty$ howpublished empty$
787
month empty$ year empty$ note empty$
790
{ "all relevant fields are empty in " cite$ * warning$ }
795
FUNCTION {format.thesis.type}
799
type "t" change.case$
804
FUNCTION {format.tr.number}
811
{ number tie.or.space.connect }
815
% The format.crossref functions haven't been paid much attention
816
% at the present time (June 1990) and could probably use some
819
FUNCTION {format.article.crossref}
822
{ "need key or journal for " cite$ * " to crossref " * crossref *
831
" \cite{" * crossref * "}" *
834
FUNCTION {format.crossref.editor}
835
{ editor #1 "{vv~}{ll}" format.name$
836
editor num.names$ duplicate$
841
{ editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
843
{ " and " * editor #2 "{vv~}{ll}" format.name$ * }
851
FUNCTION {format.book.crossref}
853
{ "empty volume in " cite$ * "'s crossref of " * crossref * warning$
856
{ "vol." volume tie.or.space.connect
861
editor field.or.null author field.or.null =
865
{ "need editor, key, or series for " cite$ * " to crossref " *
875
{ format.crossref.editor * }
877
" \cite{" * crossref * "}" *
880
FUNCTION {format.incoll.inproc.crossref}
882
editor field.or.null author field.or.null =
886
{ "need editor, key, or booktitle for " cite$ * " to crossref " *
890
{ "in \emph{" booktitle * "}" * }
896
{ "in " format.crossref.editor * }
898
" \cite{" * crossref * "}" *
901
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
903
% The main functions for each entry type.
905
% journal, vol and year are formatted together because they are
906
% not separated by commas.
910
format.collaboration output
911
format.authors "author" output.check
912
format.title "title" output.check
916
{ format.journal.vol.year add.doi "journal, volume, and year" output.check
918
format.pages "pages" output.check
922
{format.eprint output}
923
{blank.sep format.report output format.eprint output}
926
{ format.article.crossref output.nonnull
927
format.pages "pages" output.check
938
format.SLACcitation output
944
format.collaboration output
946
{ format.editors "author and editor" output.check }
947
{ format.authors output.nonnull
949
{ "author and editor" editor either.or.check }
954
format.title add.doi "title" output.check
955
format.edition output
957
{ format.bookvolume.series.number output
958
publisher "publisher" output.check
961
{ format.book.crossref output.nonnull
964
format.date "year" output.check
973
format.SLACcitation output
979
format.authors output
980
format.title "title" output.check
991
format.SLACcitation output
997
format.collaboration output
999
{ format.editors "author and editor" output.check }
1000
{ format.authors output.nonnull
1002
{ "author and editor" editor either.or.check }
1007
format.title "title" output.check
1008
format.edition output
1010
{ format.bookvolume.series.number output
1011
format.chapter.pages "chapter and pages" output.check
1012
publisher "publisher" output.check
1015
{ format.chapter.pages "chapter and pages" output.check
1016
format.book.crossref output.nonnull
1019
format.date "year" output.check
1022
format.eprint output
1028
format.SLACcitation output
1032
FUNCTION {incollection}
1034
format.collaboration output
1035
format.authors "author" output.check
1036
format.title add.doi "title" output.check
1038
{ format.incoll.title.editors "booktitle" output.check
1039
format.bookvolume.series.number output
1040
publisher "publisher" output.check
1042
format.edition output
1043
format.date "year" output.check
1045
{ format.incoll.inproc.crossref output.nonnull
1048
format.book.pages output
1051
format.eprint output
1057
format.SLACcitation output
1061
FUNCTION {inproceedings}
1063
format.collaboration output
1064
format.authors "author" output.check
1065
format.title add.doi "title" output.check
1067
{ format.inproc.title.address.editors "booktitle" output.check
1068
format.bookvolume.series.number output
1071
format.date "year" output.check
1073
{ format.incoll.inproc.crossref output.nonnull
1076
format.book.pages output
1078
format.eprint output
1085
format.SLACcitation output
1089
FUNCTION {conference} { inproceedings }
1093
format.collaboration output
1095
{ organization empty$
1097
{ organization output.nonnull
1102
{ format.authors output.nonnull }
1104
format.title "title" output.check
1106
{ organization empty$
1111
{ organization output
1115
format.edition output
1118
format.eprint output
1126
FUNCTION {mastersthesis}
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
1133
format.date "year" output.check
1134
format.book.pages output
1136
format.eprint output
1146
format.collaboration output
1147
format.authors output
1148
format.title add.doi output
1151
format.book.pages output
1153
format.eprint output
1163
FUNCTION {phdthesis}
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
1170
format.date "year" output.check
1171
format.book.pages output
1173
format.eprint output
1179
format.SLACcitation output
1183
FUNCTION {proceedings}
1186
{ organization output }
1187
{ format.editors output.nonnull }
1189
format.title add.doi "title" output.check
1190
format.bookvolume.series.number output
1194
{ organization output }
1197
format.date "year" output.check
1199
{ address output.nonnull
1202
{ organization output }
1205
format.date "year" output.check
1208
format.eprint output
1213
format.SLACcitation output
1218
FUNCTION {techreport}
1220
format.authors "author" output.check
1221
format.title "title" output.check
1222
format.tr.number output.nonnull
1223
institution "institution" output.check
1225
format.date "year" output.check
1226
format.eprint output
1232
FUNCTION {unpublished}
1234
format.authors "author" output.check
1235
format.title "title" output.check
1236
note "note" output.check
1238
format.eprint output
1241
format.SLACcitation output
1245
FUNCTION {default.type} { misc }
1247
MACRO {jan} {"January"}
1249
MACRO {feb} {"February"}
1251
MACRO {mar} {"March"}
1253
MACRO {apr} {"April"}
1257
MACRO {jun} {"June"}
1259
MACRO {jul} {"July"}
1261
MACRO {aug} {"August"}
1263
MACRO {sep} {"September"}
1265
MACRO {oct} {"October"}
1267
MACRO {nov} {"November"}
1269
MACRO {dec} {"December"}
1280
FUNCTION {chop.word}
1283
s #1 len substring$ =
1284
{ s len #1 + global.max$ substring$ }
1289
FUNCTION {sort.format.names}
1293
s num.names$ 'numnames :=
1294
numnames 'namesleft :=
1300
s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1301
nameptr numnames = t "others" = and
1305
nameptr #1 + 'nameptr :=
1306
namesleft #1 - 'namesleft :=
1311
FUNCTION {sort.format.title}
1315
"The " #4 t chop.word
1319
#1 global.max$ substring$
1322
FUNCTION {author.sort}
1325
{ "to sort, need author or key in " cite$ * warning$
1331
{ author sort.format.names }
1335
FUNCTION {author.editor.sort}
1339
{ "to sort, need author, editor, or key in " cite$ * warning$
1345
{ editor sort.format.names }
1348
{ author sort.format.names }
1352
FUNCTION {author.organization.sort}
1354
{ organization empty$
1356
{ "to sort, need author, organization, or key in " cite$ * warning$
1362
{ "The " #4 organization chop.word sortify }
1365
{ author sort.format.names }
1369
FUNCTION {editor.organization.sort}
1371
{ organization empty$
1373
{ "to sort, need editor, organization, or key in " cite$ * warning$
1379
{ "The " #4 organization chop.word sortify }
1382
{ editor sort.format.names }
1391
{ type$ "proceedings" =
1392
'editor.organization.sort
1394
'author.organization.sort
1403
year field.or.null sortify
1410
#1 entry.max$ substring$
1418
STRINGS { longest.label prev.author this.author }
1420
INTEGERS { number.label longest.label.width }
1422
FUNCTION {initialize.longest.label}
1423
{ "" 'longest.label :=
1425
#0 'longest.label.width :=
1426
"abcxyz" 'prev.author :=
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 :=
1448
this.author prev.author =
1449
{ "\bysame" 'bysame := }
1460
EXECUTE {initialize.longest.label}
1462
ITERATE {longest.label.pass}
1464
FUNCTION {write.lines}
1465
{ { duplicate$ "." = NOT }
1471
FUNCTION {begin.bib}
1474
{ preamble$ write$ newline$ }
1476
"\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}"
1478
"\providecommand{\MR}{\relax\ifhmode\unskip\space\fi MR }"
1480
"% \MRhref is called by the amsart/book/proc definition of \MR."
1482
"\providecommand{\MRhref}[2]{%"
1484
" \href{http://www.ams.org/mathscinet-getitem?mr=#1}{#2}"
1488
"\providecommand{\href}[2]{#2}"
1490
"\begin{thebibliography}{" longest.label * "}" *
1496
EXECUTE {init.state.consts}
1498
ITERATE {call.type$}
1502
"\end{thebibliography}" write$ newline$
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 \~}