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 % PEH - the 2 same lines below are because I replaced with a space
358 FUNCTION {tie.or.space.connect}
359 { duplicate$ text.length$ #3 <
366 FUNCTION {either.or.check}
369 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
373 FUNCTION {format.bvolume}
376 { "volume" volume tie.or.space.connect
379 { " of " * series emphasize * }
381 "volume and number" number either.or.check
386 FUNCTION {format.number.series}
389 { series field.or.null }
390 { output.state mid.sentence =
394 number tie.or.space.connect
396 { "there's a number but no series in " cite$ * warning$ }
397 { " in " * series * }
406 FUNCTION {format.edition}
409 { output.state mid.sentence =
410 { edition "l" change.case$ " edition" * }
411 { edition "t" change.case$ " edition" * }
417 INTEGERS { multiresult }
419 FUNCTION {multi.page.check}
428 swap$ duplicate$ "," =
431 { #1 'multiresult := }
432 { t #2 global.max$ substring$ 't := }
439 FUNCTION {format.pages}
442 { pages multi.page.check
443 { "pages" pages n.dashify tie.or.space.connect }
444 { "page" pages tie.or.space.connect }
450 FUNCTION {format.vol.num.pages}
451 { volume field.or.null
454 { "(" number * ")" * *
456 { "there's a number but no volume in " cite$ * warning$ }
464 { pop$ format.pages }
465 { ":" * pages n.dashify * }
471 FUNCTION {format.chapter.pages}
476 { type "l" change.case$ }
478 chapter tie.or.space.connect
481 { ", " * format.pages * }
487 FUNCTION {format.in.ed.booktitle}
491 { "In " booktitle emphasize * }
492 { "In " format.editors * ", " * booktitle emphasize * }
498 FUNCTION {empty.misc.check}
499 { author empty$ title empty$ howpublished empty$
500 month empty$ year empty$ note empty$
503 { "all relevant fields are empty in " cite$ * warning$ }
508 FUNCTION {format.thesis.type}
512 type "t" change.case$
517 FUNCTION {format.tr.number}
519 { "Technical Report" }
524 { number tie.or.space.connect }
528 FUNCTION {format.article.crossref}
531 { "need key or journal for " cite$ * " to crossref " * crossref *
535 { "In {\em " journal * "\/}" * }
540 " \cite{" * crossref * "}" *
543 FUNCTION {format.crossref.editor}
544 { editor #1 "{vv~}{ll}" format.name$
545 editor num.names$ duplicate$
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 * "}" *
589 FUNCTION {format.incoll.inproc.crossref}
591 editor field.or.null author field.or.null =
595 { "need editor, key, or booktitle for " cite$ * " to crossref " *
599 { "In {\em " booktitle * "\/}" * }
605 { "In " format.crossref.editor * }
607 " \cite{" * crossref * "}" *
612 % top of stack is the string we want to be a quoted paragraph
613 FUNCTION {format.quotedParagraph}
616 { "<P><QUOTE> " swap$ * " </QUOTE></P>" *}
621 % DFK added, to support comment, private, keyword, etc
622 % next-to-top is field name (eg, "Comment")
623 % top is field value (eg, value of comment)
624 % both are popped; resulting top is either empty,
625 % or string describing field
626 FUNCTION {format.dfkfield}
630 "<strong> " swap$ * ":</strong> " * swap$ * }
637 "Abstract" abstract format.dfkfield format.quotedParagraph write$ newline$
638 "Keyword" keyword format.dfkfield format.quotedParagraph write$ newline$
639 "Comment" comment format.dfkfield format.quotedParagraph write$ newline$
642 % DFK: added a call to dfk.stuff in all entry-type functions below
646 format.authors "author" output.check
648 format.title "title" output.check
651 { journal emphasize "journal" output.check
652 format.vol.num.pages output
653 format.date "year" output.check
655 { format.article.crossref output.nonnull
668 { format.editors "author and editor" output.check }
669 { format.authors output.nonnull
671 { "author and editor" editor either.or.check }
677 format.btitle "title" output.check
679 { format.bvolume output
681 format.number.series output
683 publisher "publisher" output.check
687 format.book.crossref output.nonnull
690 format.edition output
691 format.date "year" output.check
700 format.authors output
702 format.title "title" output.check
703 howpublished address new.block.checkb
716 { format.editors "author and editor" output.check }
717 { format.authors output.nonnull
719 { "author and editor" editor either.or.check }
725 format.btitle "title" output.check
727 { format.bvolume output
728 format.chapter.pages "chapter and pages" output.check
730 format.number.series output
732 publisher "publisher" output.check
735 { format.chapter.pages "chapter and pages" output.check
737 format.book.crossref output.nonnull
740 format.edition output
741 format.date "year" output.check
748 FUNCTION {incollection}
750 format.authors "author" output.check
752 format.title "title" output.check
755 { format.in.ed.booktitle "booktitle" output.check
756 format.bvolume output
757 format.number.series output
758 format.chapter.pages output
760 publisher "publisher" output.check
762 format.edition output
763 format.date "year" output.check
765 { format.incoll.inproc.crossref output.nonnull
766 format.chapter.pages output
775 FUNCTION {inproceedings}
777 format.authors "author" output.check
779 format.title "title" output.check
782 { format.in.ed.booktitle "booktitle" output.check
783 format.bvolume output
784 format.number.series output
787 { organization publisher new.sentence.checkb
790 format.date "year" output.check
792 { address output.nonnull
793 format.date "year" output.check
800 { format.incoll.inproc.crossref output.nonnull
810 FUNCTION {conference} { inproceedings }
815 { organization empty$
817 { organization output.nonnull
822 { format.authors output.nonnull }
825 format.btitle "title" output.check
827 { organization empty$
828 { address new.block.checka
834 { organization address new.block.checkb
839 format.edition output
847 FUNCTION {mastersthesis}
849 format.authors "author" output.check
851 format.title "title" output.check
853 "Master's thesis" format.thesis.type output.nonnull
854 school "school" output.check
856 format.date "year" output.check
865 format.authors output
866 title howpublished new.block.checkb
868 howpublished new.block.checka
880 format.authors "author" output.check
882 format.btitle "title" output.check
884 "PhD thesis" format.thesis.type output.nonnull
885 school "school" output.check
887 format.date "year" output.check
894 FUNCTION {proceedings}
897 { organization output }
898 { format.editors output.nonnull }
901 format.btitle "title" output.check
902 format.bvolume output
903 format.number.series output
906 { publisher new.sentence.checka }
907 { organization publisher new.sentence.checkb
912 format.date "year" output.check
914 { address output.nonnull
915 format.date "year" output.check
919 { organization output }
930 FUNCTION {techreport}
932 format.authors "author" output.check
934 format.title "title" output.check
936 format.tr.number output.nonnull
937 institution "institution" output.check
939 format.date "year" output.check
946 FUNCTION {unpublished}
948 format.authors "author" output.check
950 format.title "title" output.check
952 note "note" output.check
958 FUNCTION {default.type} { misc }
960 MACRO {jan} {"January"}
962 MACRO {feb} {"February"}
964 MACRO {mar} {"March"}
966 MACRO {apr} {"April"}
974 MACRO {aug} {"August"}
976 MACRO {sep} {"September"}
978 MACRO {oct} {"October"}
980 MACRO {nov} {"November"}
982 MACRO {dec} {"December"}
984 MACRO {acmcs} {"ACM Computing Surveys"}
986 MACRO {acta} {"Acta Informatica"}
988 MACRO {cacm} {"Communications of the ACM"}
990 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
992 MACRO {ibmsj} {"IBM Systems Journal"}
994 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
996 MACRO {ieeetc} {"IEEE Transactions on Computers"}
999 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1001 MACRO {ipl} {"Information Processing Letters"}
1003 MACRO {jacm} {"Journal of the ACM"}
1005 MACRO {jcss} {"Journal of Computer and System Sciences"}
1007 MACRO {scp} {"Science of Computer Programming"}
1009 MACRO {sicomp} {"SIAM Journal on Computing"}
1011 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1013 MACRO {tods} {"ACM Transactions on Database Systems"}
1015 MACRO {tog} {"ACM Transactions on Graphics"}
1017 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1019 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1021 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1023 MACRO {tcs} {"Theoretical Computer Science"}
1034 FUNCTION {chop.word}
1037 s #1 len substring$ =
1038 { s len #1 + global.max$ substring$ }
1043 INTEGERS { et.al.char.used }
1045 FUNCTION {initialize.et.al.char.used}
1046 { #0 'et.al.char.used :=
1049 EXECUTE {initialize.et.al.char.used}
1051 FUNCTION {format.lab.names}
1053 s num.names$ 'numnames :=
1056 { #3 'namesleft := }
1057 { numnames 'namesleft := }
1062 { nameptr numnames =
1063 { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1064 { "{\etalchar{+}}" *
1065 #1 'et.al.char.used :=
1067 { s nameptr "{v{}}{l{}}" format.name$ * }
1070 { s nameptr "{v{}}{l{}}" format.name$ * }
1072 nameptr #1 + 'nameptr :=
1073 namesleft #1 - 'namesleft :=
1077 { "{\etalchar{+}}" *
1078 #1 'et.al.char.used :=
1083 { s #1 "{v{}}{l{}}" format.name$
1084 duplicate$ text.length$ #2 <
1085 { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
1092 FUNCTION {author.key.label}
1095 { cite$ #1 #3 substring$ }
1096 { key #3 text.prefix$ }
1099 { author format.lab.names }
1103 FUNCTION {author.editor.key.label}
1107 { cite$ #1 #3 substring$ }
1108 { key #3 text.prefix$ }
1111 { editor format.lab.names }
1114 { author format.lab.names }
1118 FUNCTION {author.key.organization.label}
1121 { organization empty$
1122 { cite$ #1 #3 substring$ }
1123 { "The " #4 organization chop.word #3 text.prefix$ }
1126 { key #3 text.prefix$ }
1129 { author format.lab.names }
1133 FUNCTION {editor.key.organization.label}
1136 { organization empty$
1137 { cite$ #1 #3 substring$ }
1138 { "The " #4 organization chop.word #3 text.prefix$ }
1141 { key #3 text.prefix$ }
1144 { editor format.lab.names }
1148 FUNCTION {calc.label}
1152 'author.editor.key.label
1153 { type$ "proceedings" =
1154 'editor.key.organization.label
1156 'author.key.organization.label
1164 year field.or.null purify$ #-1 #2 substring$
1167 year field.or.null purify$ #-1 #4 substring$
1169 sortify 'sort.label :=
1172 FUNCTION {sort.format.names}
1176 s num.names$ 'numnames :=
1177 numnames 'namesleft :=
1183 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1184 nameptr numnames = t "others" = and
1188 nameptr #1 + 'nameptr :=
1189 namesleft #1 - 'namesleft :=
1194 FUNCTION {sort.format.title}
1198 "The " #4 t chop.word
1202 #1 global.max$ substring$
1205 FUNCTION {author.sort}
1208 { "to sort, need author or key in " cite$ * warning$
1214 { author sort.format.names }
1218 FUNCTION {author.editor.sort}
1222 { "to sort, need author, editor, or key in " cite$ * warning$
1228 { editor sort.format.names }
1231 { author sort.format.names }
1235 FUNCTION {author.organization.sort}
1237 { organization empty$
1239 { "to sort, need author, organization, or key in " cite$ * warning$
1245 { "The " #4 organization chop.word sortify }
1248 { author sort.format.names }
1252 FUNCTION {editor.organization.sort}
1254 { organization empty$
1256 { "to sort, need editor, organization, or key in " cite$ * warning$
1262 { "The " #4 organization chop.word sortify }
1265 { editor sort.format.names }
1278 { type$ "proceedings" =
1279 'editor.organization.sort
1281 'author.organization.sort
1291 year field.or.null sortify
1298 % DFK throw away stuff above and use cite$ for sort key
1301 #1 entry.max$ substring$
1309 STRINGS { longest.label last.sort.label next.extra }
1311 INTEGERS { longest.label.width last.extra.num }
1313 FUNCTION {initialize.longest.label}
1314 { "" 'longest.label :=
1315 #0 int.to.chr$ 'last.sort.label :=
1317 #0 'longest.label.width :=
1318 #0 'last.extra.num :=
1321 FUNCTION {forward.pass}
1322 { last.sort.label sort.label =
1323 { last.extra.num #1 + 'last.extra.num :=
1324 last.extra.num int.to.chr$ 'extra.label :=
1326 { "a" chr.to.int$ 'last.extra.num :=
1328 sort.label 'last.sort.label :=
1333 FUNCTION {reverse.pass}
1335 { "a" 'extra.label := }
1338 label extra.label * 'label :=
1339 label width$ longest.label.width >
1340 { label 'longest.label :=
1341 label width$ 'longest.label.width :=
1345 extra.label 'next.extra :=
1348 EXECUTE {initialize.longest.label}
1350 ITERATE {forward.pass}
1352 REVERSE {reverse.pass}
1354 % DFK removed code about et.al.char
1355 % DFK changed to texinfo
1356 FUNCTION {begin.bib}
1357 { "@c bib -> itexi intro" write$ newline$
1358 "@itemize" write$ newline$
1363 EXECUTE {init.state.consts}
1365 ITERATE {call.type$}
1367 % DFK changed to texinfo
1370 "@end itemize" write$ newline$
1371 "@c bib -> itexi end" write$ newline$