Debian Codegraph @

07p/doc/include/agsm.bst

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