1 % $Id: html-btxbst.doc 1.5 2010/12/08 19:02:34 dds Exp $
3 % This file is either "html-btxbst.doc" or was derived from
4 % "html-btxbst.doc" using cpp. "html-btxbst.doc" itself was edited
5 % from "btxbst.doc" and "named.bst".
6 % The following copyright information is from btxbst.doc:
7 % version 0.99b 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 % "named" style (sorted keys of the form [name, year])
16 % Some code for this was taken from "named.bst".
51 { label extra.label sort.label }
53 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
55 FUNCTION {init.state.consts}
64 FUNCTION {output.nonnull}
66 output.state mid.sentence =
68 { output.state after.block =
72 { output.state before.all =
74 { add.period$ " " * write$ }
78 mid.sentence 'output.state :=
91 FUNCTION {output.check}
94 { pop$ "empty " t * " in " * cite$ * warning$ }
99 FUNCTION {output.bibitem}
103 { organization empty$
105 { "<!-- Authors: " organization purify$ * " -->" * write$ newline$ }
108 { "<!-- Authors: " editor purify$ * " -->" * write$ newline$ }
111 { "<!-- Authors: " author purify$ * " -->" * write$ newline$ }
115 { "<!-- Keywords: " keywords * " -->" * write$ newline$ }
117 "<dt><a name=" quote$ * "CITEREF_" * cite$ * quote$ * ">[" * label * "]</a></dt><dd>" * write$
119 before.all 'output.state :=
127 { newline$ "<!-- PostScript: " postscript * " -->" * write$ }
131 { newline$ "<!-- PDF: " pdf * " -->" * write$ }
135 { newline$ "<!-- DVI: " dvi * " -->" * write$ }
139 { newline$ "<!-- DOI: " doi * " -->" * write$ }
147 { output.state before.all =
149 { after.block 'output.state := }
153 FUNCTION {new.sentence}
154 { output.state after.block =
156 { output.state before.all =
158 { after.sentence 'output.state := }
182 FUNCTION {str.to.int}
187 { % Multiply the number on the top of the stack by 10 = 1010 binary
190 duplicate$ + duplicate$ + % x2 x8
192 s #1 #1 substring$ chr.to.int$ #48 - + % #48 is ascii for '0'
193 s #2 global.max$ substring$ 's :=
198 FUNCTION {new.block.checka}
205 FUNCTION {new.block.checkb}
214 FUNCTION {new.sentence.checka}
221 FUNCTION {new.sentence.checkb}
230 FUNCTION {field.or.null}
240 { "<em>" swap$ * "</em>" * }
244 FUNCTION {add.link} % title
252 { "<a href=" quote$ * html * quote$ * ">" * t * "</a>" * }
254 { "<a href=" quote$ * url * quote$ * ">" * t * "</a>" * }
260 FUNCTION {add.mailto} % authors
267 { "<a href=" quote$ * "mailto:" * mailto * quote$ * ">" * t * "</a>" * }
273 INTEGERS { nameptr namesleft numnames }
275 FUNCTION {format.names}
278 s num.names$ 'numnames :=
279 numnames 'namesleft :=
281 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
282 "\bibxhtmlname{" t * "}" * 't :=
299 nameptr #1 + 'nameptr :=
300 namesleft #1 - 'namesleft :=
305 FUNCTION {format.authors}
308 { author format.names }
313 FUNCTION {format.editors}
316 { editor format.names
317 editor num.names$ #1 >
325 FUNCTION {format.title}
328 { title "t" change.case$ }
337 { t #1 #1 substring$ "-" =
338 { t #1 #2 substring$ "--" = not
340 t #2 global.max$ substring$ 't :=
342 { { t #1 #1 substring$ "-" = }
344 t #2 global.max$ substring$ 't :=
350 { t #1 #1 substring$ *
351 t #2 global.max$ substring$ 't :=
358 FUNCTION {format.date}
362 { "there's a month but no year in " cite$ * warning$
369 { month " " * year * }
375 FUNCTION {format.btitle}
380 FUNCTION {tie.or.space.connect}
381 { duplicate$ text.length$ #3 <
388 FUNCTION {either.or.check}
391 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
395 FUNCTION {format.bvolume}
398 { "volume" volume tie.or.space.connect
401 { " of " * series emphasize * }
403 "volume and number" number either.or.check
408 FUNCTION {format.number.series}
411 { series field.or.null }
412 { output.state mid.sentence =
416 number tie.or.space.connect
418 { "there's a number but no series in " cite$ * warning$ }
419 { " in " * series * }
428 FUNCTION {format.edition}
431 { output.state mid.sentence =
432 { edition "l" change.case$ " edition" * }
433 { edition "t" change.case$ " edition" * }
439 INTEGERS { multiresult }
441 FUNCTION {multi.page.check}
450 swap$ duplicate$ "," =
453 { #1 'multiresult := }
454 { t #2 global.max$ substring$ 't := }
461 FUNCTION {format.pages}
464 { pages multi.page.check
465 { "pages" pages n.dashify tie.or.space.connect }
466 { "page" pages tie.or.space.connect }
472 FUNCTION {format.vol.num.pages}
473 { volume field.or.null
476 { "(" number * ")" * *
478 { "there's a number but no volume in " cite$ * warning$ }
486 { pop$ format.pages }
487 { ":" * pages n.dashify * }
493 FUNCTION {format.chapter.pages}
498 { type "l" change.case$ }
500 chapter tie.or.space.connect
503 { ", " * format.pages * }
509 FUNCTION {format.in.ed.booktitle}
513 { "In " booktitle emphasize * }
514 { "In " format.editors * ", " * booktitle emphasize * }
520 FUNCTION {empty.misc.check}
521 { author empty$ title empty$ howpublished empty$
522 month empty$ year empty$ note empty$
525 { "all relevant fields are empty in " cite$ * warning$ }
530 FUNCTION {format.thesis.type}
534 type "t" change.case$
539 FUNCTION {format.tr.number}
541 { "Technical Report" }
546 { number tie.or.space.connect }
550 FUNCTION {format.article.crossref}
552 "In <a href=" quote$ * "#" * crossref * quote$ * ">" *
555 { "need key or journal for " cite$ * " to crossref " * crossref *
559 { "<cite>" * journal * "</cite>" * }
564 "</a> \citelabel{" * crossref * "}" *
567 FUNCTION {format.crossref.editor}
568 { editor #1 "{vv~}{ll}" format.name$
569 editor num.names$ duplicate$
574 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
576 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
584 FUNCTION {format.book.crossref}
586 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
589 { "Volume" volume tie.or.space.connect
593 "<a href=" * quote$ * "#" * crossref * quote$ * ">" *
595 editor field.or.null author field.or.null =
599 { "need editor, key, or series for " cite$ * " to crossref " *
603 { "<cite>" * series * "</cite>" * }
609 { format.crossref.editor * }
611 "</a> \citelabel{" * crossref * "}" *
614 FUNCTION {format.incoll.inproc.crossref}
616 "In <a href=" quote$ * "#" * crossref * quote$ * ">" *
618 editor field.or.null author field.or.null =
622 { "need editor, key, or booktitle for " cite$ * " to crossref " *
626 { "<cite>" * booktitle * "</cite>" * }
632 { format.crossref.editor * }
634 "</a> \citelabel{" * crossref * "}" *
639 format.authors "author" output.check
641 format.title "title" output.check
644 { journal emphasize "journal" output.check
645 format.vol.num.pages output
646 format.date "year" output.check
648 { format.article.crossref output.nonnull
660 { format.editors "author and editor" output.check }
661 { format.authors output.nonnull
663 { "author and editor" editor either.or.check }
669 format.btitle "title" output.check
671 { format.bvolume output
673 format.number.series output
675 publisher "publisher" output.check
679 format.book.crossref output.nonnull
682 format.edition output
683 format.date "year" output.check
691 format.authors output
693 format.title "title" output.check
694 howpublished address new.block.checkb
706 { format.editors "author and editor" output.check }
707 { format.authors output.nonnull
709 { "author and editor" editor either.or.check }
715 format.btitle "title" output.check
717 { format.bvolume output
718 format.chapter.pages "chapter and pages" output.check
720 format.number.series output
722 publisher "publisher" output.check
725 { format.chapter.pages "chapter and pages" output.check
727 format.book.crossref output.nonnull
730 format.edition output
731 format.date "year" output.check
737 FUNCTION {incollection}
739 format.authors "author" output.check
741 format.title "title" output.check
744 { format.in.ed.booktitle "booktitle" output.check
745 format.bvolume output
746 format.number.series output
747 format.chapter.pages output
749 publisher "publisher" output.check
751 format.edition output
752 format.date "year" output.check
754 { format.incoll.inproc.crossref output.nonnull
755 format.chapter.pages output
763 FUNCTION {inproceedings}
765 format.authors "author" output.check
767 format.title "title" output.check
770 { format.in.ed.booktitle "booktitle" output.check
771 format.bvolume output
772 format.number.series output
775 { organization publisher new.sentence.checkb
778 format.date "year" output.check
780 { address output.nonnull
781 format.date "year" output.check
788 { format.incoll.inproc.crossref output.nonnull
797 FUNCTION {conference} { inproceedings }
802 { organization empty$
804 { organization output.nonnull
809 { format.authors output.nonnull }
812 format.btitle "title" output.check
814 { organization empty$
815 { address new.block.checka
821 { organization address new.block.checkb
826 format.edition output
833 FUNCTION {mastersthesis}
835 format.authors "author" output.check
837 format.title "title" output.check
839 "Master's thesis" format.thesis.type output.nonnull
840 school "school" output.check
842 format.date "year" output.check
850 format.authors output
851 title howpublished new.block.checkb
853 howpublished new.block.checka
864 format.authors "author" output.check
866 format.btitle "title" output.check
868 "PhD thesis" format.thesis.type output.nonnull
869 school "school" output.check
871 format.date "year" output.check
877 FUNCTION {proceedings}
880 { organization output }
881 { format.editors output.nonnull }
884 format.btitle "title" output.check
885 format.bvolume output
886 format.number.series output
889 { publisher new.sentence.checka }
890 { organization publisher new.sentence.checkb
895 format.date "year" output.check
897 { address output.nonnull
898 format.date "year" output.check
902 { organization output }
912 FUNCTION {techreport}
914 format.authors "author" output.check
916 format.title "title" output.check
918 format.tr.number output.nonnull
919 institution "institution" output.check
921 format.date "year" output.check
927 FUNCTION {unpublished}
929 format.authors "author" output.check
931 format.title "title" output.check
933 note "note" output.check
938 FUNCTION {default.type} { misc }
940 MACRO {jan} {"January"}
942 MACRO {feb} {"February"}
944 MACRO {mar} {"March"}
946 MACRO {apr} {"April"}
954 MACRO {aug} {"August"}
956 MACRO {sep} {"September"}
958 MACRO {oct} {"October"}
960 MACRO {nov} {"November"}
962 MACRO {dec} {"December"}
964 MACRO {acmcs} {"ACM Computing Surveys"}
966 MACRO {acta} {"Acta Informatica"}
968 MACRO {cacm} {"Communications of the ACM"}
970 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
972 MACRO {ibmsj} {"IBM Systems Journal"}
974 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
976 MACRO {ieeetc} {"IEEE Transactions on Computers"}
979 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
981 MACRO {ipl} {"Information Processing Letters"}
983 MACRO {jacm} {"Journal of the ACM"}
985 MACRO {jcss} {"Journal of Computer and System Sciences"}
987 MACRO {scp} {"Science of Computer Programming"}
989 MACRO {sicomp} {"SIAM Journal on Computing"}
991 MACRO {tocs} {"ACM Transactions on Computer Systems"}
993 MACRO {tods} {"ACM Transactions on Database Systems"}
995 MACRO {tog} {"ACM Transactions on Graphics"}
997 MACRO {toms} {"ACM Transactions on Mathematical Software"}
999 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1001 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1003 MACRO {tcs} {"Theoretical Computer Science"}
1014 FUNCTION {chop.word}
1017 s #1 len substring$ =
1018 { s len #1 + global.max$ substring$ }
1024 FUNCTION {format.lab.names}
1026 s num.names$ 'numnames :=
1028 { s #1 "{vv }{ll}" format.name$ }
1030 { s #1 "{vv }{ll }and " format.name$ s #2 "{vv }{ll}" format.name$ * }
1031 { s #1 "{vv }{ll }" format.name$ "et~al." * }
1037 FUNCTION {author.key.label}
1040 { cite$ #1 #3 substring$ }
1044 { author format.lab.names }
1048 FUNCTION {author.editor.key.label}
1052 { cite$ #1 #3 substring$ }
1056 { editor format.lab.names }
1059 { author format.lab.names }
1063 FUNCTION {author.key.organization.label}
1066 { organization empty$
1067 { cite$ #1 #3 substring$ }
1068 { "The " #4 organization chop.word #3 text.prefix$ }
1074 { author format.lab.names }
1078 FUNCTION {editor.key.organization.label}
1081 { organization empty$
1082 { cite$ #1 #3 substring$ }
1083 { "The " #4 organization chop.word #3 text.prefix$ }
1089 { editor format.lab.names }
1093 FUNCTION {month.to.int}
1095 "l" change.case$ #3 text.prefix$
1108 s "dec" = { #12 } { #13 } % 13 if nothing matches
1109 if$}if$}if$}if$}if$}if$}if$}if$}if$}if$}if$}if$
1113 FUNCTION { get.day }
1114 { month field.or.null 's :=
1116 % Strip out month name
1118 { s "" = not done not and }
1119 { s #1 #1 substring$ " " = 'done :=
1120 s #2 global.max$ substring$ 's :=
1124 % Build up first number in t
1127 { s "" = not done not and }
1128 { s #1 #1 substring$ chr.to.int$ 'c :=
1130 { t c int.to.chr$ * 't := }
1133 s #2 global.max$ substring$ 's :=
1140 FUNCTION { sortify.fourdigit }
1149 FUNCTION { sortify.twodigit }
1154 str.to.int #10 + int.to.str$
1159 FUNCTION {calc.label}
1163 'author.editor.key.label
1164 { type$ "proceedings" =
1165 'editor.key.organization.label
1167 'author.key.organization.label
1180 year field.or.null purify$ * % CHANGED - pfps - 15 Feb 1989
1183 year field.or.null purify$
1187 month field.or.null month.to.int int.to.str$ sortify.twodigit *
1189 get.day int.to.str$ sortify.twodigit *
1191 * sortify 'sort.label :=
1194 FUNCTION {sort.format.names}
1198 s num.names$ 'numnames :=
1199 numnames 'namesleft :=
1205 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1206 nameptr numnames = t "others" = and
1210 nameptr #1 + 'nameptr :=
1211 namesleft #1 - 'namesleft :=
1216 FUNCTION {sort.format.title}
1220 "The " #4 t chop.word
1224 #1 global.max$ substring$
1227 FUNCTION {author.sort}
1230 { "to sort, need author or key in " cite$ * warning$
1236 { author sort.format.names }
1240 FUNCTION {author.editor.sort}
1244 { "to sort, need author, editor, or key in " cite$ * warning$
1250 { editor sort.format.names }
1253 { author sort.format.names }
1257 FUNCTION {author.organization.sort}
1259 { organization empty$
1261 { "to sort, need author, organization, or key in " cite$ * warning$
1267 { "The " #4 organization chop.word sortify }
1270 { author sort.format.names }
1274 FUNCTION {editor.organization.sort}
1276 { organization empty$
1278 { "to sort, need editor, organization, or key in " cite$ * warning$
1284 { "The " #4 organization chop.word sortify }
1287 { editor sort.format.names }
1300 { type$ "proceedings" =
1301 'editor.organization.sort
1303 'author.organization.sort
1313 year field.or.null sortify
1320 #1 entry.max$ substring$
1328 STRINGS { longest.label last.sort.label next.extra }
1330 INTEGERS { longest.label.width last.extra.num }
1332 FUNCTION {initialize.longest.label}
1333 { "" 'longest.label :=
1334 #0 int.to.chr$ 'last.sort.label :=
1336 #0 'longest.label.width :=
1337 #0 'last.extra.num :=
1340 FUNCTION {forward.pass}
1341 { last.sort.label sort.label =
1342 { last.extra.num #1 + 'last.extra.num :=
1343 last.extra.num int.to.chr$ 'extra.label :=
1345 { "a" chr.to.int$ 'last.extra.num :=
1347 sort.label 'last.sort.label :=
1352 FUNCTION {reverse.pass}
1354 { "a" 'extra.label := }
1357 label extra.label * 'label :=
1358 label width$ longest.label.width >
1359 { label 'longest.label :=
1360 label width$ 'longest.label.width :=
1364 extra.label 'next.extra :=
1367 EXECUTE {initialize.longest.label}
1369 ITERATE {forward.pass}
1371 REVERSE {reverse.pass}
1373 FUNCTION {begin.bib}
1375 "# label-style: default" write$ newline$
1380 EXECUTE {init.state.consts}
1382 ITERATE {call.type$}