1 %%% ====================================================================
2 %%% @BibTeX-style-file{
3 %%% author = "American Mathematical Society",
4 %%% version = "1.2beta",
5 %%% date = "13-Oct-1994",
6 %%% time = "15:31:22 EDT",
7 %%% filename = "amsalpha.bst",
8 %%% copyright = "Copyright (C) 1994 American Mathematical Society,
9 %%% all rights reserved. Copying of this file is
10 %%% authorized only if either:
11 %%% (1) you make absolutely no changes to your copy,
12 %%% including name; OR
13 %%% (2) if you do make changes, you first rename it
14 %%% to some other name.",
15 %%% address = "American Mathematical Society,
16 %%% Technical Support,
17 %%% Electronic Products and Services,
19 %%% Providence, RI 02940,
21 %%% telephone = "401-455-4080 or (in the USA and Canada)
22 %%% 800-321-4AMS (321-4267)",
23 %%% FAX = "401-331-3842",
24 %%% checksum = "16562 1382 4093 29485",
26 %%% codetable = "ISO/ASCII",
27 %%% keywords = "bibtex, bibliography, amslatex, ams-latex",
28 %%% supported = "yes",
29 %%% abstract = "BibTeX bibliography style amsalpha for BibTeX
30 %%% versions 0.99a or later and LaTeX version 2e.
31 %%% Produces alphabetic-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 %%% ====================================================================
43 % See the file btxbst.doc for extra documentation other than
44 % what is included here. And see btxhak.tex for a description
45 % of the BibTeX language and how to use it.
47 % This defines the types of fields that can occur in a database entry
48 % for this particular bibliography style. Except for `language',
49 % this is the standard list from alpha.bst.
51 %% Types of entries currently allowed in a BibTeX file:
53 %% ARTICLE -- An article from a journal or magazine.
55 %% BOOK -- A book with an explicit publisher.
57 %% BOOKLET -- A work that is printed and bound,
58 %% but without a named publisher or sponsoring institution.
60 %% CONFERENCE -- The same as INPROCEEDINGS,
61 %% included for Scribe compatibility.
63 %% INBOOK -- A part of a book,
64 %% which may be a chapter (or section or whatever) and/or a range of pages.
66 %% INCOLLECTION -- A part of a book having its own title.
68 %% INPROCEEDINGS -- An article in a conference proceedings.
70 %% MANUAL -- Technical documentation.
72 %% MASTERSTHESIS -- A Master's thesis.
74 %% MISC -- Use this type when nothing else fits.
76 %% PHDTHESIS -- A PhD thesis.
78 %% PROCEEDINGS -- The proceedings of a conference.
80 %% TECHREPORT -- A report published by a school or other institution,
81 %% usually numbered within a series.
83 %% UNPUBLISHED -- A document having an author and title, but not formally
112 { label extra.label sort.label }
114 % Removed after.sentence, after.block---not needed.
116 INTEGERS { output.state before.all mid.sentence }
118 FUNCTION {init.state.consts}
130 { duplicate$ ":::: `" swap$ * "'" * top$
134 {"STACK====================================================================="
137 "ENDSTACK=================================================================="
159 FUNCTION {field.or.null}
169 { "\emph{" swap$ * "}" * }
173 % n.dashify is used to make sure page ranges get the TeX code
174 % (two hyphens) for en-dashes.
180 { t #1 #1 substring$ "-" =
181 { t #1 #2 substring$ "--" = not
183 t #2 global.max$ substring$ 't :=
185 { { t #1 #1 substring$ "-" = }
187 t #2 global.max$ substring$ 't :=
193 { t #1 #1 substring$ *
194 t #2 global.max$ substring$ 't :=
201 % tie.or.space.connect connects two items with a ~ if the
202 % second item is less than 3 letters long, otherwise it just puts an
205 FUNCTION {tie.or.space.connect}
206 { duplicate$ text.length$ #3 <
213 FUNCTION {add.space.if.necessary}
220 % either.or.check gives a warning if two mutually exclusive fields
221 % were used in the database.
223 FUNCTION {either.or.check}
226 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
230 % output.nonnull is called by output.
232 FUNCTION {output.nonnull}
233 % remove the top item from the stack because it's in the way.
235 output.state mid.sentence =
236 % If we're in mid-sentence, add a comma to the new top item and write it
238 % Otherwise, if we're at the beginning of a bibitem,
239 { output.state before.all =
240 % just write out the top item from the stack;
242 % and the last alternative is that we're at the end of the current
243 % bibitem, so we add a period to the top stack item and write it out.
244 { add.period$ " " * write$ }
246 mid.sentence 'output.state :=
249 % Put the top item back on the stack that we removed earlier.
253 % Output checks to see if the stack top is empty; if not, it
254 % calls output.nonnull to write it out.
263 % Standard warning message for a missing or empty field. For the user
264 % we call any such field `missing' without respect to the distinction
265 % made by BibTeX between missing and empty.
267 FUNCTION {missing.warning}
268 { "missing " swap$ * " in " * cite$ * warning$ }
270 % Output.check is like output except that it gives a warning on-screen
271 % if the given field in the database entry is empty. t is the field
274 FUNCTION {output.check}
277 { pop$ t missing.warning }
282 FUNCTION {output.bibitem}
290 % This empty string is the first thing that will be written
291 % the next time write$ is called. Done this way because each
292 % item is saved on the stack until we find out what punctuation
293 % should be added after it. Therefore we need an empty first item.
295 before.all 'output.state :=
304 % Removed new.block, new.block.checka, new.block.checkb, new.sentence,
305 % new.sentence.checka, and new.sentence.checkb functions here, since they
306 % don't seem to be needed in the AMS style. Also moved some real
307 % basic functions like `and' and 'or' earlier in the file.
309 INTEGERS { nameptr namesleft numnames }
311 % The extra section to write out a language field was added
312 % for AMSPLAIN.BST. Not present in plain.bst.
314 FUNCTION {format.language}
317 { " (" language * ")" * }
321 % This version of format.names puts names in the format
323 % First von Last, Jr.
325 % (i.e., first name first, no abbreviating to initials).
327 FUNCTION {format.names}
330 s num.names$ 'numnames :=
331 numnames 'namesleft :=
333 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
350 nameptr #1 + 'nameptr :=
351 namesleft #1 - 'namesleft :=
356 FUNCTION {format.authors}
359 { extra.label "\bysame" =
361 { author format.names }
367 FUNCTION {format.editors}
370 { editor format.names
371 editor num.names$ #1 >
379 FUNCTION {format.nonauthor.editors}
382 { editor format.names
383 editor num.names$ #1 >
391 FUNCTION {format.title}
394 { title "t" change.case$ emphasize }
398 FUNCTION {format.journal.vol.year}
400 { "" "journal name" missing.warning }
404 { " \textbf{" * volume * "}" * }
407 { "year" missing.warning }
408 { " (" * year * ")" * }
414 % For formatting the issue number for a journal article.
416 FUNCTION {format.number}
423 % For formatting miscellaneous dates
425 FUNCTION {format.date}
429 { "there's a month but no year in " cite$ * warning$
436 { month " " * year * }
442 %% The volume, series and number information is sort of tricky.
443 %% This code handles it as follows:
444 %% If the series is present, and the volume, but not the number,
445 %% then we do "\emph{Book title}, Series Name, vol. 000"
446 %% If the series is present, and the number, but not the volume,
447 %% then we do "\emph{Book title}, Series Name, no. 000"
448 %% If the series is present, and both number and volume,
449 %% then we do "\emph{Book title}, vol. XX, Series Name, no. 000"
450 %% Finally, if the series is absent,
451 %% then we do "\emph{Book title}, vol. XX"
452 %% or "\emph{Book title}, no. 000"
453 %% and if both volume and number are present, give a warning message.
455 FUNCTION {format.bookvolume.series.number}
457 { "" % Push the empty string as a placeholder in case everything else
461 { pop$ series } % if series is not empty put in stack
465 { duplicate$ empty$ % if no preceding material,
466 'skip$ % do nothing, otherwise
467 { ", " * } % add a comma and space to separate.
469 "no." number tie.or.space.connect * % add the number information
473 %% If the volume is NOT EMPTY:
474 { "vol." volume tie.or.space.connect % vol. XX
478 { series ", " * swap$ *} % Series Name, vol. XX
482 { "can't use both volume and number if series info is missing"
484 "in BibTeX entry type `" type$ * "'" * top$
486 { ", " * series * ", no." * number tie.or.space.connect }
493 } % end of format.bookvolume.series.number
495 %% format.inproc.title.where.editors is used by inproceedings entry types
497 FUNCTION {format.inproc.title.address.editors}
500 %% No case changing or emphasizing for the title. We want initial
504 %% We add parentheses around the address (place where conference
508 { add.space.if.necessary "(" * address * ")" * }
510 %% Likewise we add parentheses around the editors' names.
513 { add.space.if.necessary "(" * format.nonauthor.editors * ")" * }
517 %% format.incoll.title.editors is similar to format.inproc... but
518 %% omits the address. For collections that are not proceedings volumes.
520 FUNCTION {format.incoll.title.editors}
523 %% No case changing or emphasizing for the title. We want initial
527 %% We add parentheses around the editors' names.
530 { add.space.if.necessary "(" * format.nonauthor.editors * ")" * }
534 % Desired output for format.number.series:
536 % Lecture Notes in Math., no.~1224
538 FUNCTION {format.number.series}
542 { "there's a number but no series in " cite$ * warning$ }
548 { ", no.~" * number * }
554 FUNCTION {format.edition}
557 { output.state mid.sentence =
558 { edition "l" change.case$ " ed." * }
559 { edition "t" change.case$ " ed." * }
565 INTEGERS { multiresult }
567 FUNCTION {multi.page.check}
576 swap$ duplicate$ "," =
579 { #1 'multiresult := }
580 { t #2 global.max$ substring$ 't := }
587 FUNCTION {format.pages}
594 FUNCTION {format.book.pages}
597 { pages multi.page.check
598 { "pp.~" pages n.dashify * }
605 FUNCTION {format.chapter.pages}
610 { type "l" change.case$ " " * }
615 { ", " * format.book.pages * }
621 FUNCTION {empty.misc.check}
622 { author empty$ title empty$ howpublished empty$
623 month empty$ year empty$ note empty$
626 { "all relevant fields are empty in " cite$ * warning$ }
631 FUNCTION {format.thesis.type}
635 type "t" change.case$
640 FUNCTION {format.tr.number}
647 { number tie.or.space.connect }
651 % The format.crossref functions haven't been paid much attention
652 % at the present time (June 1990) and could probably use some
655 FUNCTION {format.article.crossref}
658 { "need key or journal for " cite$ * " to crossref " * crossref *
667 " \cite{" * crossref * "}" *
670 FUNCTION {format.crossref.editor}
671 { editor #1 "{vv~}{ll}" format.name$
672 editor num.names$ duplicate$
677 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
679 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
687 FUNCTION {format.book.crossref}
689 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
692 { "Vol." volume tie.or.space.connect
697 editor field.or.null author field.or.null =
701 { "need editor, key, or series for " cite$ * " to crossref " *
711 { format.crossref.editor * }
713 " \cite{" * crossref * "}" *
716 FUNCTION {format.incoll.inproc.crossref}
718 editor field.or.null author field.or.null =
722 { "need editor, key, or booktitle for " cite$ * " to crossref " *
726 { "In \emph{" booktitle * "}" * }
732 { "In " format.crossref.editor * }
734 " \cite{" * crossref * "}" *
737 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
739 % The main functions for each entry type.
741 % journal, vol and year are formatted together because they are
742 % not separated by commas.
746 format.authors "author" output.check
747 format.title "title" output.check
749 { format.journal.vol.year "journal, volume, and year" output.check
751 format.pages "pages" output.check
753 { format.article.crossref output.nonnull
765 { format.editors "author and editor" output.check }
766 { format.authors output.nonnull
768 { "author and editor" editor either.or.check }
773 format.title "title" output.check
774 format.edition output
776 { format.bookvolume.series.number output
777 publisher "publisher" output.check
780 { format.book.crossref output.nonnull
783 format.date "year" output.check
791 format.authors output
792 format.title "title" output.check
803 { format.editors "author and editor" output.check }
804 { format.authors output.nonnull
806 { "author and editor" editor either.or.check }
811 title "title" output.check
813 { format.bookvolume.series.number output
814 format.chapter.pages "chapter and pages" output.check
815 format.number.series output
816 publisher "publisher" output.check
819 { format.chapter.pages "chapter and pages" output.check
820 format.book.crossref output.nonnull
823 format.edition output
824 format.date "year" output.check
825 format.book.pages output
831 FUNCTION {incollection}
833 format.authors "author" output.check
834 format.title "title" output.check
836 { format.inproc.title.address.editors "booktitle" output.check
837 format.bookvolume.series.number output
838 publisher "publisher" output.check
840 format.edition output
841 format.date "year" output.check
843 { format.incoll.inproc.crossref output.nonnull
847 format.book.pages output
852 FUNCTION {inproceedings}
854 format.authors "author" output.check
855 format.title "title" output.check
857 { format.inproc.title.address.editors "booktitle" output.check
858 format.bookvolume.series.number output
861 format.date "year" output.check
863 { format.incoll.inproc.crossref output.nonnull
867 format.book.pages output
872 FUNCTION {conference} { inproceedings }
877 { organization empty$
879 { organization output.nonnull
884 { format.authors output.nonnull }
886 format.title "title" output.check
888 { organization empty$
893 { organization output
897 format.edition output
903 FUNCTION {mastersthesis}
905 format.authors "author" output.check
906 format.title "title" output.check
907 "Master's thesis" format.thesis.type output.nonnull
908 school "school" output.check
910 format.date "year" output.check
917 format.authors output
922 format.book.pages output
929 format.authors "author" output.check
930 format.title "title" output.check
931 "Ph.D. thesis" format.thesis.type output.nonnull
932 school "school" output.check
934 format.date "year" output.check
936 format.book.pages output
940 FUNCTION {proceedings}
943 { organization output }
944 { format.editors output.nonnull }
946 format.title "title" output.check
947 format.bookvolume.series.number output
951 { organization output }
954 format.date "year" output.check
956 { address output.nonnull
959 { organization output }
962 format.date "year" output.check
969 FUNCTION {techreport}
971 format.authors "author" output.check
972 format.title "title" output.check
973 format.tr.number output.nonnull
974 institution "institution" output.check
976 format.date "year" output.check
981 FUNCTION {unpublished}
983 format.authors "author" output.check
984 format.title "title" output.check
985 note "note" output.check
990 FUNCTION {default.type} { misc }
992 MACRO {jan} {"January"}
994 MACRO {feb} {"February"}
996 MACRO {mar} {"March"}
998 MACRO {apr} {"April"}
1002 MACRO {jun} {"June"}
1004 MACRO {jul} {"July"}
1006 MACRO {aug} {"August"}
1008 MACRO {sep} {"September"}
1010 MACRO {oct} {"October"}
1012 MACRO {nov} {"November"}
1014 MACRO {dec} {"December"}
1025 FUNCTION {chop.word}
1028 s #1 len substring$ =
1029 { s len #1 + global.max$ substring$ }
1034 INTEGERS { et.al.char.used }
1036 FUNCTION {initialize.et.al.char.used}
1037 { #0 'et.al.char.used :=
1040 EXECUTE {initialize.et.al.char.used}
1042 FUNCTION {format.lab.names}
1044 s num.names$ 'numnames :=
1047 { #3 'namesleft := }
1048 { numnames 'namesleft := }
1053 { nameptr numnames =
1054 { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1055 { "{\etalchar{+}}" *
1056 #1 'et.al.char.used :=
1058 { s nameptr "{v{}}{l{}}" format.name$ * }
1061 { s nameptr "{v{}}{l{}}" format.name$ * }
1063 nameptr #1 + 'nameptr :=
1064 namesleft #1 - 'namesleft :=
1068 { "{\etalchar{+}}" *
1069 #1 'et.al.char.used :=
1074 { s #1 "{v{}}{l{}}" format.name$
1075 duplicate$ text.length$ #2 <
1076 { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
1083 FUNCTION {author.key.label}
1086 { cite$ #1 #3 substring$ }
1087 { key #3 text.prefix$ }
1090 { author format.lab.names }
1094 FUNCTION {author.editor.key.label}
1098 { cite$ #1 #3 substring$ }
1099 { key #3 text.prefix$ }
1102 { editor format.lab.names }
1105 { author format.lab.names }
1109 FUNCTION {author.key.organization.label}
1112 { organization empty$
1113 { cite$ #1 #3 substring$ }
1114 { "The " #4 organization chop.word #3 text.prefix$ }
1117 { key #3 text.prefix$ }
1120 { author format.lab.names }
1124 FUNCTION {editor.key.organization.label}
1127 { organization empty$
1128 { cite$ #1 #3 substring$ }
1129 { "The " #4 organization chop.word #3 text.prefix$ }
1132 { key #3 text.prefix$ }
1135 { editor format.lab.names }
1139 FUNCTION {calc.label}
1143 'author.editor.key.label
1144 { type$ "proceedings" =
1145 'editor.key.organization.label
1147 'author.key.organization.label
1155 year field.or.null purify$ #-1 #2 substring$
1158 year field.or.null purify$ #-1 #4 substring$
1160 sortify 'sort.label :=
1163 FUNCTION {sort.format.names}
1167 s num.names$ 'numnames :=
1168 numnames 'namesleft :=
1174 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1175 nameptr numnames = t "others" = and
1179 nameptr #1 + 'nameptr :=
1180 namesleft #1 - 'namesleft :=
1185 FUNCTION {sort.format.title}
1189 "The " #4 t chop.word
1193 #1 global.max$ substring$
1196 FUNCTION {author.sort}
1199 { "to sort, need author or key in " cite$ * warning$
1205 { author sort.format.names }
1209 FUNCTION {author.editor.sort}
1213 { "to sort, need author, editor, or key in " cite$ * warning$
1219 { editor sort.format.names }
1222 { author sort.format.names }
1226 FUNCTION {author.organization.sort}
1228 { organization empty$
1230 { "to sort, need author, organization, or key in " cite$ * warning$
1236 { "The " #4 organization chop.word sortify }
1239 { author sort.format.names }
1243 FUNCTION {editor.organization.sort}
1245 { organization empty$
1247 { "to sort, need editor, organization, or key in " cite$ * warning$
1253 { "The " #4 organization chop.word sortify }
1256 { editor sort.format.names }
1269 { type$ "proceedings" =
1270 'editor.organization.sort
1272 'author.organization.sort
1282 year field.or.null sortify
1289 #1 entry.max$ substring$
1297 STRINGS { longest.label last.sort.label next.extra }
1299 INTEGERS { longest.label.width last.extra.num }
1301 FUNCTION {initialize.longest.label}
1302 { "" 'longest.label :=
1303 #0 int.to.chr$ 'last.sort.label :=
1305 #0 'longest.label.width :=
1306 #0 'last.extra.num :=
1309 FUNCTION {forward.pass}
1310 { last.sort.label sort.label =
1311 { last.extra.num #1 + 'last.extra.num :=
1312 last.extra.num int.to.chr$ 'extra.label :=
1314 { "a" chr.to.int$ 'last.extra.num :=
1316 sort.label 'last.sort.label :=
1321 FUNCTION {reverse.pass}
1323 { "a" 'extra.label := }
1326 label extra.label * 'label :=
1327 label width$ longest.label.width >
1328 { label 'longest.label :=
1329 label width$ 'longest.label.width :=
1333 extra.label 'next.extra :=
1336 EXECUTE {initialize.longest.label}
1338 ITERATE {forward.pass}
1340 REVERSE {reverse.pass}
1342 FUNCTION {begin.bib}
1344 { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
1349 { preamble$ write$ newline$ }
1351 "\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}"
1353 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
1358 EXECUTE {init.state.consts}
1360 ITERATE {call.type$}
1364 "\end{thebibliography}" write$ newline$
1369 %% {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
1370 %% 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
1371 %% Digits \0\1\2\3\4\5\6\7\8\9
1372 %% Exclamation \! Double quote \" Hash (number) \#
1373 %% Dollar \$ Percent \% Ampersand \&
1374 %% Acute accent \' Left paren \( Right paren \)
1375 %% Asterisk \* Plus \+ Comma \,
1376 %% Minus \- Point \. Solidus \/
1377 %% Colon \: Semicolon \; Less than \<
1378 %% Equals \= Greater than \> Question mark \?
1379 %% Commercial at \@ Left bracket \[ Backslash \\
1380 %% Right bracket \] Circumflex \^ Underscore \_
1381 %% Grave accent \` Left brace \{ Vertical bar \|
1382 %% Right brace \} Tilde \~}