Debian Codegraph @

texmf-dist/bibtex/bst/kluwer/klunamed.bst

raw
1 % This style produces citations in the `author-year' format.
2 % It supports two forms of citation: the \cite command produces: (Author, year)
3 % in the text; the \cite* command only: (year) .
4
5
6 ENTRY
7 { address
8 author
9 booktitle
10 chapter
11 edition
12 editor
13 howpublished
14 institution
15 journal
16 key
17 note
18 number
19 organization
20 pages
21 publisher
22 school
23 series
24 title
25 type
26 volume
27 year
28 }
29 {}
30 { label extra.label sort.label }
31
32 INTEGERS { output.state before.all mid.sentence after.sentence
33 after.block after.colon }
34
35 FUNCTION {init.state.consts}
36 { #0 'before.all :=
37 #1 'mid.sentence :=
38 #2 'after.sentence :=
39 #3 'after.block :=
40 #4 'after.colon :=
41 }
42
43 STRINGS { s t }
44
45 FUNCTION {output.nonnull}
46 { 's :=
47 output.state mid.sentence =
48 { ", " * write$ }
49 { output.state after.block =
50 { add.period$ write$
51 newline$
52 "\newblock " write$
53 }
54 { output.state before.all =
55 'write$
56 { output.state after.colon =
57 'write$
58 { add.period$ " " * write$ }
59 if$
60 }
61 if$
62 }
63 if$
64 mid.sentence 'output.state :=
65 }
66 if$
67 s
68 }
69
70 FUNCTION {output.nonnull.extra}
71 { 's :=
72 output.state mid.sentence =
73 { " " * write$ }
74 { output.state after.block =
75 { add.period$ write$
76 newline$
77 "\newblock " write$
78 }
79 { output.state before.all =
80 'write$
81 { output.state after.colon =
82 'write$
83 { add.period$ " " * write$ }
84 if$
85 }
86 if$
87 }
88 if$
89 mid.sentence 'output.state :=
90 }
91 if$
92 s
93 }
94
95 FUNCTION {output}
96 { duplicate$ empty$
97 'pop$
98 'output.nonnull
99 if$
100 }
101
102 FUNCTION {output.extra}
103 { duplicate$ empty$
104 'pop$
105 'output.nonnull.extra
106 if$
107 }
108
109 FUNCTION {output.check}
110 { 't :=
111 duplicate$ empty$
112 { pop$ "empty " t * " in " * cite$ * warning$ }
113 'output.nonnull
114 if$
115 }
116
117 FUNCTION {output.check.extra}
118 { 't :=
119 duplicate$ empty$
120 { pop$ "empty " t * " in " * cite$ * warning$ }
121 'output.nonnull.extra
122 if$
123 }
124
125 FUNCTION {output.year.check}
126 { year empty$
127 { "empty year in " cite$ * warning$ }
128 { write$
129 ": " year * extra.label *
130 mid.sentence 'output.state :=
131 }
132 if$
133 }
134
135 FUNCTION {output.bibitem}
136 { newline$
137 "\bibitem[" write$
138 label write$
139 "]{" write$
140 cite$ write$
141 "}" write$
142 newline$
143 ""
144 before.all 'output.state :=
145 }
146
147 FUNCTION {fin.entry}
148 { add.period$
149 write$
150 newline$
151 }
152
153 FUNCTION {new.block}
154 { output.state before.all =
155 'skip$
156 { after.block 'output.state := }
157 if$
158 }
159
160 FUNCTION {new.sentence}
161 { output.state after.block =
162 'skip$
163 { output.state before.all =
164 'skip$
165 { after.sentence 'output.state := }
166 if$
167 }
168 if$
169 }
170
171 FUNCTION {not}
172 { { #0 }
173 { #1 }
174 if$
175 }
176
177 FUNCTION {and}
178 { 'skip$
179 { pop$ #0 }
180 if$
181 }
182
183 FUNCTION {or}
184 { { pop$ #1 }
185 'skip$
186 if$
187 }
188
189 FUNCTION {new.block.checkb}
190 { empty$
191 swap$ empty$
192 and
193 'skip$
194 'new.block
195 if$
196 }
197
198 FUNCTION {field.or.null}
199 { duplicate$ empty$
200 { pop$ "" }
201 'skip$
202 if$
203 }
204
205 FUNCTION {boldface}
206 { duplicate$ empty$
207 { pop$ "" }
208 { "{\bf " swap$ * "}" * }
209 if$
210 }
211
212 FUNCTION {emphasize}
213 { duplicate$ empty$
214 { pop$ "" }
215 { "{\em " swap$ * "}" * }
216 if$
217 }
218
219 INTEGERS { nameptr namesleft numnames }
220
221 FUNCTION {format.names}
222 { 's :=
223 #1 'nameptr :=
224 s num.names$ 'numnames :=
225 numnames 'namesleft :=
226 { namesleft #0 > }
227 { nameptr #1 >
228 { s nameptr "{f. }{vv~}{ll}{, jj}" format.name$ 't := }
229 { s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't := }
230 if$
231 nameptr #1 >
232 { namesleft #1 >
233 { ", " * t * }
234 { numnames #2 >
235 { "," * }
236 'skip$
237 if$
238 t "others" =
239 { " et~al." * }
240 { " and " * t * }
241 if$
242 }
243 if$
244 }
245 't
246 if$
247 nameptr #1 + 'nameptr :=
248 namesleft #1 - 'namesleft :=
249 }
250 while$
251 }
252
253 FUNCTION {format.ed.names}
254 { 's :=
255 #1 'nameptr :=
256 s num.names$ 'numnames :=
257 numnames 'namesleft :=
258 { namesleft #0 > }
259 { nameptr #1 >
260 { s nameptr "{f. }{vv~}{ll}{, jj}" format.name$ 't := }
261 { s nameptr "{f. }{vv~}{ll}{, jj}" format.name$ 't := }
262 if$
263 nameptr #1 >
264 { namesleft #1 >
265 { ", " * t * }
266 { numnames #2 >
267 { "," * }
268 'skip$
269 if$
270 t "others" =
271 { " et~al." * }
272 { " and " * t * }
273 if$
274 }
275 if$
276 }
277 't
278 if$
279 nameptr #1 + 'nameptr :=
280 namesleft #1 - 'namesleft :=
281 }
282 while$
283 }
284
285 FUNCTION {format.authors}
286 { author empty$
287 { "" }
288 { author format.names }
289 if$
290 }
291
292 FUNCTION {format.key}
293 { empty$
294 { key field.or.null }
295 { "" }
296 if$
297 }
298
299 FUNCTION {format.editors}
300 { editor empty$
301 { "" }
302 { editor format.names
303 editor num.names$ #1 >
304 { " (eds.)" * }
305 { " (ed.)" * }
306 if$
307 }
308 if$
309 }
310
311 FUNCTION {format.editors.extra}
312 { editor empty$
313 { "" }
314 { editor format.ed.names
315 editor num.names$ #1 >
316 { " (eds.)" * }
317 { " (ed.)" * }
318 if$
319 }
320 if$
321 }
322
323 FUNCTION {format.title}
324 { title empty$
325 { "" }
326 { "`" title "'" * * }
327 if$
328 }
329
330 FUNCTION {n.dashify}
331 { 't :=
332 ""
333 { t empty$ not }
334 { t #1 #1 substring$ "-" =
335 { t #1 #2 substring$ "--" = not
336 { "--" *
337 t #2 global.max$ substring$ 't :=
338 }
339 { { t #1 #1 substring$ "-" = }
340 { "-" *
341 t #2 global.max$ substring$ 't :=
342 }
343 while$
344 }
345 if$
346 }
347 { t #1 #1 substring$ *
348 t #2 global.max$ substring$ 't :=
349 }
350 if$
351 }
352 while$
353 }
354
355 FUNCTION {first.page.number}
356 { 't :=
357 ""
358 { t "" =
359 { #0 }
360 { t #1 #1 substring$ "-" = not }
361 if$
362 }
363 { t #1 #1 substring$ *
364 t #2 global.max$ substring$ 't :=
365 }
366 while$
367 }
368
369 FUNCTION {format.btitle}
370 { title emphasize
371 }
372
373 FUNCTION {tie.or.space.connect}
374 { duplicate$ text.length$ #3 <
375 { "~" }
376 { " " }
377 if$
378 swap$ * *
379 }
380
381 FUNCTION {either.or.check}
382 { empty$
383 'pop$
384 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
385 if$
386 }
387
388 FUNCTION {format.bvolume}
389 { volume empty$
390 { "" }
391 { "Vol." volume tie.or.space.connect
392 series empty$
393 'skip$
394 { " of " * series emphasize * }
395 if$
396 "volume and number" number either.or.check
397 }
398 if$
399 }
400
401 FUNCTION {format.number.series}
402 { volume empty$
403 { number empty$
404 { series field.or.null }
405 { output.state mid.sentence =
406 { "No." }
407 { "No." }
408 if$
409 number tie.or.space.connect
410 series empty$
411 { "there's a number but no series in " cite$ * warning$ }
412 { " in " * series * }
413 if$
414 }
415 if$
416 }
417 { "" }
418 if$
419 }
420
421 FUNCTION {format.edition}
422 { edition empty$
423 { "" }
424 { output.state mid.sentence =
425 { edition "l" change.case$ " edition" * }
426 { edition "t" change.case$ " edition" * }
427 if$
428 }
429 if$
430 }
431
432 INTEGERS { multiresult }
433
434 FUNCTION {multi.page.check}
435 { 't :=
436 #0 'multiresult :=
437 { multiresult not
438 t empty$ not
439 and
440 }
441 { t #1 #1 substring$
442 duplicate$ "-" =
443 swap$ duplicate$ "," =
444 swap$ "+" =
445 or or
446 { #1 'multiresult := }
447 { t #2 global.max$ substring$ 't := }
448 if$
449 }
450 while$
451 multiresult
452 }
453
454 FUNCTION {format.pages}
455 { pages empty$
456 { "" }
457 { pages multi.page.check
458 { "pp." pages n.dashify tie.or.space.connect }
459 { "p." pages tie.or.space.connect }
460 if$
461 }
462 if$
463 }
464
465 FUNCTION {format.page}
466 { pages empty$
467 { "" }
468 { "p.~" pages first.page.number * }
469 if$
470 }
471
472 FUNCTION {format.vol.num.pages}
473 { volume field.or.null
474 volume empty$
475 'skip$
476 { boldface }
477 if$
478 number empty$
479 'skip$
480 { "(" number * ")" * *
481 volume empty$
482 { "there's a number but no volume in " cite$ * warning$ }
483 'skip$
484 if$
485 }
486 if$
487 pages empty$
488 'skip$
489 { duplicate$ empty$
490 { pop$ format.pages }
491 { ", " * pages n.dashify * }
492 if$
493 }
494 if$
495 }
496
497 FUNCTION {format.vol.num.page}
498 { volume field.or.null
499 volume empty$
500 'skip$
501 { boldface }
502 if$
503 number empty$
504 'skip$
505 { "(" number * ")" * *
506 volume empty$
507 { "there's a number but no volume in " cite$ * warning$ }
508 'skip$
509 if$
510 }
511 if$
512 pages empty$
513 'skip$
514 { duplicate$ empty$
515 { pop$ format.pages }
516 { ", " * pages first.page.number * }
517 if$
518 }
519 if$
520 }
521
522 FUNCTION {format.chapter.pages}
523 { chapter empty$
524 'format.pages
525 { type empty$
526 { "Chapt." }
527 { type "l" change.case$ }
528 if$
529 chapter tie.or.space.connect
530 pages empty$
531 'skip$
532 { ", " * format.pages * }
533 if$
534 }
535 if$
536 }
537
538 FUNCTION {format.in.ed.booktitle}
539 { booktitle empty$
540 { "" }
541 { editor empty$
542 { "In: " booktitle emphasize * }
543 { "In: " format.editors.extra * ": " * booktitle emphasize * }
544 if$
545 }
546 if$
547 }
548
549 FUNCTION {format.in.booktitle.or.series}
550 { booktitle empty$
551 { series empty$
552 { "" }
553 { "In: " series emphasize * }
554 if$
555 }
556 { editor empty$
557 { "In: " booktitle emphasize * }
558 { "In: " format.editors.extra * ": " * booktitle emphasize * }
559 if$
560 }
561 if$
562 }
563
564 FUNCTION {format.thesis.type}
565 { type empty$
566 'skip$
567 { pop$
568 type "t" change.case$
569 }
570 if$
571 }
572
573 FUNCTION {format.tr.number}
574 { type empty$
575 { "Technical Report" }
576 'type
577 if$
578 number empty$
579 { "t" change.case$ }
580 { number tie.or.space.connect }
581 if$
582 }
583
584 FUNCTION {format.article.crossref}
585 { "In"
586 " \cite{" * crossref * "}" *
587 }
588
589 FUNCTION {format.book.crossref}
590 { volume empty$
591 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
592 "In "
593 }
594 { "Vol." volume tie.or.space.connect
595 " of " *
596 }
597 if$
598 "\cite{" * crossref * "}" *
599 }
600
601 FUNCTION {format.incoll.inproc.crossref}
602 { "In"
603 " \cite{" * crossref * "}" *
604 }
605
606 FUNCTION {article}
607 { output.bibitem
608 format.authors "author" output.check
609 author format.key output
610 output.year.check
611 format.title "title" output.check
612 new.block
613 crossref missing$
614 { journal emphasize "journal" output.check.extra
615 format.vol.num.pages output.extra
616 }
617 { format.article.crossref output.nonnull
618 format.pages output
619 }
620 if$
621 new.block
622 note output
623 fin.entry
624 }
625
626 FUNCTION {book}
627 { output.bibitem
628 author empty$
629 { format.editors "author and editor" output.check
630 editor format.key output
631 }
632 { format.authors output.nonnull
633 crossref missing$
634 { "author and editor" editor either.or.check }
635 'skip$
636 if$
637 }
638 if$
639 output.year.check
640 format.btitle "title" output.check
641 crossref missing$
642 { format.bvolume output
643 format.number.series output
644 new.block
645 address empty$
646 'skip$
647 { address ": " * output
648 after.colon 'output.state :=
649 }
650 if$
651 publisher "publisher" output.check.extra
652 }
653 { new.block
654 format.book.crossref output.nonnull
655 }
656 if$
657 format.edition output
658 new.block
659 note output
660 fin.entry
661 }
662
663 FUNCTION {booklet}
664 { output.bibitem
665 format.authors output
666 author format.key output
667 output.year.check
668 format.btitle "title" output.check
669 new.block
670 howpublished output
671 address output
672 new.block
673 note output
674 fin.entry
675 }
676
677 FUNCTION {inbook}
678 { output.bibitem
679 author empty$
680 { format.editors "author and editor" output.check
681 editor format.key output
682 }
683 { format.authors output.nonnull
684 crossref missing$
685 { "author and editor" editor either.or.check }
686 'skip$
687 if$
688 }
689 if$
690 output.year.check
691 format.btitle "title" output.check
692 crossref missing$
693 { format.bvolume output
694 format.chapter.pages "chapter and pages" output.check
695 format.number.series output
696 new.block
697 address empty$
698 'skip$
699 { address ": " * output
700 after.colon 'output.state :=
701 }
702 if$
703 publisher "publisher" output.check.extra
704 }
705 { format.chapter.pages "chapter and pages" output.check
706 new.block
707 format.book.crossref output.nonnull
708 }
709 if$
710 format.edition output
711 new.block
712 note output
713 fin.entry
714 }
715
716 FUNCTION {incollection}
717 { output.bibitem
718 format.authors "author" output.check
719 author format.key output
720 output.year.check
721 format.title "title" output.check
722 new.block
723 crossref missing$
724 { format.in.ed.booktitle "booktitle" output.check
725 format.bvolume output
726 format.number.series output
727 new.block
728 address empty$
729 'skip$
730 { address ": " * output
731 after.colon 'output.state :=
732 }
733 if$
734 publisher "publisher" output.check.extra
735 format.edition output
736 format.chapter.pages output
737 }
738 { format.incoll.inproc.crossref output.nonnull
739 format.chapter.pages output
740 }
741 if$
742 new.block
743 note output
744 fin.entry
745 }
746
747 FUNCTION {inproceedings}
748 { output.bibitem
749 format.authors "author" output.check
750 author format.key output
751 output.year.check
752 format.title "title" output.check
753 new.block
754 crossref missing$
755 { format.in.booktitle.or.series "booktitle or series" output.check
756 format.bvolume output
757 new.sentence
758 address output
759 format.pages output
760 }
761 { format.incoll.inproc.crossref output.nonnull
762 format.pages output
763 }
764 if$
765 publisher output
766 new.block
767 note output
768 fin.entry
769 }
770
771 FUNCTION {conference} { inproceedings }
772
773 FUNCTION {manual}
774 { output.bibitem
775 format.authors output
776 author format.key output
777 output.year.check
778 format.title "title" output.check
779 new.block
780 organization output
781 address output
782 format.edition output
783 new.block
784 note output
785 fin.entry
786 }
787
788 FUNCTION {mastersthesis}
789 { output.bibitem
790 format.authors "author" output.check
791 author format.key output
792 output.year.check
793 format.title "title" output.check
794 new.block
795 "Master's thesis" format.thesis.type output.nonnull
796 school "school" output.check
797 address output
798 new.block
799 note output
800 fin.entry
801 }
802
803 FUNCTION {misc}
804 { output.bibitem
805 format.authors output
806 author format.key output
807 output.year.check
808 format.title output
809 new.block
810 howpublished output
811 new.block
812 note output
813 fin.entry
814 }
815
816 FUNCTION {phdthesis}
817 { output.bibitem
818 format.authors "author" output.check
819 author format.key output
820 output.year.check
821 format.title "title" output.check
822 new.block
823 "Ph.D. thesis" format.thesis.type output.nonnull
824 school "school" output.check
825 address output
826 new.block
827 note output
828 fin.entry
829 }
830
831 FUNCTION {proceedings}
832 { output.bibitem
833 format.editors output
834 editor format.key output
835 output.year.check
836 format.title "title" output.check
837 format.bvolume output
838 format.number.series output
839 new.block
840 address empty$
841 'skip$
842 { address ": " * output
843 after.colon 'output.state :=
844 }
845 if$
846 organization output.extra
847 publisher output
848 new.block
849 note output
850 fin.entry
851 }
852
853 FUNCTION {techreport}
854 { output.bibitem
855 format.authors "author" output.check
856 author format.key output
857 output.year.check
858 format.title "title" output.check
859 new.block
860 format.tr.number output.nonnull
861 institution "institution" output.check
862 address output
863 new.block
864 note output
865 fin.entry
866 }
867
868 FUNCTION {unpublished}
869 { output.bibitem
870 format.authors "author" output.check
871 author format.key output
872 output.year.check
873 format.title "title" output.check
874 new.block
875 note "note" output.check
876 fin.entry
877 }
878
879 FUNCTION {default.type} { misc }
880
881 MACRO {jan} {"Jan."}
882
883 MACRO {feb} {"Feb."}
884
885 MACRO {mar} {"Mar."}
886
887 MACRO {apr} {"Apr,"}
888
889 MACRO {may} {"May"}
890
891 MACRO {jun} {"June"}
892
893 MACRO {jul} {"July"}
894
895 MACRO {aug} {"Aug."}
896
897 MACRO {sep} {"Sept."}
898
899 MACRO {oct} {"Oct."}
900
901 MACRO {nov} {"Nov."}
902
903 MACRO {dec} {"Dec."}
904
905 READ
906
907 FUNCTION {sortify}
908 { purify$
909 "l" change.case$
910 }
911
912 INTEGERS { len }
913
914 FUNCTION {chop.word}
915 { 's :=
916 'len :=
917 s #1 len substring$ =
918 { s len #1 + global.max$ substring$ }
919 's
920 if$
921 }
922
923 FUNCTION {format.lab.names}
924 { 's :=
925 s #1 "{vv~}{ll}" format.name$
926 s num.names$ duplicate$
927 #2 >
928 { pop$ " et~al." * }
929 { #2 <
930 'skip$
931 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
932 { " et~al." * }
933 { " and " * s #2 "{vv~}{ll}" format.name$ * }
934 if$
935 }
936 if$
937 }
938 if$
939 }
940
941 FUNCTION {author.key.label}
942 { author empty$
943 { key empty$
944 { cite$ #1 #3 substring$ }
945 'key
946 if$
947 }
948 { author format.lab.names }
949 if$
950 }
951
952 FUNCTION {author.editor.key.label}
953 { author empty$
954 { editor empty$
955 { key empty$
956 { cite$ #1 #3 substring$ }
957 'key
958 if$
959 }
960 { editor format.lab.names }
961 if$
962 }
963 { author format.lab.names }
964 if$
965 }
966
967 FUNCTION {editor.key.label}
968 { editor empty$
969 { key empty$
970 { cite$ #1 #3 substring$ }
971 'key
972 if$
973 }
974 { editor format.lab.names }
975 if$
976 }
977
978 FUNCTION {calc.label}
979 { type$ "book" =
980 type$ "inbook" =
981 or
982 'author.editor.key.label
983 { type$ "proceedings" =
984 'editor.key.label
985 'author.key.label
986 if$
987 }
988 if$
989 "\protect\citeauthoryear{" swap$ * "}{"
990 *
991 year field.or.null purify$ #-1 #4 substring$
992 *
993 'label :=
994 }
995
996 FUNCTION {sort.format.names}
997 { 's :=
998 #1 'nameptr :=
999 ""
1000 s num.names$ 'numnames :=
1001 numnames 'namesleft :=
1002 { namesleft #0 > }
1003 { nameptr #1 >
1004 { " " * }
1005 'skip$
1006 if$
1007 s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't :=
1008 nameptr numnames = t "others" = and
1009 { "et al" * }
1010 { t sortify * }
1011 if$
1012 nameptr #1 + 'nameptr :=
1013 namesleft #1 - 'namesleft :=
1014 }
1015 while$
1016 }
1017
1018 FUNCTION {sort.format.title}
1019 { 't :=
1020 "A " #2
1021 "An " #3
1022 "The " #4 t chop.word
1023 chop.word
1024 chop.word
1025 sortify
1026 #1 global.max$ substring$
1027 }
1028
1029 FUNCTION {author.sort}
1030 { author empty$
1031 { key empty$
1032 { "to sort, need author or key in " cite$ * warning$
1033 ""
1034 }
1035 { key sortify }
1036 if$
1037 }
1038 { author sort.format.names }
1039 if$
1040 }
1041
1042 FUNCTION {author.editor.sort}
1043 { author empty$
1044 { editor empty$
1045 { key empty$
1046 { "to sort, need author, editor, or key in " cite$ * warning$
1047 ""
1048 }
1049 { key sortify }
1050 if$
1051 }
1052 { editor sort.format.names }
1053 if$
1054 }
1055 { author sort.format.names }
1056 if$
1057 }
1058
1059 FUNCTION {editor.sort}
1060 { editor empty$
1061 { key empty$
1062 { "to sort, need editor or key in " cite$ * warning$
1063 ""
1064 }
1065 { key sortify }
1066 if$
1067 }
1068 { editor sort.format.names }
1069 if$
1070 }
1071
1072 FUNCTION {presort}
1073 { calc.label
1074 label sortify
1075 " "
1076 *
1077 type$ "book" =
1078 type$ "inbook" =
1079 or
1080 'author.editor.sort
1081 { type$ "proceedings" =
1082 'editor.sort
1083 'author.sort
1084 if$
1085 }
1086 if$
1087 #1 entry.max$ substring$
1088 'sort.label :=
1089 sort.label
1090 *
1091 " "
1092 *
1093 title field.or.null
1094 sort.format.title
1095 *
1096 #1 entry.max$ substring$
1097 'sort.key$ :=
1098 }
1099
1100 ITERATE {presort}
1101
1102 SORT % by label, sort.label, title---for final label calculation
1103
1104 STRINGS { last.label next.extra }
1105
1106 INTEGERS { last.extra.num }
1107
1108 FUNCTION {initialize.extra.label.stuff}
1109 { #0 int.to.chr$ 'last.label :=
1110 "" 'next.extra :=
1111 #0 'last.extra.num :=
1112 }
1113
1114 FUNCTION {forward.pass}
1115 { last.label label =
1116 { last.extra.num #1 + 'last.extra.num :=
1117 last.extra.num int.to.chr$ 'extra.label :=
1118 }
1119 { "a" chr.to.int$ 'last.extra.num :=
1120 "" 'extra.label :=
1121 label 'last.label :=
1122 }
1123 if$
1124 }
1125
1126 FUNCTION {reverse.pass}
1127 { next.extra "b" =
1128 { "a" 'extra.label := }
1129 'skip$
1130 if$
1131 label extra.label * "}" * 'label :=
1132 extra.label 'next.extra :=
1133 }
1134
1135 EXECUTE {initialize.extra.label.stuff}
1136
1137 ITERATE {forward.pass}
1138
1139 REVERSE {reverse.pass}
1140
1141 FUNCTION {bib.sort.order}
1142 { sort.label
1143 " "
1144 *
1145 year field.or.null sortify
1146 *
1147 " "
1148 *
1149 title field.or.null
1150 sort.format.title
1151 *
1152 #1 entry.max$ substring$
1153 'sort.key$ :=
1154 }
1155
1156 ITERATE {bib.sort.order}
1157
1158 SORT % by sort.label, year, title---giving final bibliography order
1159
1160 FUNCTION {begin.bib}
1161 { preamble$ empty$
1162 'skip$
1163 { preamble$ write$ newline$ }
1164 if$
1165 "\begin{thebibliography}{}" write$ newline$
1166 }
1167
1168 EXECUTE {begin.bib}
1169
1170 EXECUTE {init.state.consts}
1171
1172 ITERATE {call.type$}
1173
1174 FUNCTION {end.bib}
1175 { newline$
1176 "\end{thebibliography}" write$ newline$
1177 }
1178
1179 EXECUTE {end.bib}
1180
1181