1 %%% ====================================================================
2 %%% @BibTeX-style-file{
3 %%% author = "American Mathematical Society",
4 %%% version = "1.2beta",
5 %%% date = "13-Oct-1994",
6 %%% time = "15:30:52 EDT",
7 %%% filename = "amsplain.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 = "24224 1242 3737 26872",
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 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 plain.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 }
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}
288 % This empty string is the first thing that will be written
289 % the next time write$ is called. Done this way because each
290 % item is saved on the stack until we find out what punctuation
291 % should be added after it. Therefore we need an empty first item.
293 before.all 'output.state :=
302 % Removed new.block, new.block.checka, new.block.checkb, new.sentence,
303 % new.sentence.checka, and new.sentence.checkb functions here, since they
304 % don't seem to be needed in the AMS style. Also moved some real
305 % basic functions like `and' and 'or' earlier in the file.
307 INTEGERS { nameptr namesleft numnames }
309 % The extra section to write out a language field was added
310 % for AMSPLAIN.BST. Not present in plain.bst.
312 FUNCTION {format.language}
315 { " (" language * ")" * }
319 % This version of format.names puts names in the format
321 % First von Last, Jr.
323 % (i.e., first name first, no abbreviating to initials).
325 FUNCTION {format.names}
328 s num.names$ 'numnames :=
329 numnames 'namesleft :=
331 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
348 nameptr #1 + 'nameptr :=
349 namesleft #1 - 'namesleft :=
354 FUNCTION {format.authors}
357 { extra.label "\bysame" =
359 { author format.names }
365 FUNCTION {format.editors}
368 { editor format.names
369 editor num.names$ #1 >
377 FUNCTION {format.nonauthor.editors}
380 { editor format.names
381 editor num.names$ #1 >
389 FUNCTION {format.title}
392 { title "t" change.case$ emphasize }
396 FUNCTION {format.journal.vol.year}
398 { "journal name" missing.warning ""}
403 { " \textbf{" * volume * "}" * }
406 { "year" missing.warning }
407 { " (" * year * ")" * }
411 % For formatting the issue number for a journal article.
413 FUNCTION {format.number}
420 % For formatting miscellaneous dates
422 FUNCTION {format.date}
426 { "there's a month but no year in " cite$ * warning$
433 { month " " * year * }
439 %% The volume, series and number information is sort of tricky.
440 %% This code handles it as follows:
441 %% If the series is present, and the volume, but not the number,
442 %% then we do "\emph{Book title}, Series Name, vol. 000"
443 %% If the series is present, and the number, but not the volume,
444 %% then we do "\emph{Book title}, Series Name, no. 000"
445 %% If the series is present, and both number and volume,
446 %% then we do "\emph{Book title}, vol. XX, Series Name, no. 000"
447 %% Finally, if the series is absent,
448 %% then we do "\emph{Book title}, vol. XX"
449 %% or "\emph{Book title}, no. 000"
450 %% and if both volume and number are present, give a warning message.
452 FUNCTION {format.bookvolume.series.number}
454 { "" % Push the empty string as a placeholder in case everything else
458 { pop$ series } % if series is not empty put in stack
462 { duplicate$ empty$ % if no preceding material,
463 'skip$ % do nothing, otherwise
464 { ", " * } % add a comma and space to separate.
466 "no." number tie.or.space.connect * % add the number information
470 %% If the volume is NOT EMPTY:
471 { "vol." volume tie.or.space.connect % vol. XX
475 { series ", " * swap$ *} % Series Name, vol. XX
479 { "can't use both volume and number if series info is missing"
481 "in BibTeX entry type `" type$ * "'" * top$
483 { ", " * series * ", no." * number tie.or.space.connect }
490 } % end of format.bookvolume.series.number
492 %% format.inproc.title.where.editors is used by inproceedings entry types
494 FUNCTION {format.inproc.title.address.editors}
497 %% No case changing or emphasizing for the title. We want initial
501 %% We add parentheses around the address (place where conference
505 { add.space.if.necessary "(" * address * ")" * }
507 %% Likewise we add parentheses around the editors' names.
510 { add.space.if.necessary "(" * format.nonauthor.editors * ")" * }
514 %% format.incoll.title.editors is similar to format.inproc... but
515 %% omits the address. For collections that are not proceedings volumes.
517 FUNCTION {format.incoll.title.editors}
520 %% No case changing or emphasizing for the title. We want initial
524 %% We add parentheses around the editors' names.
527 { add.space.if.necessary "(" * format.nonauthor.editors * ")" * }
531 % Desired output for format.number.series:
533 % Lecture Notes in Math., no.~1224
535 FUNCTION {format.number.series}
539 { "there's a number but no series in " cite$ * warning$ }
545 { ", no.~" * number * }
551 FUNCTION {format.edition}
554 { output.state mid.sentence =
555 { edition "l" change.case$ " ed." * }
556 { edition "t" change.case$ " ed." * }
562 INTEGERS { multiresult }
564 FUNCTION {multi.page.check}
573 swap$ duplicate$ "," =
576 { #1 'multiresult := }
577 { t #2 global.max$ substring$ 't := }
584 FUNCTION {format.pages}
591 FUNCTION {format.book.pages}
594 { pages multi.page.check
595 { "pp.~" pages n.dashify * }
602 FUNCTION {format.chapter.pages}
607 { type "l" change.case$ " " * }
612 { ", " * format.book.pages * }
618 FUNCTION {empty.misc.check}
619 { author empty$ title empty$ howpublished empty$
620 month empty$ year empty$ note empty$
623 { "all relevant fields are empty in " cite$ * warning$ }
628 FUNCTION {format.thesis.type}
632 type "t" change.case$
637 FUNCTION {format.tr.number}
644 { number tie.or.space.connect }
648 % The format.crossref functions haven't been paid much attention
649 % at the present time (June 1990) and could probably use some
652 FUNCTION {format.article.crossref}
655 { "need key or journal for " cite$ * " to crossref " * crossref *
664 " \cite{" * crossref * "}" *
667 FUNCTION {format.crossref.editor}
668 { editor #1 "{vv~}{ll}" format.name$
669 editor num.names$ duplicate$
674 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
676 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
684 FUNCTION {format.book.crossref}
686 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
689 { "Vol." volume tie.or.space.connect
694 editor field.or.null author field.or.null =
698 { "need editor, key, or series for " cite$ * " to crossref " *
708 { format.crossref.editor * }
710 " \cite{" * crossref * "}" *
713 FUNCTION {format.incoll.inproc.crossref}
715 editor field.or.null author field.or.null =
719 { "need editor, key, or booktitle for " cite$ * " to crossref " *
723 { "In \emph{" booktitle * "}" * }
729 { "In " format.crossref.editor * }
731 " \cite{" * crossref * "}" *
734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
736 % The main functions for each entry type.
738 % journal, vol and year are formatted together because they are
739 % not separated by commas.
743 format.authors "author" output.check
744 format.title "title" output.check
746 { format.journal.vol.year output
748 format.pages "pages" output.check
750 { format.article.crossref output.nonnull
762 { format.editors "author and editor" output.check }
763 { format.authors output.nonnull
765 { "author and editor" editor either.or.check }
770 format.title "title" output.check
771 format.edition output
773 { format.bookvolume.series.number output
774 publisher "publisher" output.check
777 { format.book.crossref output.nonnull
780 format.date "year" output.check
788 format.authors output
789 format.title "title" output.check
800 { format.editors "author and editor" output.check }
801 { format.authors output.nonnull
803 { "author and editor" editor either.or.check }
808 title "title" output.check
810 { format.bookvolume.series.number output
811 format.chapter.pages "chapter and pages" output.check
812 format.number.series output
813 publisher "publisher" output.check
816 { format.chapter.pages "chapter and pages" output.check
817 format.book.crossref output.nonnull
820 format.edition output
821 format.date "year" output.check
822 format.book.pages output
828 FUNCTION {incollection}
830 format.authors "author" output.check
831 format.title "title" output.check
833 { format.incoll.title.editors "booktitle" output.check
834 format.bookvolume.series.number output
835 publisher "publisher" output.check
837 format.edition output
838 format.date "year" output.check
840 { format.incoll.inproc.crossref output.nonnull
844 format.book.pages output
849 FUNCTION {inproceedings}
851 format.authors "author" output.check
852 format.title "title" output.check
854 { format.inproc.title.address.editors "booktitle" output.check
855 format.bookvolume.series.number output
858 format.date "year" output.check
860 { format.incoll.inproc.crossref output.nonnull
864 format.book.pages output
869 FUNCTION {conference} { inproceedings }
874 { organization empty$
876 { organization output.nonnull
881 { format.authors output.nonnull }
883 format.title "title" output.check
885 { organization empty$
890 { organization output
894 format.edition output
900 FUNCTION {mastersthesis}
902 format.authors "author" output.check
903 format.title "title" output.check
904 "Master's thesis" format.thesis.type output.nonnull
905 school "school" output.check
907 format.date "year" output.check
914 format.authors output
919 format.book.pages output
926 format.authors "author" output.check
927 format.title "title" output.check
928 "Ph.D. thesis" format.thesis.type output.nonnull
929 school "school" output.check
931 format.date "year" output.check
933 format.book.pages output
937 FUNCTION {proceedings}
940 { organization output }
941 { format.editors output.nonnull }
943 format.title "title" output.check
944 format.bookvolume.series.number output
948 { organization output }
951 format.date "year" output.check
953 { address output.nonnull
956 { organization output }
959 format.date "year" output.check
966 FUNCTION {techreport}
968 format.authors "author" output.check
969 format.title "title" output.check
970 format.tr.number output.nonnull
971 institution "institution" output.check
973 format.date "year" output.check
978 FUNCTION {unpublished}
980 format.authors "author" output.check
981 format.title "title" output.check
982 note "note" output.check
987 FUNCTION {default.type} { misc }
989 MACRO {jan} {"January"}
991 MACRO {feb} {"February"}
993 MACRO {mar} {"March"}
995 MACRO {apr} {"April"}
1001 MACRO {jul} {"July"}
1003 MACRO {aug} {"August"}
1005 MACRO {sep} {"September"}
1007 MACRO {oct} {"October"}
1009 MACRO {nov} {"November"}
1011 MACRO {dec} {"December"}
1022 FUNCTION {chop.word}
1025 s #1 len substring$ =
1026 { s len #1 + global.max$ substring$ }
1031 FUNCTION {sort.format.names}
1035 s num.names$ 'numnames :=
1036 numnames 'namesleft :=
1042 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1043 nameptr numnames = t "others" = and
1047 nameptr #1 + 'nameptr :=
1048 namesleft #1 - 'namesleft :=
1053 FUNCTION {sort.format.title}
1057 "The " #4 t chop.word
1061 #1 global.max$ substring$
1064 FUNCTION {author.sort}
1067 { "to sort, need author or key in " cite$ * warning$
1073 { author sort.format.names }
1077 FUNCTION {author.editor.sort}
1081 { "to sort, need author, editor, or key in " cite$ * warning$
1087 { editor sort.format.names }
1090 { author sort.format.names }
1094 FUNCTION {author.organization.sort}
1096 { organization empty$
1098 { "to sort, need author, organization, or key in " cite$ * warning$
1104 { "The " #4 organization chop.word sortify }
1107 { author sort.format.names }
1111 FUNCTION {editor.organization.sort}
1113 { organization empty$
1115 { "to sort, need editor, organization, or key in " cite$ * warning$
1121 { "The " #4 organization chop.word sortify }
1124 { editor sort.format.names }
1133 { type$ "proceedings" =
1134 'editor.organization.sort
1136 'author.organization.sort
1145 year field.or.null sortify
1152 #1 entry.max$ substring$
1160 STRINGS { longest.label prev.author this.author }
1162 INTEGERS { number.label longest.label.width }
1164 FUNCTION {initialize.longest.label}
1165 { "" 'longest.label :=
1167 #0 'longest.label.width :=
1168 "abcxyz" 'prev.author :=
1172 FUNCTION {longest.label.pass}
1173 { number.label int.to.str$ 'label :=
1174 number.label #1 + 'number.label :=
1175 label width$ longest.label.width >
1176 { label 'longest.label :=
1177 label width$ 'longest.label.width :=
1190 this.author prev.author =
1191 { "\bysame" 'extra.label := }
1192 { "" 'extra.label :=
1202 EXECUTE {initialize.longest.label}
1204 ITERATE {longest.label.pass}
1206 FUNCTION {begin.bib}
1209 { preamble$ write$ newline$ }
1211 "\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}"
1213 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
1218 EXECUTE {init.state.consts}
1220 ITERATE {call.type$}
1224 "\end{thebibliography}" write$ newline$
1229 %% {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
1230 %% 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
1231 %% Digits \0\1\2\3\4\5\6\7\8\9
1232 %% Exclamation \! Double quote \" Hash (number) \#
1233 %% Dollar \$ Percent \% Ampersand \&
1234 %% Acute accent \' Left paren \( Right paren \)
1235 %% Asterisk \* Plus \+ Comma \,
1236 %% Minus \- Point \. Solidus \/
1237 %% Colon \: Semicolon \; Less than \<
1238 %% Equals \= Greater than \> Question mark \?
1239 %% Commercial at \@ Left bracket \[ Backslash \\
1240 %% Right bracket \] Circumflex \^ Underscore \_
1241 %% Grave accent \` Left brace \{ Vertical bar \|
1242 %% Right brace \} Tilde \~}