Debian Codegraph @

texmf-dist/bibtex/bst/afthesis/thesnumb.bst

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