Debian Codegraph @

texmf-dist/bibtex/bst/babelbib/babamspl.bst

raw
1 %%
2 %% This is file `babamspl.bst',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% babelbib.dtx (with options: `bst,bstams')
8 %%
9 %% babelbib package
10 %%
11 %% Copyright 2003--2021 Harald Harders
12 %% Copyright 2019--2021 Norbert Preining
13 %%
14 %% This program can be redistributed and/or modified under the terms
15 %% of the LaTeX Project Public License Distributed from CTAN
16 %% archives in directory macros/latex/base/lppl.txt; either
17 %% version 1 of the License, or any later version.
18 %%
19 %% [email protected]
20 %% [email protected]
21 %%
22 %% 2021/01/06 v1.34 babelbib: multilingual bibliographies
23 ENTRY
24 { address
25 annote
26 annotelanguage
27 author
28 booktitle
29 chapter
30 edition
31 editor
32 howpublished
33 institution
34 isbn
35 issn
36 journal
37 key
38 language
39 month
40 mrnumber
41 note
42 number
43 organization
44 pages
45 publisher
46 school
47 series
48 title
49 type
50 url
51 urldate
52 volume
53 year
54 }
55 {}
56 { label bysame }
57
58 INTEGERS { output.state before.all mid.sentence }
59
60 FUNCTION {init.state.consts}
61 { #0 'before.all :=
62 #1 'mid.sentence :=
63 }
64
65 STRINGS { s t language.state change.temp}
66
67 FUNCTION {shows}
68 { duplicate$ ":::: `" swap$ * "'" * top$
69 }
70
71 FUNCTION {showstack}
72 {"STACK================================================================"
73 top$
74 stack$
75 "ENDSTACK============================================================="
76 top$
77 }
78
79 FUNCTION {not}
80 { { #0 }
81 { #1 }
82 if$
83 }
84
85 FUNCTION {and}
86 { 'skip$
87 { pop$ #0 }
88 if$
89 }
90
91 FUNCTION {or}
92 { { pop$ #1 }
93 'skip$
94 if$
95 }
96
97 FUNCTION {language.change.case}
98 {
99 'change.temp :=
100 't :=
101 "\btxifchangecase {"
102 t change.temp change.case$ *
103 "}{" *
104 t *
105 "}" *
106 }
107
108 FUNCTION {field.or.null}
109 { duplicate$ empty$
110 { pop$ "" }
111 'skip$
112 if$
113 }
114
115 FUNCTION {namefont}
116 { duplicate$ empty$
117 { pop$ "" }
118 { "\btxnamefont {" swap$ * "}" * }
119 if$
120 }
121
122 FUNCTION {lastnamefont}
123 { duplicate$ empty$
124 { pop$ "" }
125 { "\btxlastnamefont {" swap$ * "}" * }
126 if$
127 }
128
129 FUNCTION {titlefont}
130 { duplicate$ empty$
131 { pop$ "" }
132 { "\btxtitlefont {" swap$ * "}" * }
133 if$
134 }
135
136 FUNCTION {jtitlefont}
137 { duplicate$ empty$
138 { pop$ "" }
139 { "\btxjtitlefont {" swap$ * "}" * }
140 if$
141 }
142
143 FUNCTION {journalfont}
144 { duplicate$ empty$
145 { pop$ "" }
146 { "\btxjournalfont {" swap$ * "}" * }
147 if$
148 }
149
150 FUNCTION {publisherfont}
151 { duplicate$ empty$
152 { pop$ "" }
153 { "\btxpublisherfont {" swap$ * "}" * }
154 if$
155 }
156
157 FUNCTION {volumefont}
158 { duplicate$ empty$
159 { pop$ "" }
160 { "\btxvolumefont {" swap$ * "}" * }
161 if$
162 }
163
164 FUNCTION {etalfont}
165 { duplicate$ empty$
166 { pop$ "" }
167 { "\btxetalfont {" swap$ * "}" * }
168 if$
169 }
170
171 FUNCTION {n.dashify}
172 { 't :=
173 ""
174 { t empty$ not }
175 { t #1 #1 substring$ "-" =
176 { t #1 #2 substring$ "--" = not
177 { "--" *
178 t #2 global.max$ substring$ 't :=
179 }
180 { { t #1 #1 substring$ "-" = }
181 { "-" *
182 t #2 global.max$ substring$ 't :=
183 }
184 while$
185 }
186 if$
187 }
188 { t #1 #1 substring$ *
189 t #2 global.max$ substring$ 't :=
190 }
191 if$
192 }
193 while$
194 }
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 FUNCTION {either.or.check}
212 { empty$
213 'pop$
214 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
215 if$
216 }
217
218 FUNCTION {output.nonnull}
219 { 's :=
220 output.state mid.sentence =
221 { ", " * write$ }
222 { output.state before.all =
223 'write$
224 { add.period$ " " * write$ }
225 if$
226 mid.sentence 'output.state :=
227 }
228 if$
229 s
230 }
231
232 FUNCTION {output}
233 { duplicate$ empty$
234 'pop$
235 'output.nonnull
236 if$
237 }
238
239 FUNCTION {missing.warning}
240 { "missing " swap$ * " in " * cite$ * warning$ }
241
242 FUNCTION {output.check}
243 { 't :=
244 duplicate$ empty$
245 { pop$ t missing.warning }
246 'output.nonnull
247 if$
248 }
249
250 FUNCTION {output.bibitem}
251 { newline$
252 language empty$
253 { "empty language in " cite$ * warning$
254 language.state "nolanguage" =
255 'skip$
256 {
257 "\expandafter\btxselectlanguage\expandafter {"
258 "\btxfallbacklanguage}" * write$
259 newline$
260 }
261 if$
262 "nolanguage" 'language.state :=
263 }
264 { language.state language =
265 'skip$
266 { "\btxselectlanguage {" language * "}" * write$
267 newline$
268 }
269 if$
270 language 'language.state :=
271 }
272 if$
273 "\bibitem {" cite$ * "}" * write$
274 newline$
275 ""
276 before.all 'output.state :=
277 }
278
279 FUNCTION {output.nonempty.mrnumber}
280 { duplicate$ missing$
281 { pop$ "" }
282 'skip$
283 if$
284 duplicate$ empty$
285 'pop$
286 { " \MR{" swap$ * "}" * write$ }
287 if$
288 }
289
290 FUNCTION {fin.entry}
291 { add.period$
292 write$
293 mrnumber output.nonempty.mrnumber
294 newline$
295 }
296
297 INTEGERS { nameptr namesleft numnames }
298
299 FUNCTION {format.language}
300 { language empty$
301 { "" }
302 { "\btxprintamslanguage{\btxlanguagename {" language * "}}" * }
303 if$
304 }
305
306 FUNCTION {format.names}
307 { 's :=
308 #1 'nameptr :=
309 s num.names$ 'numnames :=
310 numnames 'namesleft :=
311 { namesleft #0 > }
312 {
313 s nameptr "{ff{\btxfnamespacelong }~}{vv~}" format.name$
314 s nameptr "{ll}" format.name$ lastnamefont *
315 s nameptr "{, jj}" format.name$ * 't :=
316 nameptr #1 >
317 { namesleft #1 >
318 { ", " * t namefont * }
319 { numnames #2 >
320 { "\btxandcomma {}" * }
321 'skip$
322 if$
323 s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ "others" =
324 { " " * "\btxetalshort {.}" etalfont * }
325 { " \btxandlong {} " * t namefont * }
326 if$
327 }
328 if$
329 }
330 {
331 s nameptr "{ff{\btxfnamespacelong }~}{vv~}" format.name$
332 s nameptr "{ll}" format.name$ lastnamefont *
333 s nameptr "{, jj}" format.name$ * namefont
334 }
335 if$
336 nameptr #1 + 'nameptr :=
337 namesleft #1 - 'namesleft :=
338 }
339 while$
340 }
341
342 FUNCTION {format.authors}
343 { author empty$
344 { "" }
345 { bysame "\bysame" =
346 {"\bysame"}
347 { author format.names }
348 if$
349 }
350 if$
351 }
352
353 FUNCTION {format.editors}
354 { editor empty$
355 { "" }
356 { editor format.names
357 editor num.names$ #1 >
358 { "\ (\btxeditorsshort {.})" * }
359 { "\ (\btxeditorshort {.})" * }
360 if$
361 }
362 if$
363 }
364
365 FUNCTION {format.nonauthor.editors}
366 { editor empty$
367 { "" }
368 { editor format.names
369 editor num.names$ #1 >
370 { ", \btxeditorsshort {.}" * }
371 { ", \btxeditorshort {.}" * }
372 if$
373 }
374 if$
375 }
376
377 FUNCTION {format.title}
378 { title empty$
379 { "" }
380 { title "t" language.change.case titlefont }
381 if$
382 }
383
384 FUNCTION {format.jtitle}
385 { title empty$
386 { "" }
387 { title "t" language.change.case jtitlefont }
388 if$
389 }
390
391 FUNCTION {format.journal.vol.year}
392 { journal empty$
393 { "journal name" missing.warning ""}
394 { journal journalfont }
395 if$
396 volume empty$
397 'skip$
398 { " " * volume volumefont * }
399 if$
400 year empty$
401 { "year" missing.warning }
402 { " (" * year * ")" * }
403 if$
404 }
405
406 FUNCTION {format.number}
407 { number empty$
408 { "" }
409 { "\btxnumbershort {.}~" number * }
410 if$
411 }
412
413 FUNCTION {format.date}
414 { year empty$
415 { month empty$
416 { "" }
417 { "there's a month but no year in " cite$ * warning$
418 month
419 }
420 if$
421 }
422 { month empty$
423 'year
424 { "\btxprintmonthyear{.}{"
425 month * "}{" * year * "}{long}" *
426 }
427 if$
428 }
429 if$
430 }
431
432 FUNCTION {format.bookvolume.series.number}
433 { volume empty$
434 { "" % Push the empty string as a placeholder in case everything else
435 % is empty too.
436 series empty$
437 'skip$
438 { pop$ series } % if series is not empty put in stack
439 if$
440 number empty$
441 'skip$
442 { duplicate$ empty$ % if no preceding material,
443 'skip$ % do nothing, otherwise
444 { ", " * } % add a comma and space to separate.
445 if$
446 "\btxnumbershort {.}" number tie.or.space.connect * % add the number information
447 }
448 if$
449 }
450 { "\btxvolumeshort {.}" volume tie.or.space.connect % vol. XX
451 number empty$
452 { series empty$
453 'skip$
454 { series ", " * swap$ *} % Series Name, vol. XX
455 if$
456 }
457 { series empty$
458 { "can't use both volume and number if series info is missing"
459 warning$
460 "in BibTeX entry type `" type$ * "'" * top$
461 }
462 { ", " * series * ", \btxnumbershort {.}" * number tie.or.space.connect }
463 if$
464 }
465 if$
466 }
467 if$
468
469 } % end of format.bookvolume.series.number
470
471 FUNCTION {format.inproc.title.address.editors}
472 { booktitle empty$
473 { "" }
474 { booktitle
475 address empty$
476 'skip$
477 { add.space.if.necessary "(" * address * ")" * }
478 if$
479 editor empty$
480 'skip$
481 { add.space.if.necessary "(" * format.nonauthor.editors * ")" * }
482 if$
483 }
484 if$
485 }
486
487 FUNCTION {format.incoll.title.editors}
488 { booktitle empty$
489 { "" }
490 { editor empty$
491 { booktitle }
492 { booktitle
493 add.space.if.necessary "(" * format.nonauthor.editors * ")" *
494 }
495 if$
496 }
497 if$
498 }
499
500 FUNCTION {format.edition}
501 { edition empty$
502 { "" }
503 {
504 output.state mid.sentence =
505 { edition "l" change.case$ }
506 { edition "t" change.case$ }
507 if$
508 "\btxeditionnumshort {" swap$ *
509 "}{.}" *
510 }
511 if$
512 }
513
514 FUNCTION {format.isbn}
515 { isbn empty$
516 { "" }
517 { "\mbox{\btxISBN~\btxISBNfont {" isbn * "}}" * }
518 if$
519 }
520
521 FUNCTION {format.issn}
522 { issn empty$
523 { "" }
524 { "\mbox{\btxISSN~\btxISSNfont {" issn * "}}" * }
525 if$
526 }
527
528 FUNCTION {format.url}
529 { url empty$
530 { "" }
531 {
532 urldate empty$
533 { "{\latintext \btxurlfont{" url * "}}" * }
534 {
535 "{\latintext \btxurlfont{" url * "}}\empty " *
536 "\btxurldatecomment {\btxkeywordlanguage {\btxurldatefont{" *
537 urldate * "}}}" *
538 }
539 if$
540 }
541 if$
542 }
543 FUNCTION {write.annote}
544 { annote empty$
545 'skip$
546 {
547 annotelanguage empty$
548 { "\btxkeywordlanguage {" }
549 { "{\selectlanguage {" annotelanguage * "}" * }
550 if$
551 "\btxannotation {" * annote * "}}" *
552 write$ newline$
553 }
554 if$
555 }
556
557 INTEGERS { multiresult }
558
559 FUNCTION {multi.page.check}
560 { 't :=
561 #0 'multiresult :=
562 { multiresult not
563 t empty$ not
564 and
565 }
566 { t #1 #1 substring$
567 duplicate$ "-" =
568 swap$ duplicate$ "," =
569 swap$ "+" =
570 or or
571 { #1 'multiresult := }
572 { t #2 global.max$ substring$ 't := }
573 if$
574 }
575 while$
576 multiresult
577 }
578
579 FUNCTION {format.pages}
580 { pages empty$
581 { "" }
582 { pages n.dashify }
583 if$
584 }
585
586 FUNCTION {format.book.pages}
587 { pages empty$
588 { "" }
589 { pages multi.page.check
590 { "\btxpagesshort {.}~" pages n.dashify * }
591 { "\btxpageshort {.}~" pages * }
592 if$
593 }
594 if$
595 }
596
597 FUNCTION {format.chapter.pages}
598 { chapter empty$
599 'format.book.pages
600 { type empty$
601 { "\btxchaptershort {.}~" }
602 { type "l" language.change.case " " * }
603 if$
604 chapter *
605 pages empty$
606 'skip$
607 { ", " * format.book.pages * }
608 if$
609 }
610 if$
611 }
612
613 FUNCTION {empty.misc.check}
614 { author empty$ title empty$ howpublished empty$
615 month empty$ year empty$ note empty$
616 and and and and and
617 key empty$ not and
618 { "all relevant fields are empty in " cite$ * warning$ }
619 'skip$
620 if$
621 }
622
623 FUNCTION {format.thesis.type}
624 { type empty$
625 'skip$
626 { pop$
627 type "t" language.change.case
628 }
629 if$
630 }
631
632 FUNCTION {format.tr.number}
633 { type empty$
634 { "\Btxtechrepshort {.}" }
635 'type
636 if$
637 number empty$
638 { "t" language.change.case }
639 { number tie.or.space.connect }
640 if$
641 }
642
643 FUNCTION {format.article.crossref}
644 { key empty$
645 { journal empty$
646 { "need key or journal for " cite$ * " to crossref " * crossref *
647 warning$
648 ""
649 }
650 { "\btxinshort {} " journal journalfont * }
651 if$
652 }
653 { "\btxinshort {} " key * }
654 if$
655 " \cite{" * crossref * "}" *
656 }
657
658 FUNCTION {format.crossref.editor}
659 { editor #1 "{vv~}{ll}" format.name$
660 editor num.names$ duplicate$
661 #2 >
662 { pop$ " \btxetalshort {.}" * }
663 { #2 <
664 'skip$
665 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
666 { " \btxetalshort {.}" * }
667 { " \btxandlong {} " * editor #2 "{vv~}{ll}" format.name$ * }
668 if$
669 }
670 if$
671 }
672 if$
673 }
674
675 FUNCTION {format.book.crossref}
676 { volume empty$
677 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
678 "\btxinserieslong {} "
679 }
680 { "\btxvolumeshort {.}" volume tie.or.space.connect
681 " \btxofserieslong {} " *
682 }
683 if$
684 editor empty$
685 editor field.or.null author field.or.null =
686 or
687 { key empty$
688 { series empty$
689 { "need editor, key, or series for " cite$ * " to crossref " *
690 crossref * warning$
691 "" *
692 }
693 { series * }
694 if$
695 }
696 { key * }
697 if$
698 }
699 { format.crossref.editor * }
700 if$
701 " \cite{" * crossref * "}" *
702 }
703
704 FUNCTION {format.incoll.inproc.crossref}
705 { editor empty$
706 editor field.or.null author field.or.null =
707 or
708 { key empty$
709 { booktitle empty$
710 { "need editor, key, or booktitle for " cite$ * " to crossref " *
711 crossref * warning$
712 ""
713 }
714 { "\btxinlong {} " * booktitle titlefont * }
715 if$
716 }
717 { "\btxinlong {} " key * }
718 if$
719 }
720 { "\btxinlong {} " format.crossref.editor * }
721 if$
722 " \cite{" * crossref * "}" *
723 }
724
725 FUNCTION {article}
726 { output.bibitem
727 format.authors "author" output.check
728 format.jtitle "title" output.check
729 crossref missing$
730 { format.journal.vol.year output
731 format.number output
732 format.pages "pages" output.check
733 }
734 { format.article.crossref output.nonnull
735 format.pages "pages" output.check
736 }
737 if$
738 format.issn output
739 format.url output
740 format.language *
741 note output
742 fin.entry
743 write.annote
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 publisherfont
762 address output
763 }
764 { format.book.crossref output.nonnull
765 }
766 if$
767 format.date "year" output.check
768 format.isbn output
769 format.url output
770 format.language *
771 note output
772 fin.entry
773 write.annote
774 }
775
776 FUNCTION {booklet}
777 { output.bibitem
778 format.authors output
779 format.title "title" output.check
780 howpublished output
781 address output
782 format.date output
783 format.url output
784 note output
785 fin.entry
786 write.annote
787 }
788
789 FUNCTION {inbook}
790 { output.bibitem
791 author empty$
792 { format.editors "author and editor" output.check }
793 { format.authors output.nonnull
794 crossref missing$
795 { "author and editor" editor either.or.check }
796 'skip$
797 if$
798 }
799 if$
800 format.title "title" output.check
801 format.edition output
802 crossref missing$
803 { format.bookvolume.series.number output
804 format.chapter.pages "chapter and pages" output.check
805 publisher "publisher" output.check publisherfont
806 address output
807 }
808 { format.chapter.pages "chapter and pages" output.check
809 format.book.crossref output.nonnull
810 }
811 if$
812 format.date "year" output.check
813 format.isbn output
814 format.url output
815 format.language *
816 note output
817 fin.entry
818 write.annote
819 }
820
821 FUNCTION {incollection}
822 { output.bibitem
823 format.authors "author" output.check
824 format.title "title" output.check
825 crossref missing$
826 { format.incoll.title.editors "booktitle" output.check
827 format.bookvolume.series.number output
828 publisher "publisher" output.check publisherfont
829 address output
830 format.edition output
831 format.date "year" output.check
832 }
833 { format.incoll.inproc.crossref output.nonnull
834 }
835 if$
836 note output
837 format.book.pages output
838 format.isbn output
839 format.url output
840 format.language *
841 fin.entry
842 write.annote
843 }
844
845 FUNCTION {inproceedings}
846 { output.bibitem
847 format.authors "author" output.check
848 format.title "title" output.check
849 crossref missing$
850 { format.inproc.title.address.editors "booktitle" output.check
851 format.bookvolume.series.number output
852 organization output
853 publisher publisherfont output
854 format.date "year" output.check
855 }
856 { format.incoll.inproc.crossref output.nonnull
857 }
858 if$
859 note output
860 format.book.pages output
861 format.isbn output
862 format.url output
863 format.language *
864 fin.entry
865 write.annote
866 }
867
868 FUNCTION {conference} { inproceedings }
869
870 FUNCTION {manual}
871 { output.bibitem
872 author empty$
873 { organization empty$
874 'skip$
875 { organization output.nonnull
876 address output
877 }
878 if$
879 }
880 { format.authors output.nonnull }
881 if$
882 format.title "title" output.check
883 author empty$
884 { organization empty$
885 { address output }
886 'skip$
887 if$
888 }
889 { organization output
890 address output
891 }
892 if$
893 format.edition output
894 format.date output
895 format.isbn output
896 format.url output
897 note output
898 fin.entry
899 write.annote
900 }
901
902 FUNCTION {mastersthesis}
903 { output.bibitem
904 format.authors "author" output.check
905 format.title "title" output.check
906 "\btxmastthesis {}" format.thesis.type output.nonnull
907 school "school" output.check
908 address output
909 format.date "year" output.check
910 format.url output
911 note output
912 format.book.pages output
913 fin.entry
914 write.annote
915 }
916
917 FUNCTION {misc}
918 { output.bibitem
919 format.authors output
920 format.title output
921 howpublished output
922 format.date output
923 format.isbn output
924 format.issn output
925 format.url output
926 note output
927 format.book.pages output
928 fin.entry
929 write.annote
930 empty.misc.check
931 }
932
933 FUNCTION {phdthesis}
934 { output.bibitem
935 format.authors "author" output.check
936 format.title "title" output.check
937 "\btxphdthesis {}" format.thesis.type output.nonnull
938 school "school" output.check
939 address output
940 format.date "year" output.check
941 format.isbn output
942 format.url output
943 note output
944 format.book.pages output
945 fin.entry
946 write.annote
947 }
948
949 FUNCTION {proceedings}
950 { output.bibitem
951 editor empty$
952 { organization output }
953 { format.editors output.nonnull }
954 if$
955 format.title "title" output.check
956 format.bookvolume.series.number output
957 address empty$
958 { editor empty$
959 'skip$
960 { organization output }
961 if$
962 publisher publisherfont output
963 format.date "year" output.check
964 }
965 { address output.nonnull
966 editor empty$
967 'skip$
968 { organization output }
969 if$
970 publisher publisherfont output
971 format.date "year" output.check
972 }
973 if$
974 format.isbn output
975 format.url output
976 note output
977 fin.entry
978 write.annote
979 }
980
981 FUNCTION {techreport}
982 { output.bibitem
983 format.authors "author" output.check
984 format.title "title" output.check
985 format.tr.number output.nonnull
986 institution "institution" output.check
987 address output
988 format.date "year" output.check
989 format.isbn output
990 format.url output
991 note output
992 fin.entry
993 write.annote
994 }
995
996 FUNCTION {unpublished}
997 { output.bibitem
998 format.authors "author" output.check
999 format.title "title" output.check
1000 format.url output
1001 note "note" output.check
1002 format.date output
1003 fin.entry
1004 write.annote
1005 }
1006
1007 FUNCTION {default.type} { misc }
1008
1009 MACRO {jan} {"1"}
1010 MACRO {feb} {"2"}
1011 MACRO {mar} {"3"}
1012 MACRO {apr} {"4"}
1013 MACRO {may} {"5"}
1014 MACRO {jun} {"6"}
1015 MACRO {jul} {"7"}
1016 MACRO {aug} {"8"}
1017 MACRO {sep} {"9"}
1018 MACRO {oct} {"10"}
1019 MACRO {nov} {"11"}
1020 MACRO {dec} {"12"}
1021
1022 READ
1023
1024 FUNCTION {sortify}
1025 { purify$
1026 "l" language.change.case
1027 }
1028
1029 INTEGERS { len }
1030
1031 FUNCTION {chop.word}
1032 { 's :=
1033 'len :=
1034 s #1 len substring$ =
1035 { s len #1 + global.max$ substring$ }
1036 's
1037 if$
1038 }
1039
1040 FUNCTION {sort.format.names}
1041 { 's :=
1042 #1 'nameptr :=
1043 ""
1044 s num.names$ 'numnames :=
1045 numnames 'namesleft :=
1046 { namesleft #0 > }
1047 { nameptr #1 >
1048 { " " * }
1049 'skip$
1050 if$
1051 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1052 nameptr numnames = t "others" = and
1053 { "et al" * }
1054 { t sortify * }
1055 if$
1056 nameptr #1 + 'nameptr :=
1057 namesleft #1 - 'namesleft :=
1058 }
1059 while$
1060 }
1061
1062 FUNCTION {sort.format.title}
1063 { 't :=
1064 "A " #2
1065 "An " #3
1066 "The " #4 t chop.word
1067 chop.word
1068 chop.word
1069 sortify
1070 #1 global.max$ substring$
1071 }
1072
1073 FUNCTION {author.sort}
1074 { author empty$
1075 { key empty$
1076 { "to sort, need author or key in " cite$ * warning$
1077 ""
1078 }
1079 { key sortify }
1080 if$
1081 }
1082 { author sort.format.names }
1083 if$
1084 }
1085
1086 FUNCTION {author.editor.sort}
1087 { author empty$
1088 { editor empty$
1089 { key empty$
1090 { "to sort, need author, editor, or key in " cite$ * warning$
1091 ""
1092 }
1093 { key sortify }
1094 if$
1095 }
1096 { editor sort.format.names }
1097 if$
1098 }
1099 { author sort.format.names }
1100 if$
1101 }
1102
1103 FUNCTION {author.organization.sort}
1104 { author empty$
1105 { organization empty$
1106 { key empty$
1107 { "to sort, need author, organization, or key in " cite$ * warning$
1108 ""
1109 }
1110 { key sortify }
1111 if$
1112 }
1113 { "The " #4 organization chop.word sortify }
1114 if$
1115 }
1116 { author sort.format.names }
1117 if$
1118 }
1119
1120 FUNCTION {editor.organization.sort}
1121 { editor empty$
1122 { organization empty$
1123 { key empty$
1124 { "to sort, need editor, organization, or key in " cite$ * warning$
1125 ""
1126 }
1127 { key sortify }
1128 if$
1129 }
1130 { "The " #4 organization chop.word sortify }
1131 if$
1132 }
1133 { editor sort.format.names }
1134 if$
1135 }
1136
1137 FUNCTION {presort}
1138 { type$ "book" =
1139 type$ "inbook" =
1140 or
1141 'author.editor.sort
1142 { type$ "proceedings" =
1143 'editor.organization.sort
1144 { type$ "manual" =
1145 'author.organization.sort
1146 'author.sort
1147 if$
1148 }
1149 if$
1150 }
1151 if$
1152 " "
1153 *
1154 year field.or.null sortify
1155 *
1156 " "
1157 *
1158 title field.or.null
1159 sort.format.title
1160 *
1161 #1 entry.max$ substring$
1162 'sort.key$ :=
1163 }
1164
1165 ITERATE {presort}
1166
1167 SORT
1168
1169 STRINGS { longest.label prev.author this.author }
1170
1171 INTEGERS { number.label longest.label.width }
1172
1173 FUNCTION {initialize.longest.label}
1174 { "" 'longest.label :=
1175 #1 'number.label :=
1176 #0 'longest.label.width :=
1177 "abcxyz" 'prev.author :=
1178 "" 'this.author :=
1179 }
1180
1181 FUNCTION {longest.label.pass}
1182 { number.label int.to.str$ 'label :=
1183 number.label #1 + 'number.label :=
1184 label width$ longest.label.width >
1185 { label 'longest.label :=
1186 label width$ 'longest.label.width :=
1187 }
1188 'skip$
1189 if$
1190 author empty$
1191 { editor empty$
1192 { "" }
1193 'editor
1194 if$
1195 }
1196 'author
1197 if$
1198 'this.author :=
1199 this.author prev.author =
1200 { "\bysame" 'bysame := }
1201 { "" 'bysame :=
1202 this.author "" =
1203 { "abcxyz" }
1204 'this.author
1205 if$
1206 'prev.author :=
1207 }
1208 if$
1209 }
1210
1211 EXECUTE {initialize.longest.label}
1212
1213 ITERATE {longest.label.pass}
1214
1215 FUNCTION {write.lines}
1216 { { duplicate$ "." = NOT }
1217 { write$ newline$ }
1218 while$
1219 pop$
1220 }
1221
1222 FUNCTION {begin.bib}
1223 { preamble$ empty$
1224 'skip$
1225 { preamble$ write$ newline$ }
1226 if$
1227 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
1228 " \providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}"
1229 write$ newline$
1230 " \providecommand{\MR}{\relax\ifhmode\unskip\space\fi MR }"
1231 write$ newline$
1232 " % \MRhref is called by the amsart/book/proc definition of \MR."
1233 write$ newline$
1234 " \providecommand{\MRhref}[2]{%" write$ newline$
1235 " \href{http://www.ams.org/mathscinet-getitem?mr=#1}{#2}"
1236 write$ newline$
1237 " }" write$ newline$
1238 " \providecommand{\href}[2]{#2}" write$ newline$
1239 " \providebibliographyfont{name}{}%" write$ newline$
1240 " \providebibliographyfont{lastname}{}%" write$ newline$
1241 " \providebibliographyfont{title}{\emph}%" write$ newline$
1242 " \providebibliographyfont{jtitle}{\btxtitlefont}%" write$ newline$
1243 " \providebibliographyfont{etal}{}%" write$ newline$
1244 " \providebibliographyfont{journal}{}%" write$ newline$
1245 " \providebibliographyfont{volume}{\textbf}%" write$ newline$
1246 " \providebibliographyfont{ISBN}{\MakeUppercase}%" write$ newline$
1247 " \providebibliographyfont{ISSN}{\MakeUppercase}%" write$ newline$
1248 " \providebibliographyfont{url}{\url}%" write$ newline$
1249 " \providebibliographyfont{numeral}{}%" write$ newline$
1250 " \providecommand\btxprintamslanguage[1]{\ (#1)}" write$ newline$
1251 " \expandafter\btxselectlanguage\expandafter {\btxfallbacklanguage}"
1252 write$ newline$
1253 }
1254
1255 EXECUTE {begin.bib}
1256
1257 EXECUTE {init.state.consts}
1258
1259 ITERATE {call.type$}
1260
1261 FUNCTION {end.bib}
1262 { newline$
1263 "\end{thebibliography}" write$ newline$
1264 }
1265
1266 EXECUTE {end.bib}
1267