1 % BibTeX standard bibliography style `plain'
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.
38 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
40 FUNCTION {init.state.consts}
49 FUNCTION {output.nonnull}
51 output.state mid.sentence =
53 { output.state after.block =
58 { output.state before.all =
60 { add.period$ " " * write$ }
64 mid.sentence 'output.state :=
77 FUNCTION {output.check}
80 { pop$ "empty " t * " in " * cite$ * warning$ }
85 FUNCTION {output.bibitem}
92 before.all 'output.state :=
102 { output.state before.all =
104 { after.block 'output.state := }
108 FUNCTION {new.sentence}
109 { output.state after.block =
111 { output.state before.all =
113 { after.sentence 'output.state := }
137 FUNCTION {new.block.checka}
144 FUNCTION {new.block.checkb}
153 FUNCTION {new.sentence.checka}
160 FUNCTION {new.sentence.checkb}
169 FUNCTION {field.or.null}
179 { "{\em " swap$ * "}" * }
183 INTEGERS { nameptr namesleft numnames }
185 FUNCTION {format.names}
188 s num.names$ 'numnames :=
189 numnames 'namesleft :=
191 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
208 nameptr #1 + 'nameptr :=
209 namesleft #1 - 'namesleft :=
214 FUNCTION {format.authors}
217 { author format.names }
221 FUNCTION {format.editors}
224 { editor format.names
225 editor num.names$ #1 >
233 FUNCTION {format.title}
236 { title "t" change.case$ }
244 { t #1 #1 substring$ "-" =
245 { t #1 #2 substring$ "--" = not
247 t #2 global.max$ substring$ 't :=
249 { { t #1 #1 substring$ "-" = }
251 t #2 global.max$ substring$ 't :=
257 { t #1 #1 substring$ *
258 t #2 global.max$ substring$ 't :=
265 FUNCTION {format.date}
269 { "there's a month but no year in " cite$ * warning$
276 { month " " * year * }
282 FUNCTION {format.btitle}
286 FUNCTION {tie.or.space.connect}
287 { duplicate$ text.length$ #3 <
294 FUNCTION {either.or.check}
297 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
301 FUNCTION {format.bvolume}
304 { "volume" volume tie.or.space.connect
307 { " of " * series emphasize * }
309 "volume and number" number either.or.check
314 FUNCTION {format.number.series}
317 { series field.or.null }
318 { output.state mid.sentence =
322 number tie.or.space.connect
324 { "there's a number but no series in " cite$ * warning$ }
325 { " in " * series * }
334 FUNCTION {format.edition}
337 { output.state mid.sentence =
338 { edition "l" change.case$ " edition" * }
339 { edition "t" change.case$ " edition" * }
345 INTEGERS { multiresult }
347 FUNCTION {multi.page.check}
356 swap$ duplicate$ "," =
359 { #1 'multiresult := }
360 { t #2 global.max$ substring$ 't := }
367 FUNCTION {format.pages}
370 { pages multi.page.check
371 { "pages" pages n.dashify tie.or.space.connect }
372 { "page" pages tie.or.space.connect }
378 FUNCTION {format.vol.num.pages}
379 { volume field.or.null
382 { "(" number * ")" * *
384 { "there's a number but no volume in " cite$ * warning$ }
392 { pop$ format.pages }
393 { ":" * pages n.dashify * }
399 FUNCTION {format.chapter.pages}
404 { type "l" change.case$ }
406 chapter tie.or.space.connect
409 { ", " * format.pages * }
415 FUNCTION {format.in.ed.booktitle}
419 { "In " booktitle emphasize * }
420 { "In " format.editors * ", " * booktitle emphasize * }
426 FUNCTION {empty.misc.check}
427 { author empty$ title empty$ howpublished empty$
428 month empty$ year empty$ note empty$
431 { "all relevant fields are empty in " cite$ * warning$ }
436 FUNCTION {format.thesis.type}
440 type "t" change.case$
445 FUNCTION {format.tr.number}
447 { "Technical Report" }
452 { number tie.or.space.connect }
456 FUNCTION {format.article.crossref}
459 { "need key or journal for " cite$ * " to crossref " * crossref *
463 { "In {\em " journal * "\/}" * }
468 " \cite{" * crossref * "}" *
471 FUNCTION {format.crossref.editor}
472 { editor #1 "{vv~}{ll}" format.name$
473 editor num.names$ duplicate$
478 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
480 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
488 FUNCTION {format.book.crossref}
490 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
493 { "Volume" volume tie.or.space.connect
498 editor field.or.null author field.or.null =
502 { "need editor, key, or series for " cite$ * " to crossref " *
506 { "{\em " * series * "\/}" * }
512 { format.crossref.editor * }
514 " \cite{" * crossref * "}" *
517 FUNCTION {format.incoll.inproc.crossref}
519 editor field.or.null author field.or.null =
523 { "need editor, key, or booktitle for " cite$ * " to crossref " *
527 { "In {\em " booktitle * "\/}" * }
533 { "In " format.crossref.editor * }
535 " \cite{" * crossref * "}" *
540 format.authors "author" output.check
542 format.title "title" output.check
545 { journal emphasize "journal" output.check
546 format.vol.num.pages output
547 format.date "year" output.check
549 { format.article.crossref output.nonnull
561 { format.editors "author and editor" output.check }
562 { format.authors output.nonnull
564 { "author and editor" editor either.or.check }
570 format.btitle "title" output.check
572 { format.bvolume output
574 format.number.series output
576 publisher "publisher" output.check
580 format.book.crossref output.nonnull
583 format.edition output
584 format.date "year" output.check
592 format.authors output
594 format.title "title" output.check
595 howpublished address new.block.checkb
607 { format.editors "author and editor" output.check }
608 { format.authors output.nonnull
610 { "author and editor" editor either.or.check }
616 format.btitle "title" output.check
618 { format.bvolume output
619 format.chapter.pages "chapter and pages" output.check
621 format.number.series output
623 publisher "publisher" output.check
626 { format.chapter.pages "chapter and pages" output.check
628 format.book.crossref output.nonnull
631 format.edition output
632 format.date "year" output.check
638 FUNCTION {incollection}
640 format.authors "author" output.check
642 format.title "title" output.check
645 { format.in.ed.booktitle "booktitle" output.check
646 format.bvolume output
647 format.number.series output
648 format.chapter.pages output
650 publisher "publisher" output.check
652 format.edition output
653 format.date "year" output.check
655 { format.incoll.inproc.crossref output.nonnull
656 format.chapter.pages output
664 FUNCTION {inproceedings}
666 format.authors "author" output.check
668 format.title "title" output.check
671 { format.in.ed.booktitle "booktitle" output.check
672 format.bvolume output
673 format.number.series output
676 { organization publisher new.sentence.checkb
679 format.date "year" output.check
681 { address output.nonnull
682 format.date "year" output.check
689 { format.incoll.inproc.crossref output.nonnull
698 FUNCTION {conference} { inproceedings }
703 { organization empty$
705 { organization output.nonnull
710 { format.authors output.nonnull }
713 format.btitle "title" output.check
715 { organization empty$
716 { address new.block.checka
722 { organization address new.block.checkb
727 format.edition output
734 FUNCTION {mastersthesis}
736 format.authors "author" output.check
738 format.title "title" output.check
740 "Master's thesis" format.thesis.type output.nonnull
741 school "school" output.check
743 format.date "year" output.check
751 format.authors output
752 title howpublished new.block.checkb
754 howpublished new.block.checka
765 format.authors "author" output.check
767 format.btitle "title" output.check
769 "PhD thesis" format.thesis.type output.nonnull
770 school "school" output.check
772 format.date "year" output.check
778 FUNCTION {proceedings}
781 { organization output }
782 { format.editors output.nonnull }
785 format.btitle "title" output.check
786 format.bvolume output
787 format.number.series output
790 { publisher new.sentence.checka }
791 { organization publisher new.sentence.checkb
796 format.date "year" output.check
798 { address output.nonnull
799 format.date "year" output.check
803 { organization output }
813 FUNCTION {techreport}
815 format.authors "author" output.check
817 format.title "title" output.check
819 format.tr.number output.nonnull
820 institution "institution" output.check
822 format.date "year" output.check
828 FUNCTION {unpublished}
830 format.authors "author" output.check
832 format.title "title" output.check
834 note "note" output.check
839 FUNCTION {default.type} { misc }
841 MACRO {jan} {"January"}
843 MACRO {feb} {"February"}
845 MACRO {mar} {"March"}
847 MACRO {apr} {"April"}
855 MACRO {aug} {"August"}
857 MACRO {sep} {"September"}
859 MACRO {oct} {"October"}
861 MACRO {nov} {"November"}
863 MACRO {dec} {"December"}
865 MACRO {acmcs} {"ACM Computing Surveys"}
867 MACRO {acta} {"Acta Informatica"}
869 MACRO {cacm} {"Communications of the ACM"}
871 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
873 MACRO {ibmsj} {"IBM Systems Journal"}
875 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
877 MACRO {ieeetc} {"IEEE Transactions on Computers"}
880 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
882 MACRO {ipl} {"Information Processing Letters"}
884 MACRO {jacm} {"Journal of the ACM"}
886 MACRO {jcss} {"Journal of Computer and System Sciences"}
888 MACRO {scp} {"Science of Computer Programming"}
890 MACRO {sicomp} {"SIAM Journal on Computing"}
892 MACRO {tocs} {"ACM Transactions on Computer Systems"}
894 MACRO {tods} {"ACM Transactions on Database Systems"}
896 MACRO {tog} {"ACM Transactions on Graphics"}
898 MACRO {toms} {"ACM Transactions on Mathematical Software"}
900 MACRO {toois} {"ACM Transactions on Office Information Systems"}
902 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
904 MACRO {tcs} {"Theoretical Computer Science"}
918 s #1 len substring$ =
919 { s len #1 + global.max$ substring$ }
924 FUNCTION {sort.format.names}
928 s num.names$ 'numnames :=
929 numnames 'namesleft :=
935 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
936 nameptr numnames = t "others" = and
940 nameptr #1 + 'nameptr :=
941 namesleft #1 - 'namesleft :=
946 FUNCTION {sort.format.title}
950 "The " #4 t chop.word
954 #1 global.max$ substring$
957 FUNCTION {author.sort}
960 { "to sort, need author or key in " cite$ * warning$
966 { author sort.format.names }
970 FUNCTION {author.editor.sort}
974 { "to sort, need author, editor, or key in " cite$ * warning$
980 { editor sort.format.names }
983 { author sort.format.names }
987 FUNCTION {author.organization.sort}
989 { organization empty$
991 { "to sort, need author, organization, or key in " cite$ * warning$
997 { "The " #4 organization chop.word sortify }
1000 { author sort.format.names }
1004 FUNCTION {editor.organization.sort}
1006 { organization empty$
1008 { "to sort, need editor, organization, or key in " cite$ * warning$
1014 { "The " #4 organization chop.word sortify }
1017 { editor sort.format.names }
1026 { type$ "proceedings" =
1027 'editor.organization.sort
1029 'author.organization.sort
1038 year field.or.null sortify
1045 #1 entry.max$ substring$
1053 STRINGS { longest.label }
1055 INTEGERS { number.label longest.label.width }
1057 FUNCTION {initialize.longest.label}
1058 { "" 'longest.label :=
1060 #0 'longest.label.width :=
1063 FUNCTION {longest.label.pass}
1064 { number.label int.to.str$ 'label :=
1065 number.label #1 + 'number.label :=
1066 label width$ longest.label.width >
1067 { label 'longest.label :=
1068 label width$ 'longest.label.width :=
1074 EXECUTE {initialize.longest.label}
1076 ITERATE {longest.label.pass}
1078 FUNCTION {begin.bib}
1081 { preamble$ write$ newline$ }
1083 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
1088 EXECUTE {init.state.consts}
1090 ITERATE {call.type$}
1094 "\end{thebibliography}" write$ newline$