Debian Codegraph @

texmf-dist/bibtex/bst/bibtools/abstract.bst

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