3 % BibTeX standard bibliography style `plain'
4 % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
5 % Copyright (C) 1985, all rights reserved.
6 % Copying of this file is authorized only if either
7 % (1) you make absolutely no changes to your copy, including name, or
8 % (2) if you do make changes, you name it something other than
9 % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
10 % This restriction helps ensure that all standard styles are identical.
11 % The file btxbst.doc has the documentation for this style.
41 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
43 FUNCTION {init.state.consts}
52 FUNCTION {output.nonnull}
54 output.state mid.sentence =
56 { output.state after.block =
61 { output.state before.all =
63 { add.period$ " " * write$ }
67 mid.sentence 'output.state :=
80 FUNCTION {output.check}
83 { pop$ "empty " t * " in " * cite$ * warning$ }
88 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$ }
243 FUNCTION {format.eprint}
255 { t #1 #1 substring$ "-" =
256 { t #1 #2 substring$ "--" = not
258 t #2 global.max$ substring$ 't :=
260 { { t #1 #1 substring$ "-" = }
262 t #2 global.max$ substring$ 't :=
268 { t #1 #1 substring$ *
269 t #2 global.max$ substring$ 't :=
276 FUNCTION {format.date}
280 { "there's a month but no year in " cite$ * warning$
287 { month " " * year * }
293 FUNCTION {format.btitle}
297 FUNCTION {tie.or.space.connect}
298 { duplicate$ text.length$ #3 <
305 FUNCTION {either.or.check}
308 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
312 FUNCTION {format.bvolume}
315 { "volume" volume tie.or.space.connect
318 { " of " * series emphasize * }
320 "volume and number" number either.or.check
325 FUNCTION {format.number.series}
328 { series field.or.null }
329 { output.state mid.sentence =
333 number tie.or.space.connect
335 { "there's a number but no series in " cite$ * warning$ }
336 { " in " * series * }
345 FUNCTION {format.edition}
348 { output.state mid.sentence =
349 { edition "l" change.case$ " edition" * }
350 { edition "t" change.case$ " edition" * }
356 INTEGERS { multiresult }
358 FUNCTION {multi.page.check}
367 swap$ duplicate$ "," =
370 { #1 'multiresult := }
371 { t #2 global.max$ substring$ 't := }
378 FUNCTION {format.pages}
381 { pages multi.page.check
382 { "pages" pages n.dashify tie.or.space.connect }
383 { "page" pages tie.or.space.connect }
389 FUNCTION {format.vol.num.pages}
390 { volume field.or.null
393 { "(" number * ")" * *
395 { "there's a number but no volume in " cite$ * warning$ }
403 { pop$ format.pages }
404 { ":" * pages n.dashify * }
410 FUNCTION {format.chapter.pages}
415 { type "l" change.case$ }
417 chapter tie.or.space.connect
420 { ", " * format.pages * }
426 FUNCTION {format.in.ed.booktitle}
430 { "In " booktitle emphasize * }
431 { "In " format.editors * ", " * booktitle emphasize * }
437 FUNCTION {empty.misc.check}
438 { author empty$ title empty$ howpublished empty$
439 month empty$ year empty$ note empty$
442 { "all relevant fields are empty in " cite$ * warning$ }
447 FUNCTION {format.thesis.type}
451 type "t" change.case$
456 FUNCTION {format.tr.number}
458 { "Technical Report" }
463 { number tie.or.space.connect }
467 FUNCTION {format.article.crossref}
470 { "need key or journal for " cite$ * " to crossref " * crossref *
474 { "In {\em " journal * "\/}" * }
479 " \cite{" * crossref * "}" *
482 FUNCTION {format.crossref.editor}
483 { editor #1 "{vv~}{ll}" format.name$
484 editor num.names$ duplicate$
489 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
491 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
499 FUNCTION {format.book.crossref}
501 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
504 { "Volume" volume tie.or.space.connect
509 editor field.or.null author field.or.null =
513 { "need editor, key, or series for " cite$ * " to crossref " *
517 { "{\em " * series * "\/}" * }
523 { format.crossref.editor * }
525 " \cite{" * crossref * "}" *
528 FUNCTION {format.incoll.inproc.crossref}
530 editor field.or.null author field.or.null =
534 { "need editor, key, or booktitle for " cite$ * " to crossref " *
538 { "In {\em " booktitle * "\/}" * }
544 { "In " format.crossref.editor * }
546 " \cite{" * crossref * "}" *
551 format.authors "author" output.check
553 format.title "title" output.check
556 { journal emphasize "journal" output.check
557 format.vol.num.pages output
558 format.date "year" output.check
560 { format.article.crossref output.nonnull
573 { format.editors "author and editor" output.check }
574 { format.authors output.nonnull
576 { "author and editor" editor either.or.check }
582 format.btitle "title" output.check
584 { format.bvolume output
586 format.number.series output
588 publisher "publisher" output.check
592 format.book.crossref output.nonnull
595 format.edition output
596 format.date "year" output.check
605 format.authors output
607 format.title "title" output.check
608 howpublished address new.block.checkb
621 { format.editors "author and editor" output.check }
622 { format.authors output.nonnull
624 { "author and editor" editor either.or.check }
630 format.btitle "title" output.check
632 { format.bvolume output
633 format.chapter.pages "chapter and pages" output.check
635 format.number.series output
637 publisher "publisher" output.check
640 { format.chapter.pages "chapter and pages" output.check
642 format.book.crossref output.nonnull
645 format.edition output
646 format.date "year" output.check
653 FUNCTION {incollection}
655 format.authors "author" output.check
657 format.title "title" output.check
660 { format.in.ed.booktitle "booktitle" output.check
661 format.bvolume output
662 format.number.series output
663 format.chapter.pages output
665 publisher "publisher" output.check
667 format.edition output
668 format.date "year" output.check
670 { format.incoll.inproc.crossref output.nonnull
671 format.chapter.pages output
680 FUNCTION {inproceedings}
682 format.authors "author" output.check
684 format.title "title" output.check
687 { format.in.ed.booktitle "booktitle" output.check
688 format.bvolume output
689 format.number.series output
692 { organization publisher new.sentence.checkb
695 format.date "year" output.check
697 { address output.nonnull
698 format.date "year" output.check
705 { format.incoll.inproc.crossref output.nonnull
715 FUNCTION {conference} { inproceedings }
720 { organization empty$
722 { organization output.nonnull
727 { format.authors output.nonnull }
730 format.btitle "title" output.check
732 { organization empty$
733 { address new.block.checka
739 { organization address new.block.checkb
744 format.edition output
752 FUNCTION {mastersthesis}
754 format.authors "author" output.check
756 format.title "title" output.check
758 "Master's thesis" format.thesis.type output.nonnull
759 school "school" output.check
761 format.date "year" output.check
770 format.authors output
771 title howpublished new.block.checkb
773 howpublished new.block.checka
785 format.authors "author" output.check
787 format.btitle "title" output.check
789 "PhD thesis" format.thesis.type output.nonnull
790 school "school" output.check
792 format.date "year" output.check
799 FUNCTION {proceedings}
802 { organization output }
803 { format.editors output.nonnull }
806 format.btitle "title" output.check
807 format.bvolume output
808 format.number.series output
811 { publisher new.sentence.checka }
812 { organization publisher new.sentence.checkb
817 format.date "year" output.check
819 { address output.nonnull
820 format.date "year" output.check
824 { organization output }
835 FUNCTION {techreport}
837 format.authors "author" output.check
839 format.title "title" output.check
841 format.tr.number output.nonnull
842 institution "institution" output.check
844 format.date "year" output.check
851 FUNCTION {unpublished}
853 format.authors "author" output.check
855 format.title "title" output.check
857 note "note" output.check
863 FUNCTION {default.type} { misc }
865 MACRO {jan} {"January"}
867 MACRO {feb} {"February"}
869 MACRO {mar} {"March"}
871 MACRO {apr} {"April"}
879 MACRO {aug} {"August"}
881 MACRO {sep} {"September"}
883 MACRO {oct} {"October"}
885 MACRO {nov} {"November"}
887 MACRO {dec} {"December"}
889 MACRO {acmcs} {"ACM Computing Surveys"}
891 MACRO {acta} {"Acta Informatica"}
893 MACRO {cacm} {"Communications of the ACM"}
895 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
897 MACRO {ibmsj} {"IBM Systems Journal"}
899 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
901 MACRO {ieeetc} {"IEEE Transactions on Computers"}
904 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
906 MACRO {ipl} {"Information Processing Letters"}
908 MACRO {jacm} {"Journal of the ACM"}
910 MACRO {jcss} {"Journal of Computer and System Sciences"}
912 MACRO {scp} {"Science of Computer Programming"}
914 MACRO {sicomp} {"SIAM Journal on Computing"}
916 MACRO {tocs} {"ACM Transactions on Computer Systems"}
918 MACRO {tods} {"ACM Transactions on Database Systems"}
920 MACRO {tog} {"ACM Transactions on Graphics"}
922 MACRO {toms} {"ACM Transactions on Mathematical Software"}
924 MACRO {toois} {"ACM Transactions on Office Information Systems"}
926 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
928 MACRO {tcs} {"Theoretical Computer Science"}
942 s #1 len substring$ =
943 { s len #1 + global.max$ substring$ }
948 FUNCTION {sort.format.names}
952 s num.names$ 'numnames :=
953 numnames 'namesleft :=
959 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
960 nameptr numnames = t "others" = and
964 nameptr #1 + 'nameptr :=
965 namesleft #1 - 'namesleft :=
970 FUNCTION {sort.format.title}
974 "The " #4 t chop.word
978 #1 global.max$ substring$
981 FUNCTION {author.sort}
984 { "to sort, need author or key in " cite$ * warning$
990 { author sort.format.names }
994 FUNCTION {author.editor.sort}
998 { "to sort, need author, editor, or key in " cite$ * warning$
1004 { editor sort.format.names }
1007 { author sort.format.names }
1011 FUNCTION {author.organization.sort}
1013 { organization empty$
1015 { "to sort, need author, organization, or key in " cite$ * warning$
1021 { "The " #4 organization chop.word sortify }
1024 { author sort.format.names }
1028 FUNCTION {editor.organization.sort}
1030 { organization empty$
1032 { "to sort, need editor, organization, or key in " cite$ * warning$
1038 { "The " #4 organization chop.word sortify }
1041 { editor sort.format.names }
1050 { type$ "proceedings" =
1051 'editor.organization.sort
1053 'author.organization.sort
1062 year field.or.null sortify
1069 #1 entry.max$ substring$
1077 STRINGS { longest.label }
1079 INTEGERS { number.label longest.label.width }
1081 FUNCTION {initialize.longest.label}
1082 { "" 'longest.label :=
1084 #0 'longest.label.width :=
1087 FUNCTION {longest.label.pass}
1088 { number.label int.to.str$ 'label :=
1089 number.label #1 + 'number.label :=
1090 label width$ longest.label.width >
1091 { label 'longest.label :=
1092 label width$ 'longest.label.width :=
1098 EXECUTE {initialize.longest.label}
1100 ITERATE {longest.label.pass}
1102 FUNCTION {begin.bib}
1105 { preamble$ write$ newline$ }
1107 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
1112 EXECUTE {init.state.consts}
1114 ITERATE {call.type$}
1118 "\end{thebibliography}" write$ newline$