Debian Codegraph @

texmf-dist/bibtex/bst/amscls/amsalpha.bst

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