1 % BibTeX standard bibliography style `alpha'
2 % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
3 % Copyright (C) 1985, all rights reserved.
4 % Copying of this file is authorized only if either
5 % (1) you make absolutely no changes to your copy, including name, or
6 % (2) if you do make changes, you name it something other than
7 % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
8 % This restriction helps ensure that all standard styles are identical.
9 % The file btxbst.doc has the documentation for this style.
37 { label extra.label sort.label }
39 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
41 FUNCTION {init.state.consts}
50 FUNCTION {output.nonnull}
52 output.state mid.sentence =
54 { output.state after.block =
59 { output.state before.all =
61 { add.period$ " " * write$ }
65 mid.sentence 'output.state :=
78 FUNCTION {output.check}
81 { pop$ "empty " t * " in " * cite$ * warning$ }
86 FUNCTION {output.bibitem}
95 before.all 'output.state :=
105 { output.state before.all =
107 { after.block 'output.state := }
111 FUNCTION {new.sentence}
112 { output.state after.block =
114 { output.state before.all =
116 { after.sentence 'output.state := }
140 FUNCTION {new.block.checka}
147 FUNCTION {new.block.checkb}
156 FUNCTION {new.sentence.checka}
163 FUNCTION {new.sentence.checkb}
172 FUNCTION {field.or.null}
182 { "{\em " swap$ * "}" * }
186 INTEGERS { nameptr namesleft numnames }
188 FUNCTION {format.names}
191 s num.names$ 'numnames :=
192 numnames 'namesleft :=
194 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
211 nameptr #1 + 'nameptr :=
212 namesleft #1 - 'namesleft :=
217 FUNCTION {format.authors}
220 { author format.names }
224 FUNCTION {format.editors}
227 { editor format.names
228 editor num.names$ #1 >
236 FUNCTION {format.title}
239 { title "t" change.case$ }
247 { t #1 #1 substring$ "-" =
248 { t #1 #2 substring$ "--" = not
250 t #2 global.max$ substring$ 't :=
252 { { t #1 #1 substring$ "-" = }
254 t #2 global.max$ substring$ 't :=
260 { t #1 #1 substring$ *
261 t #2 global.max$ substring$ 't :=
268 FUNCTION {format.date}
272 { "there's a month but no year in " cite$ * warning$
279 { month " " * year * }
285 FUNCTION {format.btitle}
289 FUNCTION {tie.or.space.connect}
290 { duplicate$ text.length$ #3 <
297 FUNCTION {either.or.check}
300 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
304 FUNCTION {format.bvolume}
307 { "volume" volume tie.or.space.connect
310 { " of " * series emphasize * }
312 "volume and number" number either.or.check
317 FUNCTION {format.number.series}
320 { series field.or.null }
321 { output.state mid.sentence =
325 number tie.or.space.connect
327 { "there's a number but no series in " cite$ * warning$ }
328 { " in " * series * }
337 FUNCTION {format.edition}
340 { output.state mid.sentence =
341 { edition "l" change.case$ " edition" * }
342 { edition "t" change.case$ " edition" * }
348 INTEGERS { multiresult }
350 FUNCTION {multi.page.check}
359 swap$ duplicate$ "," =
362 { #1 'multiresult := }
363 { t #2 global.max$ substring$ 't := }
370 FUNCTION {format.pages}
373 { pages multi.page.check
374 { "pages" pages n.dashify tie.or.space.connect }
375 { "page" pages tie.or.space.connect }
381 FUNCTION {format.vol.num.pages}
382 { volume field.or.null
385 { "(" number * ")" * *
387 { "there's a number but no volume in " cite$ * warning$ }
395 { pop$ format.pages }
396 { ": " * pages n.dashify * }
402 FUNCTION {format.chapter.pages}
407 { type "l" change.case$ }
409 chapter tie.or.space.connect
412 { ", " * format.pages * }
418 FUNCTION {format.in.ed.booktitle}
422 { "In " booktitle emphasize * }
423 { "In " format.editors * ", " * booktitle emphasize * }
429 FUNCTION {empty.misc.check}
430 { author empty$ title empty$ howpublished empty$
431 month empty$ year empty$ note empty$
434 { "all relevant fields are empty in " cite$ * warning$ }
439 FUNCTION {format.thesis.type}
443 type "t" change.case$
448 FUNCTION {format.tr.number}
450 { "Technical Report" }
455 { number tie.or.space.connect }
459 FUNCTION {format.article.crossref}
462 { "need key or journal for " cite$ * " to crossref " * crossref *
466 { "In {\em " journal * "\/}" * }
471 " \cite{" * crossref * "}" *
474 FUNCTION {format.crossref.editor}
475 { editor #1 "{vv~}{ll}" format.name$
476 editor num.names$ duplicate$
481 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
483 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
491 FUNCTION {format.book.crossref}
493 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
496 { "Volume" volume tie.or.space.connect
501 editor field.or.null author field.or.null =
505 { "need editor, key, or series for " cite$ * " to crossref " *
509 { "{\em " * series * "\/}" * }
515 { format.crossref.editor * }
517 " \cite{" * crossref * "}" *
520 FUNCTION {format.incoll.inproc.crossref}
522 editor field.or.null author field.or.null =
526 { "need editor, key, or booktitle for " cite$ * " to crossref " *
530 { "In {\em " booktitle * "\/}" * }
536 { "In " format.crossref.editor * }
538 " \cite{" * crossref * "}" *
543 format.authors "author" output.check
545 format.title "title" output.check
548 { journal emphasize "journal" output.check
549 format.vol.num.pages output
550 format.date "year" output.check
552 { format.article.crossref output.nonnull
565 { format.editors "author and editor" output.check }
566 { format.authors output.nonnull
568 { "author and editor" editor either.or.check }
574 format.btitle "title" output.check
576 { format.bvolume output
578 format.number.series output
580 publisher "publisher" output.check
584 format.book.crossref output.nonnull
587 format.edition output
588 format.date "year" output.check
596 format.authors output
598 format.title "title" output.check
599 howpublished address new.block.checkb
611 { format.editors "author and editor" output.check }
612 { format.authors output.nonnull
614 { "author and editor" editor either.or.check }
620 format.btitle "title" output.check
622 { format.bvolume output
623 format.chapter.pages "chapter and pages" output.check
625 format.number.series output
627 publisher "publisher" output.check
630 { format.chapter.pages "chapter and pages" output.check
632 format.book.crossref output.nonnull
635 format.edition output
636 format.date "year" output.check
642 FUNCTION {incollection}
644 format.authors "author" output.check
646 format.title "title" output.check
649 { format.in.ed.booktitle "booktitle" output.check
650 format.bvolume output
651 format.number.series output
652 format.chapter.pages output
654 publisher "publisher" output.check
656 format.edition output
657 format.date "year" output.check
659 { format.incoll.inproc.crossref output.nonnull
660 format.chapter.pages output
668 FUNCTION {inproceedings}
670 format.authors "author" output.check
672 format.title "title" output.check
675 { format.in.ed.booktitle "booktitle" output.check
676 format.bvolume output
677 format.number.series output
680 { organization publisher new.sentence.checkb
683 format.date "year" output.check
685 { address output.nonnull
686 format.date "year" output.check
693 { format.incoll.inproc.crossref output.nonnull
703 FUNCTION {conference} { inproceedings }
708 { organization empty$
710 { organization output.nonnull
715 { format.authors output.nonnull }
718 format.btitle "title" output.check
720 { organization empty$
721 { address new.block.checka
727 { organization address new.block.checkb
732 format.edition output
739 FUNCTION {mastersthesis}
741 format.authors "author" output.check
743 format.title "title" output.check
745 "Master's thesis" format.thesis.type output.nonnull
746 school "school" output.check
748 format.date "year" output.check
756 format.authors output
757 title howpublished new.block.checkb
759 howpublished new.block.checka
770 format.title "title" output.check
780 format.authors "author" output.check
782 format.btitle "title" output.check
784 "PhD thesis" format.thesis.type output.nonnull
785 school "school" output.check
787 format.date "year" output.check
793 FUNCTION {proceedings}
796 { organization output }
797 { format.editors output.nonnull }
800 format.btitle "title" output.check
801 format.bvolume output
802 format.number.series output
805 { publisher new.sentence.checka }
806 { organization publisher new.sentence.checkb
811 format.date "year" output.check
813 { address output.nonnull
814 format.date "year" output.check
818 { organization output }
828 FUNCTION {techreport}
830 format.authors "author" output.check
832 format.title "title" output.check
834 format.tr.number output.nonnull
835 institution "institution" output.check
837 format.date "year" output.check
843 FUNCTION {unpublished}
845 format.authors "author" output.check
847 format.title "title" output.check
849 note "note" output.check
854 FUNCTION {default.type} { misc }
856 MACRO {jan} {"January"}
858 MACRO {feb} {"February"}
860 MACRO {mar} {"March"}
862 MACRO {apr} {"April"}
870 MACRO {aug} {"August"}
872 MACRO {sep} {"September"}
874 MACRO {oct} {"October"}
876 MACRO {nov} {"November"}
878 MACRO {dec} {"December"}
880 MACRO {acmcs} {"ACM Computing Surveys"}
882 MACRO {acta} {"Acta Informatica"}
884 MACRO {cacm} {"Communications of the ACM"}
886 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
888 MACRO {ibmsj} {"IBM Systems Journal"}
890 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
892 MACRO {ieeetc} {"IEEE Transactions on Computers"}
895 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
897 MACRO {ipl} {"Information Processing Letters"}
899 MACRO {jacm} {"Journal of the ACM"}
901 MACRO {jcss} {"Journal of Computer and System Sciences"}
903 MACRO {scp} {"Science of Computer Programming"}
905 MACRO {sicomp} {"SIAM Journal on Computing"}
907 MACRO {tocs} {"ACM Transactions on Computer Systems"}
909 MACRO {tods} {"ACM Transactions on Database Systems"}
911 MACRO {tog} {"ACM Transactions on Graphics"}
913 MACRO {toms} {"ACM Transactions on Mathematical Software"}
915 MACRO {toois} {"ACM Transactions on Office Information Systems"}
917 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
919 MACRO {tcs} {"Theoretical Computer Science"}
933 s #1 len substring$ =
934 { s len #1 + global.max$ substring$ }
939 INTEGERS { et.al.char.used }
941 FUNCTION {initialize.et.al.char.used}
942 { #0 'et.al.char.used :=
945 EXECUTE {initialize.et.al.char.used}
947 FUNCTION {format.lab.names}
949 s num.names$ 'numnames :=
953 { numnames 'namesleft := }
959 { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
961 #1 'et.al.char.used :=
963 { s nameptr "{v{}}{l{}}" format.name$ * }
966 { s nameptr "{v{}}{l{}}" format.name$ * }
968 nameptr #1 + 'nameptr :=
969 namesleft #1 - 'namesleft :=
974 #1 'et.al.char.used :=
979 { s #1 "{v{}}{l{}}" format.name$
980 duplicate$ text.length$ #2 <
981 { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
988 FUNCTION {author.key.label}
991 { cite$ #1 #3 substring$ }
992 { key #3 text.prefix$ }
995 { author format.lab.names }
999 FUNCTION {author.editor.key.label}
1003 { cite$ #1 #3 substring$ }
1004 { key #3 text.prefix$ }
1007 { editor format.lab.names }
1010 { author format.lab.names }
1014 FUNCTION {author.key.organization.label}
1017 { organization empty$
1018 { cite$ #1 #3 substring$ }
1019 { "The " #4 organization chop.word #3 text.prefix$ }
1022 { key #3 text.prefix$ }
1025 { author format.lab.names }
1029 FUNCTION {editor.key.organization.label}
1032 { organization empty$
1033 { cite$ #1 #3 substring$ }
1034 { "The " #4 organization chop.word #3 text.prefix$ }
1037 { key #3 text.prefix$ }
1040 { editor format.lab.names }
1044 FUNCTION {calc.label}
1048 'author.editor.key.label
1049 { type$ "proceedings" =
1050 'editor.key.organization.label
1052 'author.key.organization.label
1060 year field.or.null purify$ #-1 #2 substring$
1063 year field.or.null purify$ #-1 #4 substring$
1065 sortify 'sort.label :=
1068 FUNCTION {sort.format.names}
1072 s num.names$ 'numnames :=
1073 numnames 'namesleft :=
1079 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1080 nameptr numnames = t "others" = and
1084 nameptr #1 + 'nameptr :=
1085 namesleft #1 - 'namesleft :=
1090 FUNCTION {sort.format.title}
1094 "The " #4 t chop.word
1098 #1 global.max$ substring$
1101 FUNCTION {author.sort}
1104 { "to sort, need author or key in " cite$ * warning$
1110 { author sort.format.names }
1114 FUNCTION {author.editor.sort}
1118 { "to sort, need author, editor, or key in " cite$ * warning$
1124 { editor sort.format.names }
1127 { author sort.format.names }
1131 FUNCTION {author.organization.sort}
1133 { organization empty$
1135 { "to sort, need author, organization, or key in " cite$ * warning$
1141 { "The " #4 organization chop.word sortify }
1144 { author sort.format.names }
1148 FUNCTION {editor.organization.sort}
1150 { organization empty$
1152 { "to sort, need editor, organization, or key in " cite$ * warning$
1158 { "The " #4 organization chop.word sortify }
1161 { editor sort.format.names }
1174 { type$ "proceedings" =
1175 'editor.organization.sort
1177 'author.organization.sort
1187 year field.or.null sortify
1194 #1 entry.max$ substring$
1202 STRINGS { longest.label last.sort.label next.extra }
1204 INTEGERS { longest.label.width last.extra.num }
1206 FUNCTION {initialize.longest.label}
1207 { "" 'longest.label :=
1208 #0 int.to.chr$ 'last.sort.label :=
1210 #0 'longest.label.width :=
1211 #0 'last.extra.num :=
1214 FUNCTION {forward.pass}
1215 { last.sort.label sort.label =
1216 { last.extra.num #1 + 'last.extra.num :=
1217 last.extra.num int.to.chr$ 'extra.label :=
1219 { "a" chr.to.int$ 'last.extra.num :=
1221 sort.label 'last.sort.label :=
1226 FUNCTION {reverse.pass}
1228 { "a" 'extra.label := }
1231 label extra.label * 'label :=
1232 label width$ longest.label.width >
1233 { label 'longest.label :=
1234 label width$ 'longest.label.width :=
1238 extra.label 'next.extra :=
1241 EXECUTE {initialize.longest.label}
1243 ITERATE {forward.pass}
1245 REVERSE {reverse.pass}
1247 FUNCTION {begin.bib}
1249 { "\providecommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
1254 { preamble$ write$ newline$ }
1256 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
1261 EXECUTE {init.state.consts}
1263 ITERATE {call.type$}
1267 "\end{thebibliography}" write$ newline$