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.
40 { author.duplicate author.shared }
43 INTEGERS { output.state before.all mid.sentence after.sentence after.block after.title author.different author.last author.flast citen.used url.used }
45 % Rearranged such that true values require capital letters
46 FUNCTION {init.consts}
53 #0 'author.different :=
56 %#3 'author.firstlast :=
62 STRINGS { s t u } % Added u
64 % Puts the period inside any quotes
67 duplicate$ #-1 #3 substring$ "'''" =
68 { duplicate$ text.length$ #3 - text.prefix$ add.period$ "'\thinspace''" * }
69 { duplicate$ #-1 #3 substring$ "''}" =
70 { #2 global.max$ substring$ duplicate$
71 text.length$ #2 - text.prefix$ add.period$ "{" swap$ * "''}" * }
72 { duplicate$ #-1 #2 substring$ "''" =
73 { duplicate$ text.length$ #2 - text.prefix$ add.period$ "''" * }
82 % Switched to do.period and added after.title
83 FUNCTION {output.nonnull}
85 output.state mid.sentence =
87 { output.state after.block =
92 { output.state before.all =
94 { output.state after.title =
96 { do.period " " * write$ }
102 mid.sentence 'output.state :=
115 FUNCTION {output.check}
118 { pop$ "empty " t * " in " * cite$ * warning$ }
123 % Switched to do.period
131 { output.state before.all =
133 { after.block 'output.state := }
137 FUNCTION {new.sentence}
138 { output.state after.block =
140 { output.state before.all =
142 { after.sentence 'output.state := }
149 %{ output.state after.block =
151 % { output.state before.all =
153 % { after.title 'output.state := }
177 FUNCTION {new.block.checka}
184 FUNCTION {new.block.checkb}
193 FUNCTION {new.sentence.checka}
200 FUNCTION {new.sentence.checkb}
209 FUNCTION {field.or.null}
219 { "{\em " swap$ * "}" * }
223 INTEGERS { nameptr namesleft numnames }
225 FUNCTION {format.names.custom}
229 s num.names$ 'numnames :=
230 numnames 'namesleft :=
232 { s nameptr u format.name$ 't :=
249 nameptr #1 + 'nameptr :=
250 namesleft #1 - 'namesleft :=
255 FUNCTION {format.names}
256 { "{ff~}{vv~}{ll}{, jj}" format.names.custom }
258 % Changed first author to last name first
259 FUNCTION {format.names.beginning}
262 s num.names$ 'numnames :=
263 numnames 'namesleft :=
266 { s nameptr "{vv~}{ll}{, ff}{, jj}" format.name$
267 duplicate$ #1 #1 substring$ "u" change.case$ swap$
268 duplicate$ #-1 swap$ text.length$ #1 - substring$ * 't := }
269 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := }
287 nameptr #1 + 'nameptr :=
288 namesleft #1 - 'namesleft :=
293 % Added check for duplicate authors
294 FUNCTION {format.authors}
297 { author.duplicate #1 =
299 { author format.names.beginning }
305 % Changed to MLA editor abbreviations
306 % author.duplicate also applies
307 FUNCTION {format.editors}
310 { author empty$ author.duplicate #1 = and
312 { editor format.names.beginning }
314 editor num.names$ #1 >
322 FUNCTION {format.editors.mid}
326 editor num.names$ #1 >
330 editor format.names *
335 % Formats the address and publisher
336 FUNCTION {format.publisher}
339 { address ": " * publisher * }
343 % Changed to preserve case and use quotes
344 FUNCTION {format.title}
347 { title #1 text.prefix$ "`" =
348 { "``\thinspace" title * "''" * }
349 { "``" title * "''" *}
359 { t #1 #1 substring$ "-" =
360 { t #1 #2 substring$ "--" = not
362 t #2 global.max$ substring$ 't :=
364 { { t #1 #1 substring$ "-" = }
366 t #2 global.max$ substring$ 't :=
372 { t #1 #1 substring$ *
373 t #2 global.max$ substring$ 't :=
380 FUNCTION {format.date}
384 { "there's a month but no year in " cite$ * warning$
391 { month "~" * year * }
397 FUNCTION {format.btitle}
401 FUNCTION {tie.or.space.connect}
402 { duplicate$ text.length$ #3 <
409 FUNCTION {either.or.check}
412 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
416 FUNCTION {format.bvolume.or.num.series}
419 { series field.or.null }
422 { number "there's a number but no series in " cite$ * warning$ }
424 %output.state mid.sentence =
428 number tie.or.space.connect
434 { "Vol." volume tie.or.space.connect
437 { " of " * series emphasize * add.period$ }
441 { number * " vols." * }
443 %"volume and number" number either.or.check
448 FUNCTION {format.number.series}
455 % Changed edition to MLA abbreviation
456 FUNCTION {format.edition}
460 { "Vers.~" version *}
463 { edition "l" change.case$ 's := edition 't :=
465 "10th" "tenth" "9th" "ninth" "8th" "eighth" "7th" "seventh" "6th" "sixth"
466 "5th" "fifth" "4th" "fourth" "3rd" "third" "2nd" "second" "1st" "first"
467 {duplicate$ empty$ { pop$ #0 }{ #1 } if$ }{ s = { 't := }{ pop$ } if$ }
470 "edition and version" version either.or.check
475 INTEGERS { multiresult }
477 FUNCTION {multi.page.check}
486 swap$ duplicate$ "," =
489 { #1 'multiresult := }
490 { t #2 global.max$ substring$ 't := }
497 FUNCTION {format.pages}
500 { %pages multi.page.check
501 % { "pages" pages n.dashify tie.or.space.connect }
502 % { "page" pages tie.or.space.connect }
509 FUNCTION {format.vol.num.year.pages}
513 { "there's a number but no volume in " cite$ * warning$ }
522 " (" * format.date * ")" *
527 { ", " * format.edition * }
531 { ": " * pages n.dashify * }
536 FUNCTION {format.vol.num.pages}
537 { volume field.or.null
540 { "(" number * ")" * *
542 { "there's a number but no volume in " cite$ * warning$ }
550 { pop$ format.pages }
551 { ":" * pages n.dashify * }
557 % chapter might be useful if type is set to "pars."
558 FUNCTION {format.chapter.pages}
563 { type "t" change.case$ }
565 chapter n.dashify tie.or.space.connect
568 { ", " * format.pages * }
574 FUNCTION {format.in.ed.booktitle}
578 { "In " booktitle emphasize * }
579 { booktitle emphasize add.period$ format.editors.mid * }
585 FUNCTION {empty.misc.check}
586 { author empty$ title empty$ howpublished empty$
587 month empty$ year empty$ note empty$
590 { "all relevant fields are empty in " cite$ * warning$ }
595 FUNCTION {format.thesis.type}
599 type "t" change.case$
604 FUNCTION {format.tr.number}
606 { "Technical Report" }
611 { number tie.or.space.connect }
615 FUNCTION {format.url}
619 { "There's a url but no accessdate in " cite$ * warning$ "" }
622 "$<$\url{" * url * "}$>$" *
623 url.used #1 + 'url.used :=
626 { do.period " Path: " * urlpath * }
632 FUNCTION {format.article.crossref}
635 %{ "need key or journal for " cite$ * " to crossref " * crossref *
639 %{ "In {\em " journal * "\/}" * }
644 pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
645 "{" * crossref * "}" *
646 citen.used #1 + 'citen.used :=
649 FUNCTION {format.crossref.editor}
650 { editor #1 "{vv~}{ll}" format.name$
651 editor num.names$ duplicate$
656 { editor #2 "{ff }{vv }{ll}{, jj}" format.name$ "others" =
658 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
666 FUNCTION {format.book.crossref}
668 % { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
671 % { "Vol." volume tie.or.space.connect add.period$
675 % editor field.or.null author field.or.null =
679 %{ "need editor, key, or series for " cite$ * " to crossref " *
680 % crossref * warning$
683 %{ "{\em " * series * "\/}" * }
689 % { format.crossref.editor * }
691 pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
692 "{" * crossref * "}" *
693 citen.used #1 + 'citen.used :=
696 FUNCTION {format.incoll.inproc.crossref}
698 % editor field.or.null author field.or.null =
702 % { "need editor, key, or booktitle for " cite$ * " to crossref " *
703 % crossref * warning$
706 % { "In {\em " booktitle * "\/}" * }
712 % { "In " format.crossref.editor * }
714 pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
715 "{" * crossref * "}" *
716 citen.used #1 + 'citen.used :=
719 FUNCTION {cite.title}
720 { title empty$ journal empty$ not and
721 { key empty$ { journal }{ key } if$ emphasize }
722 { title empty$ key empty$ and
723 { "empty title and key in " cite$ * warning$ "" }
724 { key empty$ {title}{key} if$
729 type$ "proceedings" =
734 type$ "incollection" =
735 type$ "inproceedings" =
736 type$ "mastersthesis" =
739 type$ "unpublished" =
741 {"``" swap$ * "''" * }
752 FUNCTION {cite.label}
755 % { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
770 author.shared author.different =
771 { "{vv~}{ll}" format.names.custom }
772 { author.shared author.last =
773 { "{f.~}{vv~}{ll}{, jj}" format.names.custom }
774 { author.shared author.flast =
775 { "{ff~}{vv~}{ll}{, jj}" format.names.custom }
776 { "{vv~}{ll}" format.names.custom ", " * cite.title * }
782 author.duplicate { ", " * cite.title * }{} if$
793 FUNCTION {output.bibitem}
802 before.all 'output.state :=
807 format.authors "author" output.check
809 format.title "title" output.check
812 { journal emphasize "journal" output.check after.title 'output.state :=
813 %format.date "year" output.check
815 format.vol.num.year.pages output
817 { format.article.crossref output.nonnull
831 { format.editors "author and editor" output.check }
832 { format.authors output.nonnull }
835 format.btitle "title" output.check
838 { author empty$ 'skip$ { format.editors.mid output new.sentence } if$
839 format.edition output
841 format.bvolume.or.num.series output
843 format.publisher "publisher" output.check
844 format.date "year" output.check
846 {% format.date "year" output
848 format.book.crossref output.nonnull
860 format.authors output
862 format.title "title" output.check
863 howpublished address new.block.checkb
875 { format.editors "author and editor" output.check }
876 { format.authors output.nonnull }
879 format.btitle "title" output.check
882 { author empty$ 'skip$ { format.editors.mid output new.sentence } if$
883 format.edition output
885 format.bvolume.or.num.series output
887 format.publisher "publisher" output.check
888 format.date "year" output.check
890 format.chapter.pages "chapter and pages" output.check
893 {% format.chapter.pages "chapter and pages" output.check
895 format.book.crossref output.nonnull
904 FUNCTION {incollection}
906 format.authors "author" output.check
908 { new.block type output }
912 format.title "title" output.check
916 booktitle emphasize "booktitle" output.check
918 format.editors.mid "editor" output.check
920 format.edition output
922 format.bvolume.or.num.series output
924 format.publisher "publisher" output.check
926 format.date "year" output.check
928 format.chapter.pages output
930 { format.incoll.inproc.crossref output.nonnull
931 %format.chapter.pages output
941 FUNCTION {inproceedings}
943 format.authors "author" output.check
945 format.title "title" output.check
948 { %format.in.ed.booktitle "booktitle" output.check
949 booktitle "booktitle" output.check
951 format.editors.mid output
953 format.edition output
955 format.bvolume.or.num.series output
957 format.edition output
959 format.publisher output
960 format.date "year" output.check
962 %{ organization publisher new.sentence.checkb
963 % organization output
965 % format.date "year" output.check
967 %{ address output.nonnull
968 % format.date "year" output.check
970 % organization output
977 { format.incoll.inproc.crossref output.nonnull
988 FUNCTION {conference} { inproceedings }
993 { organization empty$
995 { organization output.nonnull
1000 { format.authors output.nonnull }
1003 format.btitle "title" output.check
1005 format.edition output
1008 { organization empty$
1009 { address new.block.checka
1015 { organization address new.block.checkb
1028 FUNCTION {mastersthesis}
1030 format.authors "author" output.check
1032 format.title "title" output.check
1034 "Diss." format.thesis.type output.nonnull
1035 after.title 'output.state :=
1036 school "school" output.check
1038 format.date "year" output.check
1048 format.authors output
1049 title howpublished new.block.checkb
1052 %howpublished new.block.checka
1063 FUNCTION {phdthesis}
1065 format.authors "author" output.check
1067 format.btitle "title" output.check
1069 "Diss." format.thesis.type output.nonnull
1070 after.title 'output.state :=
1071 school "school" output.check
1073 format.date "year" output.check
1081 FUNCTION {proceedings}
1084 { organization output }
1085 { format.editors output.nonnull }
1088 format.btitle "title" output.check
1090 format.bvolume.or.num.series output
1093 { publisher new.sentence.checka }
1094 { organization publisher new.sentence.checkb
1099 format.date "year" output.check
1101 { address output.nonnull
1102 format.date "year" output.check
1106 { organization output }
1118 FUNCTION {techreport}
1120 format.authors "author" output.check
1122 format.title "title" output.check
1124 format.tr.number output.nonnull
1125 institution "institution" output.check
1127 format.date "year" output.check
1133 FUNCTION {unpublished}
1135 format.authors "author" output.check
1137 format.title "title" output.check
1141 note "note" output.check
1146 FUNCTION {default.type} { misc }
1148 MACRO {jan} {"Jan."}
1150 MACRO {feb} {"Feb."}
1152 MACRO {mar} {"Mar."}
1154 MACRO {apr} {"Apr."}
1158 MACRO {jun} {"June"}
1160 MACRO {jul} {"July"}
1162 MACRO {aug} {"Aug."}
1164 MACRO {sep} {"Sept."}
1166 MACRO {oct} {"Oct."}
1168 MACRO {nov} {"Nov."}
1170 MACRO {dec} {"Dec."}
1172 MACRO {acmcs} {"ACM Computing Surveys"}
1174 MACRO {acta} {"Acta Informatica"}
1176 MACRO {cacm} {"Communications of the ACM"}
1178 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1180 MACRO {ibmsj} {"IBM Systems Journal"}
1182 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1184 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1187 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1189 MACRO {ipl} {"Information Processing Letters"}
1191 MACRO {jacm} {"Journal of the ACM"}
1193 MACRO {jcss} {"Journal of Computer and System Sciences"}
1195 MACRO {scp} {"Science of Computer Programming"}
1197 MACRO {sicomp} {"SIAM Journal on Computing"}
1199 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1201 MACRO {tods} {"ACM Transactions on Database Systems"}
1203 MACRO {tog} {"ACM Transactions on Graphics"}
1205 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1207 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1209 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1211 MACRO {tcs} {"Theoretical Computer Science"}
1222 FUNCTION {chop.word}
1225 s #1 len substring$ =
1226 { s len #1 + global.max$ substring$ }
1231 FUNCTION {sort.format.names}
1235 s num.names$ 'numnames :=
1236 numnames 'namesleft :=
1242 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1243 nameptr numnames = t "others" = and
1247 nameptr #1 + 'nameptr :=
1248 namesleft #1 - 'namesleft :=
1253 FUNCTION {sort.format.title}
1257 "The " #4 t chop.word
1261 #1 global.max$ substring$
1264 FUNCTION {author.sort}
1267 { "to sort, need author or key in " cite$ * warning$
1273 { author sort.format.names }
1277 FUNCTION {author.editor.sort}
1281 { "to sort, need author, editor, or key in " cite$ * warning$
1287 { editor sort.format.names }
1290 { author sort.format.names }
1294 FUNCTION {author.organization.sort}
1296 { organization empty$
1298 { "to sort, need author, organization, or key in " cite$ * warning$
1304 { "The " #4 organization chop.word sortify }
1307 { author sort.format.names }
1311 FUNCTION {editor.organization.sort}
1313 { organization empty$
1315 { "to sort, need editor, organization, or key in " cite$ * warning$
1321 { "The " #4 organization chop.word sortify }
1324 { editor sort.format.names }
1333 { type$ "proceedings" =
1334 'editor.organization.sort
1336 'author.organization.sort
1343 duplicate$ empty$ 'skip$ { " " * } if$
1345 { title field.or.null sort.format.title * " " * booktitle field.or.null sort.format.title * }
1350 year field.or.null sortify
1352 #1 entry.max$ substring$
1363 FUNCTION {init.vars}
1364 { #0 int.to.chr$ 'a :=
1365 #0 int.to.chr$ 'b :=
1370 FUNCTION {forward.author.dup.check}
1373 { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
1379 { b "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$
1380 a "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$ =
1381 { #1 'author.duplicate := }
1382 { #0 'author.duplicate := }
1389 FUNCTION {forward.author.share.check}
1391 % Pass through all entries, comparing current author to last one.
1393 { author.duplicate author empty$ or
1394 { author.duplicate { i 'author.shared := }{} if$}
1395 { b "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$
1396 author field.or.null "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$ =
1397 { author.flast 'author.shared := }
1398 { b "{vv~}{ll}" format.names.custom purify$
1399 author field.or.null "{vv~}{ll}" format.names.custom purify$ =
1400 { author.last 'author.shared := }
1401 { author.different 'author.shared := }
1406 author field.or.null 'b :=
1411 FUNCTION {reverse.author}
1415 { i 'author.shared := }
1420 { author.shared i 'author.shared := 'i := }
1421 { author.shared 'i := }
1425 j #1 = author.duplicate not and { #2 'author.duplicate := } {} if$
1426 author.duplicate 'j :=
1429 EXECUTE {init.consts}
1432 ITERATE {forward.author.dup.check}
1435 ITERATE {forward.author.share.check}
1438 REVERSE {reverse.author}
1440 %INTEGERS { number.label longest.label.width }
1442 %FUNCTION {initialize.longest.label}
1443 %{ "" 'longest.label :=
1444 % #1 'number.label :=
1445 % #0 'longest.label.width :=
1448 %FUNCTION {longest.label.pass}
1449 %{ number.label int.to.str$ 'label :=
1450 % number.label #1 + 'number.label :=
1451 % label width$ longest.label.width >
1452 % { label 'longest.label :=
1453 % label width$ 'longest.label.width :=
1459 %EXECUTE {initialize.longest.label}
1461 %ITERATE {longest.label.pass}
1463 FUNCTION {begin.bib}
1466 { "\ifx\undefined\citeN\let\citeN\cite\fi" write$ newline$ }
1470 { "\ifx\undefined\url\let\url\relax\fi" write$ newline$ }
1475 { preamble$ write$ newline$ }
1477 "\begin{thebibliography}{\rule{.5in}{0pt}}" write$ newline$
1482 ITERATE {call.type$}
1486 "\end{thebibliography}" write$ newline$