Debian Codegraph @

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

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