1 % ACM Transactions bibliography style (24-Jan-88 version)
2 % A lot like abbrv.bst, but names come out "Last, initials", and in \sc.
3 % Some dates are parenthesized.
6 % 2/ 6/86 (HWT) Original version, by Howard Trickey.
7 % 3/ 5/86 (HWT) Put in pp. everywhere but articles, as per ACM style.
8 % 1/24/88 (OP&HWT) Updated for BibTeX version 0.99a, Oren Patashnik;
9 % corrected the abbreviations to "Mar." and "Sept.";
10 % THIS `acm' VERSION DOES NOT WORK WITH BIBTEX 0.98i.
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}
93 before.all 'output.state :=
103 { output.state before.all =
105 { after.block 'output.state := }
109 FUNCTION {new.sentence}
110 { output.state after.block =
112 { output.state before.all =
114 { after.sentence 'output.state := }
138 FUNCTION {new.block.checka}
145 FUNCTION {new.block.checkb}
154 FUNCTION {field.or.null}
164 { "{\em " swap$ * "}" * }
168 FUNCTION {emphasizeic}
171 { "{\em " swap$ * "\/}" * }
178 { "{\sc " swap$ * "}" * }
182 INTEGERS { nameptr namesleft numnames }
184 FUNCTION {format.names}
187 s num.names$ 'numnames :=
188 numnames 'namesleft :=
190 { s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't :=
203 nameptr #1 + 'nameptr :=
204 namesleft #1 - 'namesleft :=
209 % For names inside entries (e.g., editors of an "In ...");
210 % this is exactly ABBRV.BST's `format.names' function.
211 FUNCTION {format.innames}
214 s num.names$ 'numnames :=
215 numnames 'namesleft :=
217 { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
234 nameptr #1 + 'nameptr :=
235 namesleft #1 - 'namesleft :=
240 FUNCTION {format.authors}
243 { author format.names scapify }
247 FUNCTION {format.editors}
250 { editor format.names scapify
251 editor num.names$ #1 >
259 FUNCTION {format.ineditors}
262 { editor format.innames
263 editor num.names$ #1 >
271 FUNCTION {format.title}
274 { title "t" change.case$ }
282 { t #1 #1 substring$ "-" =
283 { t #1 #2 substring$ "--" = not
285 t #2 global.max$ substring$ 't :=
287 { { t #1 #1 substring$ "-" = }
289 t #2 global.max$ substring$ 't :=
295 { t #1 #1 substring$ *
296 t #2 global.max$ substring$ 't :=
303 FUNCTION {format.date}
307 { "there's a month but no year in " cite$ * warning$
314 { month " " * year * }
320 FUNCTION {format.btitle}
324 FUNCTION {tie.or.space.connect}
325 { duplicate$ text.length$ #3 <
332 FUNCTION {either.or.check}
335 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
339 FUNCTION {format.bvolume}
345 { " of " * series emphasize * }
347 "volume and number" number either.or.check
352 FUNCTION {format.number.series}
355 { series field.or.null }
356 { output.state mid.sentence =
362 { "there's a number but no series in " cite$ * warning$ }
363 { " in " * series * }
372 FUNCTION {format.edition}
375 { output.state mid.sentence =
376 { edition "l" change.case$ "~ed." * }
377 { edition "t" change.case$ "~ed." * }
383 FUNCTION {format.pages}
390 INTEGERS { multiresult }
392 FUNCTION {multi.page.check}
401 swap$ duplicate$ "," =
404 { #1 'multiresult := }
405 { t #2 global.max$ substring$ 't := }
412 FUNCTION {format.pp.pages}
415 { pages multi.page.check
416 { "pp.~" pages n.dashify * }
423 FUNCTION {format.journal.vol.num.date}
425 { "empty journal in " cite$ * warning$
435 { emphasize ", " * number * }
438 { "empty year in " cite$ * warning$ }
439 { " (" * format.date * ")" * }
445 FUNCTION {format.chapter.pages}
450 { type "l" change.case$ chapter tie.or.space.connect }
454 { ", " * format.pp.pages * }
460 FUNCTION {format.in.ed.booktitle}
463 { "In " booktitle emphasize *
466 { ", " * format.ineditors * }
472 % The proceedings title (it's on the stack) gets an (address, date) appended
473 FUNCTION {format.proc.date}
477 { "empty year in " cite$ * warning$
481 " (" * address * ")" *
499 FUNCTION {format.in.proc.date}
502 { "In " booktitle format.proc.date * }
506 FUNCTION {empty.misc.check}
507 { author empty$ title empty$ howpublished empty$
508 month empty$ year empty$ note empty$
511 { "all relevant fields are empty in " cite$ * warning$ }
516 FUNCTION {format.thesis.type}
520 type "t" change.case$
525 FUNCTION {format.tr.number}
532 { number tie.or.space.connect }
536 FUNCTION {format.article.crossref}
539 { "need key or journal for " cite$ * " to crossref " * crossref *
543 { "In {\em " journal * "\/}" * }
548 " \cite{" * crossref * "}" *
551 FUNCTION {format.crossref.editor}
552 { editor #1 "{vv~}{ll}" format.name$
553 editor num.names$ duplicate$
558 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
560 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
568 FUNCTION {format.book.crossref}
570 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
578 editor field.or.null author field.or.null =
582 { "need editor, key, or series for " cite$ * " to crossref " *
586 { "{\em " * series * "\/}" * }
592 { format.crossref.editor * }
594 " \cite{" * crossref * "}" *
597 FUNCTION {format.incoll.inproc.crossref}
599 editor field.or.null author field.or.null =
603 { "need editor, key, or booktitle for " cite$ * " to crossref " *
607 { "In {\em " booktitle * "\/}" * }
613 { "In " format.crossref.editor * }
615 " \cite{" * crossref * "}" *
620 format.authors "author" output.check
622 format.title "title" output.check
625 { format.journal.vol.num.date output
628 { format.article.crossref output.nonnull
629 format.pp.pages output
640 { format.editors "author and editor" output.check }
641 { format.authors output.nonnull
643 { "author and editor" editor either.or.check }
649 format.btitle "title" output.check
650 format.edition output
652 { format.bvolume output
654 format.number.series output
656 publisher "publisher" output.check
660 format.book.crossref output.nonnull
663 format.date "year" output.check
671 format.authors output
673 format.title "title" output.check
674 howpublished address new.block.checkb
686 { format.editors "author and editor" output.check }
687 { format.authors output.nonnull
689 { "author and editor" editor either.or.check }
695 format.btitle "title" output.check
696 format.edition output
698 { format.bvolume output
700 format.number.series output
702 publisher "publisher" output.check
706 format.book.crossref output.nonnull
709 format.date "year" output.check
710 format.chapter.pages "chapter and pages" output.check
716 FUNCTION {incollection}
718 format.authors "author" output.check
720 format.title "title" output.check
723 { format.in.ed.booktitle "booktitle" output.check
724 format.edition output
725 format.bvolume output
726 format.number.series output
728 publisher "publisher" output.check
730 format.date "year" output.check
732 { format.incoll.inproc.crossref output.nonnull }
734 format.chapter.pages output
740 FUNCTION {inproceedings}
742 format.authors "author" output.check
744 format.title "title" output.check
747 { format.in.proc.date "booktitle" output.check
748 format.ineditors output
749 format.bvolume output
750 format.number.series output
754 { format.incoll.inproc.crossref output.nonnull }
756 format.pp.pages output
762 FUNCTION {conference} { inproceedings }
767 { organization scapify output }
768 { format.authors output.nonnull }
771 format.btitle "title" output.check
772 format.edition output
774 { address new.block.checka }
775 { organization address new.block.checkb
786 FUNCTION {mastersthesis}
788 format.authors "author" output.check
790 format.title "title" output.check
792 "Master's thesis" format.thesis.type output.nonnull
793 school "school" output.check
795 format.date "year" output.check
803 format.authors output
804 title howpublished new.block.checkb
806 howpublished new.block.checka
817 format.authors "author" output.check
819 format.btitle "title" output.check
821 "PhD thesis" format.thesis.type output.nonnull
822 school "school" output.check
824 format.date "year" output.check
830 FUNCTION {proceedings}
833 { organization scapify output }
834 { format.editors output.nonnull }
837 title format.proc.date "title" output.check
838 format.bvolume output
839 format.number.series output
842 { organization output }
850 FUNCTION {techreport}
852 format.authors "author" output.check
854 format.title "title" output.check
856 format.tr.number output.nonnull
857 institution "institution" output.check
859 format.date "year" output.check
865 FUNCTION {unpublished}
867 format.authors "author" output.check
869 format.title "title" output.check
871 note "note" output.check
876 FUNCTION {default.type} { misc }
894 MACRO {sep} {"Sept."}
902 MACRO {acmcs} {"ACM Comput. Surv."}
904 MACRO {acta} {"Acta Inf."}
906 MACRO {cacm} {"Commun. ACM"}
908 MACRO {ibmjrd} {"IBM J. Res. Dev."}
910 MACRO {ibmsj} {"IBM Syst.~J."}
912 MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
914 MACRO {ieeetc} {"IEEE Trans. Comput."}
917 {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
919 MACRO {ipl} {"Inf. Process. Lett."}
921 MACRO {jacm} {"J.~ACM"}
923 MACRO {jcss} {"J.~Comput. Syst. Sci."}
925 MACRO {scp} {"Sci. Comput. Programming"}
927 MACRO {sicomp} {"SIAM J. Comput."}
929 MACRO {tocs} {"ACM Trans. Comput. Syst."}
931 MACRO {tods} {"ACM Trans. Database Syst."}
933 MACRO {tog} {"ACM Trans. Gr."}
935 MACRO {toms} {"ACM Trans. Math. Softw."}
937 MACRO {toois} {"ACM Trans. Office Inf. Syst."}
939 MACRO {toplas} {"ACM Trans. Program. Lang. Syst."}
941 MACRO {tcs} {"Theoretical Comput. Sci."}
955 s #1 len substring$ =
956 { s len #1 + global.max$ substring$ }
961 FUNCTION {sort.format.names}
965 s num.names$ 'numnames :=
966 numnames 'namesleft :=
972 s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't :=
973 nameptr numnames = t "others" = and
977 nameptr #1 + 'nameptr :=
978 namesleft #1 - 'namesleft :=
983 FUNCTION {sort.format.title}
987 "The " #4 t chop.word
991 #1 global.max$ substring$
994 FUNCTION {author.sort}
997 { "to sort, need author or key in " cite$ * warning$
1003 { author sort.format.names }
1007 FUNCTION {author.editor.sort}
1011 { "to sort, need author, editor, or key in " cite$ * warning$
1017 { editor sort.format.names }
1020 { author sort.format.names }
1024 FUNCTION {author.organization.sort}
1026 { organization empty$
1028 { "to sort, need author, organization, or key in " cite$ * warning$
1034 { "The " #4 organization chop.word sortify }
1037 { author sort.format.names }
1041 FUNCTION {editor.organization.sort}
1043 { organization empty$
1045 { "to sort, need editor, organization, or key in " cite$ * warning$
1051 { "The " #4 organization chop.word sortify }
1054 { editor sort.format.names }
1063 { type$ "proceedings" =
1064 'editor.organization.sort
1066 'author.organization.sort
1075 year field.or.null sortify
1082 #1 entry.max$ substring$
1090 STRINGS { longest.label }
1092 INTEGERS { number.label longest.label.width }
1094 FUNCTION {initialize.longest.label}
1095 { "" 'longest.label :=
1097 #0 'longest.label.width :=
1100 FUNCTION {longest.label.pass}
1101 { number.label int.to.str$ 'label :=
1102 number.label #1 + 'number.label :=
1103 label width$ longest.label.width >
1104 { label 'longest.label :=
1105 label width$ 'longest.label.width :=
1111 EXECUTE {initialize.longest.label}
1113 ITERATE {longest.label.pass}
1115 FUNCTION {begin.bib}
1118 { preamble$ write$ newline$ }
1120 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
1125 EXECUTE {init.state.consts}
1127 ITERATE {call.type$}
1131 "\end{thebibliography}" write$ newline$