Debian Codegraph @

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

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