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}
106 { "@item @code{[" cite$ * "]} " * write$ newline$
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 * "}" *
540 " [" * crossref * "]" *
543 FUNCTION {format.crossref.editor}
544 { editor #1 "{vv~}{ll}" format.name$
545 editor num.names$ duplicate$
547 { pop$ " et al." * }
550 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
552 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
560 FUNCTION {format.book.crossref}
562 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
565 { "Volume" volume tie.or.space.connect
570 editor field.or.null author field.or.null =
574 { "need editor, key, or series for " cite$ * " to crossref " *
578 { "{\em " * series * "\/}" * }
584 { format.crossref.editor * }
586 % " \cite{" * crossref * "}" *
587 " [" * crossref * "]" *
590 FUNCTION {format.incoll.inproc.crossref}
592 editor field.or.null author field.or.null =
596 { "need editor, key, or booktitle for " cite$ * " to crossref " *
600 { "In {\em " booktitle * "\/}" * }
606 { "In " format.crossref.editor * }
608 % " \cite{" * crossref * "}" *
609 " [" * crossref * "]" *
614 % top of stack is the string we want to be a quoted paragraph
615 FUNCTION {format.quotedParagraph}
618 { "<P><QUOTE> " swap$ * " </QUOTE></P>" *}
623 % DFK added, to support comment, private, keyword, etc
624 % next-to-top is field name (eg, "Comment")
625 % top is field value (eg, value of comment)
626 % both are popped; resulting top is either empty,
627 % or string describing field
628 FUNCTION {format.dfkfield}
632 "<strong> " swap$ * ":</strong> " * swap$ * }
639 "Abstract" abstract format.dfkfield format.quotedParagraph write$ newline$
640 "Keyword" keyword format.dfkfield format.quotedParagraph write$ newline$
641 "Comment" comment format.dfkfield format.quotedParagraph write$ newline$
644 % DFK: added a call to dfk.stuff in all entry-type functions below
648 format.authors "author" output.check
650 format.title "title" output.check
653 { journal emphasize "journal" output.check
654 format.vol.num.pages output
655 format.date "year" output.check
657 { format.article.crossref output.nonnull
670 { format.editors "author and editor" output.check }
671 { format.authors output.nonnull
673 { "author and editor" editor either.or.check }
679 format.btitle "title" output.check
681 { format.bvolume output
683 format.number.series output
685 publisher "publisher" output.check
689 format.book.crossref output.nonnull
692 format.edition output
693 format.date "year" output.check
702 format.authors output
704 format.title "title" output.check
705 howpublished address new.block.checkb
718 { format.editors "author and editor" output.check }
719 { format.authors output.nonnull
721 { "author and editor" editor either.or.check }
727 format.btitle "title" output.check
729 { format.bvolume output
730 format.chapter.pages "chapter and pages" output.check
732 format.number.series output
734 publisher "publisher" output.check
737 { format.chapter.pages "chapter and pages" output.check
739 format.book.crossref output.nonnull
742 format.edition output
743 format.date "year" output.check
750 FUNCTION {incollection}
752 format.authors "author" output.check
754 format.title "title" output.check
757 { format.in.ed.booktitle "booktitle" output.check
758 format.bvolume output
759 format.number.series output
760 format.chapter.pages output
762 publisher "publisher" output.check
764 format.edition output
765 format.date "year" output.check
767 { format.incoll.inproc.crossref output.nonnull
768 format.chapter.pages output
777 FUNCTION {inproceedings}
779 format.authors "author" output.check
781 format.title "title" output.check
784 { format.in.ed.booktitle "booktitle" output.check
785 format.bvolume output
786 format.number.series output
789 { organization publisher new.sentence.checkb
792 format.date "year" output.check
794 { address output.nonnull
795 format.date "year" output.check
802 { format.incoll.inproc.crossref output.nonnull
812 FUNCTION {conference} { inproceedings }
817 { organization empty$
819 { organization output.nonnull
824 { format.authors output.nonnull }
827 format.btitle "title" output.check
829 { organization empty$
830 { address new.block.checka
836 { organization address new.block.checkb
841 format.edition output
849 FUNCTION {mastersthesis}
851 format.authors "author" output.check
853 format.title "title" output.check
855 "Master's thesis" format.thesis.type output.nonnull
856 school "school" output.check
858 format.date "year" output.check
867 format.authors output
868 title howpublished new.block.checkb
870 howpublished new.block.checka
882 format.authors "author" output.check
884 format.btitle "title" output.check
886 "PhD thesis" format.thesis.type output.nonnull
887 school "school" output.check
889 format.date "year" output.check
896 FUNCTION {proceedings}
899 { organization output }
900 { format.editors output.nonnull }
903 format.btitle "title" output.check
904 format.bvolume output
905 format.number.series output
908 { publisher new.sentence.checka }
909 { organization publisher new.sentence.checkb
914 format.date "year" output.check
916 { address output.nonnull
917 format.date "year" output.check
921 { organization output }
932 FUNCTION {techreport}
934 format.authors "author" output.check
936 format.title "title" output.check
938 format.tr.number output.nonnull
939 institution "institution" output.check
941 format.date "year" output.check
948 FUNCTION {unpublished}
950 format.authors "author" output.check
952 format.title "title" output.check
954 note "note" output.check
960 FUNCTION {default.type} { misc }
962 MACRO {jan} {"January"}
964 MACRO {feb} {"February"}
966 MACRO {mar} {"March"}
968 MACRO {apr} {"April"}
976 MACRO {aug} {"August"}
978 MACRO {sep} {"September"}
980 MACRO {oct} {"October"}
982 MACRO {nov} {"November"}
984 MACRO {dec} {"December"}
986 MACRO {acmcs} {"ACM Computing Surveys"}
988 MACRO {acta} {"Acta Informatica"}
990 MACRO {cacm} {"Communications of the ACM"}
992 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
994 MACRO {ibmsj} {"IBM Systems Journal"}
996 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
998 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1001 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1003 MACRO {ipl} {"Information Processing Letters"}
1005 MACRO {jacm} {"Journal of the ACM"}
1007 MACRO {jcss} {"Journal of Computer and System Sciences"}
1009 MACRO {scp} {"Science of Computer Programming"}
1011 MACRO {sicomp} {"SIAM Journal on Computing"}
1013 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1015 MACRO {tods} {"ACM Transactions on Database Systems"}
1017 MACRO {tog} {"ACM Transactions on Graphics"}
1019 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1021 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1023 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1025 MACRO {tcs} {"Theoretical Computer Science"}
1036 FUNCTION {chop.word}
1039 s #1 len substring$ =
1040 { s len #1 + global.max$ substring$ }
1045 INTEGERS { et.al.char.used }
1047 FUNCTION {initialize.et.al.char.used}
1048 { #0 'et.al.char.used :=
1051 EXECUTE {initialize.et.al.char.used}
1053 FUNCTION {format.lab.names}
1055 s num.names$ 'numnames :=
1058 { #3 'namesleft := }
1059 { numnames 'namesleft := }
1064 { nameptr numnames =
1065 { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1066 { "{\etalchar{+}}" *
1067 #1 'et.al.char.used :=
1069 { s nameptr "{v{}}{l{}}" format.name$ * }
1072 { s nameptr "{v{}}{l{}}" format.name$ * }
1074 nameptr #1 + 'nameptr :=
1075 namesleft #1 - 'namesleft :=
1079 { "{\etalchar{+}}" *
1080 #1 'et.al.char.used :=
1085 { s #1 "{v{}}{l{}}" format.name$
1086 duplicate$ text.length$ #2 <
1087 { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
1094 FUNCTION {author.key.label}
1097 { cite$ #1 #3 substring$ }
1098 { key #3 text.prefix$ }
1101 { author format.lab.names }
1105 FUNCTION {author.editor.key.label}
1109 { cite$ #1 #3 substring$ }
1110 { key #3 text.prefix$ }
1113 { editor format.lab.names }
1116 { author format.lab.names }
1120 FUNCTION {author.key.organization.label}
1123 { organization empty$
1124 { cite$ #1 #3 substring$ }
1125 { "The " #4 organization chop.word #3 text.prefix$ }
1128 { key #3 text.prefix$ }
1131 { author format.lab.names }
1135 FUNCTION {editor.key.organization.label}
1138 { organization empty$
1139 { cite$ #1 #3 substring$ }
1140 { "The " #4 organization chop.word #3 text.prefix$ }
1143 { key #3 text.prefix$ }
1146 { editor format.lab.names }
1150 FUNCTION {calc.label}
1154 'author.editor.key.label
1155 { type$ "proceedings" =
1156 'editor.key.organization.label
1158 'author.key.organization.label
1166 year field.or.null purify$ #-1 #2 substring$
1169 year field.or.null purify$ #-1 #4 substring$
1171 sortify 'sort.label :=
1174 FUNCTION {sort.format.names}
1178 s num.names$ 'numnames :=
1179 numnames 'namesleft :=
1185 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1186 nameptr numnames = t "others" = and
1190 nameptr #1 + 'nameptr :=
1191 namesleft #1 - 'namesleft :=
1196 FUNCTION {sort.format.title}
1200 "The " #4 t chop.word
1204 #1 global.max$ substring$
1207 FUNCTION {author.sort}
1210 { "to sort, need author or key in " cite$ * warning$
1216 { author sort.format.names }
1220 FUNCTION {author.editor.sort}
1224 { "to sort, need author, editor, or key in " cite$ * warning$
1230 { editor sort.format.names }
1233 { author sort.format.names }
1237 FUNCTION {author.organization.sort}
1239 { organization empty$
1241 { "to sort, need author, organization, or key in " cite$ * warning$
1247 { "The " #4 organization chop.word sortify }
1250 { author sort.format.names }
1254 FUNCTION {editor.organization.sort}
1256 { organization empty$
1258 { "to sort, need editor, organization, or key in " cite$ * warning$
1264 { "The " #4 organization chop.word sortify }
1267 { editor sort.format.names }
1280 { type$ "proceedings" =
1281 'editor.organization.sort
1283 'author.organization.sort
1293 year field.or.null sortify
1300 % DFK throw away stuff above and use cite$ for sort key
1303 #1 entry.max$ substring$
1311 STRINGS { longest.label last.sort.label next.extra }
1313 INTEGERS { longest.label.width last.extra.num }
1315 FUNCTION {initialize.longest.label}
1316 { "" 'longest.label :=
1317 #0 int.to.chr$ 'last.sort.label :=
1319 #0 'longest.label.width :=
1320 #0 'last.extra.num :=
1323 FUNCTION {forward.pass}
1324 { last.sort.label sort.label =
1325 { last.extra.num #1 + 'last.extra.num :=
1326 last.extra.num int.to.chr$ 'extra.label :=
1328 { "a" chr.to.int$ 'last.extra.num :=
1330 sort.label 'last.sort.label :=
1335 FUNCTION {reverse.pass}
1337 { "a" 'extra.label := }
1340 label extra.label * 'label :=
1341 label width$ longest.label.width >
1342 { label 'longest.label :=
1343 label width$ 'longest.label.width :=
1347 extra.label 'next.extra :=
1350 EXECUTE {initialize.longest.label}
1352 ITERATE {forward.pass}
1354 REVERSE {reverse.pass}
1356 % DFK removed code about et.al.char
1357 % DFK changed to texinfo
1358 FUNCTION {begin.bib}
1359 { "@c bib -> itexi intro" write$ newline$
1360 "@itemize" write$ newline$
1365 EXECUTE {init.state.consts}
1367 ITERATE {call.type$}
1369 % DFK changed to texinfo
1372 "@end itemize" write$ newline$
1373 "@c bib -> itexi end" write$ newline$