2 % - changed into texi-long.bst by Graham Percival for GNU LilyPond
3 % - only a minimum of changes were made; some html remains in
4 % this file, but it does not appear in our output
5 % BibTeX bibliography style `html-long'
6 % spits out texinfo-formatted bibliography in place of bbl output
7 % by David Kotz dfk@cs.dartmouth.edu
8 % $Id: html-long.bst,v 1.4 2005/07/21 21:29:50 hjunes Exp $
10 % BibTeX standard bibliography style `alpha'
11 % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
12 % Copyright (C) 1985, all rights reserved.
13 % Copying of this file is authorized only if either
14 % (1) you make absolutely no changes to your copy, including name, or
15 % (2) if you do make changes, you name it something other than
16 % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
17 % This restriction helps ensure that all standard styles are identical.
18 % The file btxbst.doc has the documentation for this style.
20 % DFK added abstract, comment, earlier, keyword, later, URL
53 { label extra.label sort.label }
55 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
57 FUNCTION {init.state.consts}
66 FUNCTION {output.nonnull}
68 output.state mid.sentence =
70 { output.state after.block =
74 { output.state before.all =
76 { add.period$ " " * write$ }
80 mid.sentence 'output.state :=
93 FUNCTION {output.check}
96 { pop$ "empty " t * " in " * cite$ * warning$ }
101 % DFK changed to use cite$ for the label
102 % DFK changed to texinfo, and use URL to make cite key a link
103 FUNCTION {output.bibitem}
108 { "" quote$ * cite$ * quote$ * " HREF=" * quote$ *
109 URL * quote$ * "> " * cite$ * ":</A></DT>" * write$
115 before.all 'output.state :=
118 % DFK changed to HTML
125 { "<br>" write$ newline$
126 "See also earlier version <A HREF=" quote$ * "#" * earlier * quote$ *
127 ">" * earlier * "</A>." * write$ newline$
132 { "<br>" write$ newline$
133 "See also later version <A HREF=" quote$ * "#" * later * quote$ *
134 ">" * later * "</A>." * write$ newline$
141 { output.state before.all =
143 { after.block 'output.state := }
147 FUNCTION {new.sentence}
148 { output.state after.block =
150 { output.state before.all =
152 { after.sentence 'output.state := }
176 FUNCTION {new.block.checka}
183 FUNCTION {new.block.checkb}
192 FUNCTION {new.sentence.checka}
199 FUNCTION {new.sentence.checkb}
208 FUNCTION {field.or.null}
215 % DFK changed to texinfo
219 { "@emph{" swap$ * "}" * }
223 % DFK added for texinfo strong emphasis
227 { "@strong{" swap$ * "}" * }
231 INTEGERS { nameptr namesleft numnames }
233 % DFK added this, to strip {} and ~ from titles and authors
234 % It's not a great idea, because it will screw up in math mode and some
235 % special characters... but it makes most things much prettier.
236 FUNCTION {author.title.purify}
240 { t #1 #1 substring$ "{" =
241 t #1 #1 substring$ "}" = or
243 { t #1 #1 substring$ "~" =
245 { t #1 #1 substring$ * }
249 t #2 global.max$ substring$ 't :=
254 FUNCTION {format.names}
257 s num.names$ 'numnames :=
258 numnames 'namesleft :=
260 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
277 nameptr #1 + 'nameptr :=
278 namesleft #1 - 'namesleft :=
283 FUNCTION {format.authors}
286 { author format.names author.title.purify }
290 FUNCTION {format.editors}
293 { editor format.names author.title.purify
294 editor num.names$ #1 >
302 % DFK added strong, so it will be bold.
303 FUNCTION {format.title}
306 { title "t" change.case$ author.title.purify strong }
314 { t #1 #1 substring$ "-" =
315 { t #1 #2 substring$ "--" = not
317 t #2 global.max$ substring$ 't :=
319 { { t #1 #1 substring$ "-" = }
321 t #2 global.max$ substring$ 't :=
327 { t #1 #1 substring$ *
328 t #2 global.max$ substring$ 't :=
335 FUNCTION {format.date}
339 { "there's a month but no year in " cite$ * warning$
346 { month " " * year * }
352 % DFK changed emphasize to strong
353 FUNCTION {format.btitle}
354 { title author.title.purify strong
357 FUNCTION {tie.or.space.connect}
358 { duplicate$ text.length$ #3 <
365 FUNCTION {either.or.check}
368 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
372 FUNCTION {format.bvolume}
375 { "volume" volume tie.or.space.connect
378 { " of " * series emphasize * }
380 "volume and number" number either.or.check
385 FUNCTION {format.number.series}
388 { series field.or.null }
389 { output.state mid.sentence =
393 number tie.or.space.connect
395 { "there's a number but no series in " cite$ * warning$ }
396 { " in " * series * }
405 FUNCTION {format.edition}
408 { output.state mid.sentence =
409 { edition "l" change.case$ " edition" * }
410 { edition "t" change.case$ " edition" * }
416 INTEGERS { multiresult }
418 FUNCTION {multi.page.check}
427 swap$ duplicate$ "," =
430 { #1 'multiresult := }
431 { t #2 global.max$ substring$ 't := }
438 FUNCTION {format.pages}
441 { pages multi.page.check
442 { "pages" pages n.dashify tie.or.space.connect }
443 { "page" pages tie.or.space.connect }
449 FUNCTION {format.vol.num.pages}
450 { volume field.or.null
453 { "(" number * ")" * *
455 { "there's a number but no volume in " cite$ * warning$ }
463 { pop$ format.pages }
464 { ":" * pages n.dashify * }
470 FUNCTION {format.chapter.pages}
475 { type "l" change.case$ }
477 chapter tie.or.space.connect
480 { ", " * format.pages * }
486 FUNCTION {format.in.ed.booktitle}
490 { "In " booktitle emphasize * }
491 { "In " format.editors * ", " * booktitle emphasize * }
497 FUNCTION {empty.misc.check}
498 { author empty$ title empty$ howpublished empty$
499 month empty$ year empty$ note empty$
502 { "all relevant fields are empty in " cite$ * warning$ }
507 FUNCTION {format.thesis.type}
511 type "t" change.case$
516 FUNCTION {format.tr.number}
518 { "Technical Report" }
523 { number tie.or.space.connect }
527 FUNCTION {format.article.crossref}
530 { "need key or journal for " cite$ * " to crossref " * crossref *
534 { "In {\em " journal * "\/}" * }
539 " \cite{" * crossref * "}" *
542 FUNCTION {format.crossref.editor}
543 { editor #1 "{vv~}{ll}" format.name$
544 editor num.names$ duplicate$
546 { pop$ " et al." * }
549 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
551 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
559 FUNCTION {format.book.crossref}
561 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
564 { "Volume" volume tie.or.space.connect
569 editor field.or.null author field.or.null =
573 { "need editor, key, or series for " cite$ * " to crossref " *
577 { "{\em " * series * "\/}" * }
583 { format.crossref.editor * }
585 " \cite{" * crossref * "}" *
588 FUNCTION {format.incoll.inproc.crossref}
590 editor field.or.null author field.or.null =
594 { "need editor, key, or booktitle for " cite$ * " to crossref " *
598 { "In {\em " booktitle * "\/}" * }
604 { "In " format.crossref.editor * }
606 " \cite{" * crossref * "}" *
611 % top of stack is the string we want to be a quoted paragraph
612 FUNCTION {format.quotedParagraph}
615 { "<P><QUOTE> " swap$ * " </QUOTE></P>" *}
620 % DFK added, to support comment, private, keyword, etc
621 % next-to-top is field name (eg, "Comment")
622 % top is field value (eg, value of comment)
623 % both are popped; resulting top is either empty,
624 % or string describing field
625 FUNCTION {format.dfkfield}
629 "<strong> " swap$ * ":</strong> " * swap$ * }
636 "Abstract" abstract format.dfkfield format.quotedParagraph write$ newline$
637 "Keyword" keyword format.dfkfield format.quotedParagraph write$ newline$
638 "Comment" comment format.dfkfield format.quotedParagraph write$ newline$
641 % DFK: added a call to dfk.stuff in all entry-type functions below
645 format.authors "author" output.check
647 format.title "title" output.check
650 { journal emphasize "journal" output.check
651 format.vol.num.pages output
652 format.date "year" output.check
654 { format.article.crossref output.nonnull
667 { format.editors "author and editor" output.check }
668 { format.authors output.nonnull
670 { "author and editor" editor either.or.check }
676 format.btitle "title" output.check
678 { format.bvolume output
680 format.number.series output
682 publisher "publisher" output.check
686 format.book.crossref output.nonnull
689 format.edition output
690 format.date "year" output.check
699 format.authors output
701 format.title "title" output.check
702 howpublished address new.block.checkb
715 { format.editors "author and editor" output.check }
716 { format.authors output.nonnull
718 { "author and editor" editor either.or.check }
724 format.btitle "title" output.check
726 { format.bvolume output
727 format.chapter.pages "chapter and pages" output.check
729 format.number.series output
731 publisher "publisher" output.check
734 { format.chapter.pages "chapter and pages" output.check
736 format.book.crossref output.nonnull
739 format.edition output
740 format.date "year" output.check
747 FUNCTION {incollection}
749 format.authors "author" output.check
751 format.title "title" output.check
754 { format.in.ed.booktitle "booktitle" output.check
755 format.bvolume output
756 format.number.series output
757 format.chapter.pages output
759 publisher "publisher" output.check
761 format.edition output
762 format.date "year" output.check
764 { format.incoll.inproc.crossref output.nonnull
765 format.chapter.pages output
774 FUNCTION {inproceedings}
776 format.authors "author" output.check
778 format.title "title" output.check
781 { format.in.ed.booktitle "booktitle" output.check
782 format.bvolume output
783 format.number.series output
786 { organization publisher new.sentence.checkb
789 format.date "year" output.check
791 { address output.nonnull
792 format.date "year" output.check
799 { format.incoll.inproc.crossref output.nonnull
809 FUNCTION {conference} { inproceedings }
814 { organization empty$
816 { organization output.nonnull
821 { format.authors output.nonnull }
824 format.btitle "title" output.check
826 { organization empty$
827 { address new.block.checka
833 { organization address new.block.checkb
838 format.edition output
846 FUNCTION {mastersthesis}
848 format.authors "author" output.check
850 format.title "title" output.check
852 "Master's thesis" format.thesis.type output.nonnull
853 school "school" output.check
855 format.date "year" output.check
864 format.authors output
865 title howpublished new.block.checkb
867 howpublished new.block.checka
879 format.authors "author" output.check
881 format.btitle "title" output.check
883 "PhD thesis" format.thesis.type output.nonnull
884 school "school" output.check
886 format.date "year" output.check
893 FUNCTION {proceedings}
896 { organization output }
897 { format.editors output.nonnull }
900 format.btitle "title" output.check
901 format.bvolume output
902 format.number.series output
905 { publisher new.sentence.checka }
906 { organization publisher new.sentence.checkb
911 format.date "year" output.check
913 { address output.nonnull
914 format.date "year" output.check
918 { organization output }
929 FUNCTION {techreport}
931 format.authors "author" output.check
933 format.title "title" output.check
935 format.tr.number output.nonnull
936 institution "institution" output.check
938 format.date "year" output.check
945 FUNCTION {unpublished}
947 format.authors "author" output.check
949 format.title "title" output.check
951 note "note" output.check
957 FUNCTION {default.type} { misc }
959 MACRO {jan} {"January"}
961 MACRO {feb} {"February"}
963 MACRO {mar} {"March"}
965 MACRO {apr} {"April"}
973 MACRO {aug} {"August"}
975 MACRO {sep} {"September"}
977 MACRO {oct} {"October"}
979 MACRO {nov} {"November"}
981 MACRO {dec} {"December"}
983 MACRO {acmcs} {"ACM Computing Surveys"}
985 MACRO {acta} {"Acta Informatica"}
987 MACRO {cacm} {"Communications of the ACM"}
989 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
991 MACRO {ibmsj} {"IBM Systems Journal"}
993 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
995 MACRO {ieeetc} {"IEEE Transactions on Computers"}
998 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1000 MACRO {ipl} {"Information Processing Letters"}
1002 MACRO {jacm} {"Journal of the ACM"}
1004 MACRO {jcss} {"Journal of Computer and System Sciences"}
1006 MACRO {scp} {"Science of Computer Programming"}
1008 MACRO {sicomp} {"SIAM Journal on Computing"}
1010 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1012 MACRO {tods} {"ACM Transactions on Database Systems"}
1014 MACRO {tog} {"ACM Transactions on Graphics"}
1016 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1018 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1020 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1022 MACRO {tcs} {"Theoretical Computer Science"}
1033 FUNCTION {chop.word}
1036 s #1 len substring$ =
1037 { s len #1 + global.max$ substring$ }
1042 INTEGERS { et.al.char.used }
1044 FUNCTION {initialize.et.al.char.used}
1045 { #0 'et.al.char.used :=
1048 EXECUTE {initialize.et.al.char.used}
1050 FUNCTION {format.lab.names}
1052 s num.names$ 'numnames :=
1055 { #3 'namesleft := }
1056 { numnames 'namesleft := }
1061 { nameptr numnames =
1062 { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1063 { "{\etalchar{+}}" *
1064 #1 'et.al.char.used :=
1066 { s nameptr "{v{}}{l{}}" format.name$ * }
1069 { s nameptr "{v{}}{l{}}" format.name$ * }
1071 nameptr #1 + 'nameptr :=
1072 namesleft #1 - 'namesleft :=
1076 { "{\etalchar{+}}" *
1077 #1 'et.al.char.used :=
1082 { s #1 "{v{}}{l{}}" format.name$
1083 duplicate$ text.length$ #2 <
1084 { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
1091 FUNCTION {author.key.label}
1094 { cite$ #1 #3 substring$ }
1095 { key #3 text.prefix$ }
1098 { author format.lab.names }
1102 FUNCTION {author.editor.key.label}
1106 { cite$ #1 #3 substring$ }
1107 { key #3 text.prefix$ }
1110 { editor format.lab.names }
1113 { author format.lab.names }
1117 FUNCTION {author.key.organization.label}
1120 { organization empty$
1121 { cite$ #1 #3 substring$ }
1122 { "The " #4 organization chop.word #3 text.prefix$ }
1125 { key #3 text.prefix$ }
1128 { author format.lab.names }
1132 FUNCTION {editor.key.organization.label}
1135 { organization empty$
1136 { cite$ #1 #3 substring$ }
1137 { "The " #4 organization chop.word #3 text.prefix$ }
1140 { key #3 text.prefix$ }
1143 { editor format.lab.names }
1147 FUNCTION {calc.label}
1151 'author.editor.key.label
1152 { type$ "proceedings" =
1153 'editor.key.organization.label
1155 'author.key.organization.label
1163 year field.or.null purify$ #-1 #2 substring$
1166 year field.or.null purify$ #-1 #4 substring$
1168 sortify 'sort.label :=
1171 FUNCTION {sort.format.names}
1175 s num.names$ 'numnames :=
1176 numnames 'namesleft :=
1182 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1183 nameptr numnames = t "others" = and
1187 nameptr #1 + 'nameptr :=
1188 namesleft #1 - 'namesleft :=
1193 FUNCTION {sort.format.title}
1197 "The " #4 t chop.word
1201 #1 global.max$ substring$
1204 FUNCTION {author.sort}
1207 { "to sort, need author or key in " cite$ * warning$
1213 { author sort.format.names }
1217 FUNCTION {author.editor.sort}
1221 { "to sort, need author, editor, or key in " cite$ * warning$
1227 { editor sort.format.names }
1230 { author sort.format.names }
1234 FUNCTION {author.organization.sort}
1236 { organization empty$
1238 { "to sort, need author, organization, or key in " cite$ * warning$
1244 { "The " #4 organization chop.word sortify }
1247 { author sort.format.names }
1251 FUNCTION {editor.organization.sort}
1253 { organization empty$
1255 { "to sort, need editor, organization, or key in " cite$ * warning$
1261 { "The " #4 organization chop.word sortify }
1264 { editor sort.format.names }
1277 { type$ "proceedings" =
1278 'editor.organization.sort
1280 'author.organization.sort
1290 year field.or.null sortify
1297 % DFK throw away stuff above and use cite$ for sort key
1300 #1 entry.max$ substring$
1308 STRINGS { longest.label last.sort.label next.extra }
1310 INTEGERS { longest.label.width last.extra.num }
1312 FUNCTION {initialize.longest.label}
1313 { "" 'longest.label :=
1314 #0 int.to.chr$ 'last.sort.label :=
1316 #0 'longest.label.width :=
1317 #0 'last.extra.num :=
1320 FUNCTION {forward.pass}
1321 { last.sort.label sort.label =
1322 { last.extra.num #1 + 'last.extra.num :=
1323 last.extra.num int.to.chr$ 'extra.label :=
1325 { "a" chr.to.int$ 'last.extra.num :=
1327 sort.label 'last.sort.label :=
1332 FUNCTION {reverse.pass}
1334 { "a" 'extra.label := }
1337 label extra.label * 'label :=
1338 label width$ longest.label.width >
1339 { label 'longest.label :=
1340 label width$ 'longest.label.width :=
1344 extra.label 'next.extra :=
1347 EXECUTE {initialize.longest.label}
1349 ITERATE {forward.pass}
1351 REVERSE {reverse.pass}
1353 % DFK removed code about et.al.char
1354 % DFK changed to texinfo
1355 FUNCTION {begin.bib}
1356 { "@c bib -> itexi intro" write$ newline$
1357 "@itemize" write$ newline$
1362 EXECUTE {init.state.consts}
1364 ITERATE {call.type$}
1366 % DFK changed to texinfo
1369 "@end itemize" write$ newline$
1370 "@c bib -> itexi end" write$ newline$