1 % BibTeX standard bibliography style `plain'
\r
2 % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
\r
3 % Copyright (C) 1985, all rights reserved.
\r
4 % Copying of this file is authorized only if either
\r
5 % (1) you make absolutely no changes to your copy, including name, or
\r
6 % (2) if you do make changes, you name it something other than
\r
7 % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
\r
8 % This restriction helps ensure that all standard styles are identical.
\r
9 % The file btxbst.doc has the documentation for this style.
\r
38 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
\r
40 FUNCTION {init.state.consts}
\r
43 #2 'after.sentence :=
\r
49 FUNCTION {output.nonnull}
\r
51 output.state mid.sentence =
\r
53 { output.state after.block =
\r
54 { add.period$ write$
\r
58 { output.state before.all =
\r
60 { add.period$ " " * write$ }
\r
64 mid.sentence 'output.state :=
\r
77 FUNCTION {output.check}
\r
80 { pop$ "empty " t * " in " * cite$ * warning$ }
\r
85 FUNCTION {output.bibitem}
\r
92 before.all 'output.state :=
\r
95 FUNCTION {fin.entry}
\r
101 FUNCTION {new.block}
\r
102 { output.state before.all =
\r
104 { after.block 'output.state := }
\r
108 FUNCTION {new.sentence}
\r
109 { output.state after.block =
\r
111 { output.state before.all =
\r
113 { after.sentence 'output.state := }
\r
137 FUNCTION {new.block.checka}
\r
144 FUNCTION {new.block.checkb}
\r
153 FUNCTION {new.sentence.checka}
\r
160 FUNCTION {new.sentence.checkb}
\r
169 FUNCTION {field.or.null}
\r
170 { duplicate$ empty$
\r
176 FUNCTION {emphasize}
\r
177 { duplicate$ empty$
\r
179 { "{\em " swap$ * "}" * }
\r
183 FUNCTION {parenthesize}
\r
184 { duplicate$ empty$
\r
186 { "(" swap$ * ")" * }
\r
191 INTEGERS { nameptr namesleft numnames }
\r
193 FUNCTION {format.names}
\r
196 s num.names$ 'numnames :=
\r
197 numnames 'namesleft :=
\r
199 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
\r
208 { " {\it et~al.}" * }
\r
216 nameptr #1 + 'nameptr :=
\r
217 namesleft #1 - 'namesleft :=
\r
222 FUNCTION {format.authors}
\r
225 { author format.names }
\r
229 FUNCTION {format.editors}
\r
232 { editor format.names
\r
233 editor num.names$ #1 >
\r
241 FUNCTION {format.title}
\r
244 { title "t" change.case$ }
\r
248 FUNCTION {n.dashify}
\r
252 { t #1 #1 substring$ "-" =
\r
253 { t #1 #2 substring$ "--" = not
\r
255 t #2 global.max$ substring$ 't :=
\r
257 { { t #1 #1 substring$ "-" = }
\r
259 t #2 global.max$ substring$ 't :=
\r
265 { t #1 #1 substring$ *
\r
266 t #2 global.max$ substring$ 't :=
\r
274 FUNCTION {format.datea}
\r
278 { "there's a month but no year in " cite$ * warning$
\r
285 { month " " * year * }
\r
292 FUNCTION {format.date}
\r
293 { format.datea parenthesize
\r
296 FUNCTION {format.btitle}
\r
300 FUNCTION {tie.or.space.connect}
\r
301 { duplicate$ text.length$ #3 <
\r
308 FUNCTION {either.or.check}
\r
311 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
\r
315 FUNCTION {format.bvolume}
\r
318 { "volume" volume tie.or.space.connect
\r
321 { " of " * series emphasize * }
\r
323 "volume and number" number either.or.check
\r
328 FUNCTION {format.number.series}
\r
331 { series field.or.null }
\r
332 { output.state mid.sentence =
\r
336 number tie.or.space.connect
\r
338 { "there's a number but no series in " cite$ * warning$ }
\r
339 { " in " * series * }
\r
348 FUNCTION {format.edition}
\r
351 { output.state mid.sentence =
\r
352 { edition "l" change.case$ " edition" * }
\r
353 { edition "t" change.case$ " edition" * }
\r
359 INTEGERS { multiresult }
\r
361 FUNCTION {multi.page.check}
\r
368 { t #1 #1 substring$
\r
370 swap$ duplicate$ "," =
\r
373 { #1 'multiresult := }
\r
374 { t #2 global.max$ substring$ 't := }
\r
381 FUNCTION {format.pages}
\r
384 { pages multi.page.check
\r
385 { "pages" pages n.dashify tie.or.space.connect }
\r
386 { "page" pages tie.or.space.connect }
\r
392 FUNCTION {format.vol.num.pages}
\r
393 { volume field.or.null
\r
396 { "(" number * ")" * *
\r
398 { "there's a number but no volume in " cite$ * warning$ }
\r
405 { duplicate$ empty$
\r
406 { pop$ format.pages }
\r
407 { ":" * pages n.dashify * }
\r
413 FUNCTION {format.chapter.pages}
\r
418 { type "l" change.case$ }
\r
420 chapter tie.or.space.connect
\r
423 { ", " * format.pages * }
\r
429 FUNCTION {format.in.ed.booktitle}
\r
433 { "In " booktitle emphasize * }
\r
434 { "In " format.editors * ", " * booktitle emphasize * }
\r
440 FUNCTION {empty.misc.check}
\r
441 { author empty$ title empty$ howpublished empty$
\r
442 month empty$ year empty$ note empty$
\r
443 and and and and and
\r
445 { "all relevant fields are empty in " cite$ * warning$ }
\r
450 FUNCTION {format.thesis.type}
\r
454 type "t" change.case$
\r
459 FUNCTION {format.tr.number}
\r
461 { "Technical Report" }
\r
465 { "t" change.case$ }
\r
466 { number tie.or.space.connect }
\r
470 FUNCTION {format.article.crossref}
\r
473 { "need key or journal for " cite$ * " to crossref " * crossref *
\r
477 { "In {\em " journal * "\/}" * }
\r
482 " \cite{" * crossref * "}" *
\r
485 FUNCTION {format.crossref.editor}
\r
486 { editor #1 "{vv~}{ll}" format.name$
\r
487 editor num.names$ duplicate$
\r
489 { pop$ " {\it et~al.}" * }
\r
492 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
\r
493 { " {\it et~al.}" * }
\r
494 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
\r
502 FUNCTION {format.book.crossref}
\r
504 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
\r
507 { "Volume" volume tie.or.space.connect
\r
512 editor field.or.null author field.or.null =
\r
516 { "need editor, key, or series for " cite$ * " to crossref " *
\r
517 crossref * warning$
\r
520 { "{\em " * series * "\/}" * }
\r
526 { format.crossref.editor * }
\r
528 " \cite{" * crossref * "}" *
\r
531 FUNCTION {format.incoll.inproc.crossref}
\r
533 editor field.or.null author field.or.null =
\r
537 { "need editor, key, or booktitle for " cite$ * " to crossref " *
\r
538 crossref * warning$
\r
541 { "In {\em " booktitle * "\/}" * }
\r
547 { "In " format.crossref.editor * }
\r
549 " \cite{" * crossref * "}" *
\r
554 format.authors "author" output.check
\r
556 format.date "year" output.check
\r
558 format.title "title" output.check
\r
561 { journal emphasize "journal" output.check
\r
562 format.vol.num.pages output
\r
564 { format.article.crossref output.nonnull
\r
565 format.pages output
\r
576 { format.editors "author and editor" output.check }
\r
577 { format.authors output.nonnull
\r
579 { "author and editor" editor either.or.check }
\r
585 format.date "year" output.check
\r
587 format.btitle "title" output.check
\r
589 { format.bvolume output
\r
591 format.number.series output
\r
593 publisher "publisher" output.check
\r
597 format.book.crossref output.nonnull
\r
600 format.edition output
\r
608 format.authors output
\r
612 format.title "title" output.check
\r
613 howpublished address new.block.checkb
\r
614 howpublished output
\r
624 { format.editors "author and editor" output.check }
\r
625 { format.authors output.nonnull
\r
627 { "author and editor" editor either.or.check }
\r
633 format.date "year" output.check
\r
635 format.btitle "title" output.check
\r
637 { format.bvolume output
\r
638 format.chapter.pages "chapter and pages" output.check
\r
640 format.number.series output
\r
642 publisher "publisher" output.check
\r
645 { format.chapter.pages "chapter and pages" output.check
\r
647 format.book.crossref output.nonnull
\r
650 format.edition output
\r
656 FUNCTION {incollection}
\r
658 format.authors "author" output.check
\r
660 format.date "year" output.check
\r
662 format.title "title" output.check
\r
665 { format.in.ed.booktitle "booktitle" output.check
\r
666 format.bvolume output
\r
667 format.number.series output
\r
668 format.chapter.pages output
\r
670 publisher "publisher" output.check
\r
672 format.edition output
\r
674 { format.incoll.inproc.crossref output.nonnull
\r
675 format.chapter.pages output
\r
683 FUNCTION {inproceedings}
\r
685 format.authors "author" output.check
\r
687 format.date "year" output.check
\r
689 format.title "title" output.check
\r
692 { format.in.ed.booktitle "booktitle" output.check
\r
693 format.bvolume output
\r
694 format.number.series output
\r
695 format.pages output
\r
697 { organization publisher new.sentence.checkb
\r
698 organization output
\r
701 { address output.nonnull
\r
703 organization output
\r
708 { format.incoll.inproc.crossref output.nonnull
\r
709 format.pages output
\r
717 FUNCTION {conference} { inproceedings }
\r
722 { organization empty$
\r
724 { organization output.nonnull
\r
729 { format.authors output.nonnull }
\r
734 format.btitle "title" output.check
\r
736 { organization empty$
\r
737 { address new.block.checka
\r
743 { organization address new.block.checkb
\r
744 organization output
\r
748 format.edition output
\r
754 FUNCTION {mastersthesis}
\r
756 format.authors "author" output.check
\r
758 format.date "year" output.check
\r
760 format.title "title" output.check
\r
762 "Master's thesis" format.thesis.type output.nonnull
\r
763 school "school" output.check
\r
772 format.authors output
\r
774 title howpublished new.block.checkb
\r
775 format.title output
\r
776 howpublished new.block.checka
\r
777 howpublished output
\r
784 FUNCTION {phdthesis}
\r
786 format.authors "author" output.check
\r
788 format.date "year" output.check
\r
790 format.btitle "title" output.check
\r
792 "PhD thesis" format.thesis.type output.nonnull
\r
793 school "school" output.check
\r
800 FUNCTION {proceedings}
\r
803 { organization output }
\r
804 { format.editors output.nonnull }
\r
807 format.date "year" output.check
\r
809 format.btitle "title" output.check
\r
810 format.bvolume output
\r
811 format.number.series output
\r
814 { publisher new.sentence.checka }
\r
815 { organization publisher new.sentence.checkb
\r
816 organization output
\r
821 { address output.nonnull
\r
825 { organization output }
\r
835 FUNCTION {techreport}
\r
837 format.authors "author" output.check
\r
839 format.date "year" output.check
\r
841 format.title "title" output.check
\r
843 format.tr.number output.nonnull
\r
844 institution "institution" output.check
\r
851 FUNCTION {unpublished}
\r
853 format.authors "author" output.check
\r
857 format.title "title" output.check
\r
859 note "note" output.check
\r
863 FUNCTION {default.type} { misc }
\r
865 MACRO {jan} {"January"}
\r
867 MACRO {feb} {"February"}
\r
869 MACRO {mar} {"March"}
\r
871 MACRO {apr} {"April"}
\r
873 MACRO {may} {"May"}
\r
875 MACRO {jun} {"June"}
\r
877 MACRO {jul} {"July"}
\r
879 MACRO {aug} {"August"}
\r
881 MACRO {sep} {"September"}
\r
883 MACRO {oct} {"October"}
\r
885 MACRO {nov} {"November"}
\r
887 MACRO {dec} {"December"}
\r
889 MACRO {acmcs} {"ACM Computing Surveys"}
\r
891 MACRO {acta} {"Acta Informatica"}
\r
893 MACRO {cacm} {"Communications of the ACM"}
\r
895 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
\r
897 MACRO {ibmsj} {"IBM Systems Journal"}
\r
899 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
\r
901 MACRO {ieeetc} {"IEEE Transactions on Computers"}
\r
904 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
\r
906 MACRO {ipl} {"Information Processing Letters"}
\r
908 MACRO {jacm} {"Journal of the ACM"}
\r
910 MACRO {jcss} {"Journal of Computer and System Sciences"}
\r
912 MACRO {scp} {"Science of Computer Programming"}
\r
914 MACRO {sicomp} {"SIAM Journal on Computing"}
\r
916 MACRO {tocs} {"ACM Transactions on Computer Systems"}
\r
918 MACRO {tods} {"ACM Transactions on Database Systems"}
\r
920 MACRO {tog} {"ACM Transactions on Graphics"}
\r
922 MACRO {toms} {"ACM Transactions on Mathematical Software"}
\r
924 MACRO {toois} {"ACM Transactions on Office Information Systems"}
\r
926 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
\r
928 MACRO {tcs} {"Theoretical Computer Science"}
\r
939 FUNCTION {chop.word}
\r
942 s #1 len substring$ =
\r
943 { s len #1 + global.max$ substring$ }
\r
948 FUNCTION {sort.format.names}
\r
952 s num.names$ 'numnames :=
\r
953 numnames 'namesleft :=
\r
959 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
\r
960 nameptr numnames = t "others" = and
\r
961 { " {\it et~al.}" * }
\r
964 nameptr #1 + 'nameptr :=
\r
965 namesleft #1 - 'namesleft :=
\r
970 FUNCTION {sort.format.title}
\r
974 "The " #4 t chop.word
\r
978 #1 global.max$ substring$
\r
981 FUNCTION {author.sort}
\r
984 { "to sort, need author or key in " cite$ * warning$
\r
990 { author sort.format.names }
\r
994 FUNCTION {author.editor.sort}
\r
998 { "to sort, need author, editor, or key in " cite$ * warning$
\r
1004 { editor sort.format.names }
\r
1007 { author sort.format.names }
\r
1011 FUNCTION {author.organization.sort}
\r
1013 { organization empty$
\r
1015 { "to sort, need author, organization, or key in " cite$ * warning$
\r
1021 { "The " #4 organization chop.word sortify }
\r
1024 { author sort.format.names }
\r
1028 FUNCTION {editor.organization.sort}
\r
1030 { organization empty$
\r
1032 { "to sort, need editor, organization, or key in " cite$ * warning$
\r
1038 { "The " #4 organization chop.word sortify }
\r
1041 { editor sort.format.names }
\r
1045 FUNCTION {presort}
\r
1049 'author.editor.sort
\r
1050 { type$ "proceedings" =
\r
1051 'editor.organization.sort
\r
1052 { type$ "manual" =
\r
1053 'author.organization.sort
\r
1062 year field.or.null sortify
\r
1066 title field.or.null
\r
1069 #1 entry.max$ substring$
\r
1077 STRINGS { longest.label }
\r
1079 INTEGERS { number.label longest.label.width }
\r
1081 FUNCTION {initialize.longest.label}
\r
1082 { "" 'longest.label :=
\r
1083 #1 'number.label :=
\r
1084 #0 'longest.label.width :=
\r
1087 FUNCTION {longest.label.pass}
\r
1088 { number.label int.to.str$ 'label :=
\r
1089 number.label #1 + 'number.label :=
\r
1090 label width$ longest.label.width >
\r
1091 { label 'longest.label :=
\r
1092 label width$ 'longest.label.width :=
\r
1098 EXECUTE {initialize.longest.label}
\r
1100 ITERATE {longest.label.pass}
\r
1102 FUNCTION {begin.bib}
\r
1103 { preamble$ empty$
\r
1105 { preamble$ write$ newline$ }
\r
1107 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
\r
1110 EXECUTE {begin.bib}
\r
1112 EXECUTE {init.state.consts}
\r
1114 ITERATE {call.type$}
\r
1116 FUNCTION {end.bib}
\r
1118 "\end{thebibliography}" write$ newline$
\r