Debian Codegraph @

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

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