Debian Codegraph @

texmf-dist/source/bibtex/bibtools/html-alpha.bst

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