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 * "}$>$" *
625 { do.period " Path: " * urlpath * }
631 FUNCTION {format.article.crossref}
634 %{ "need key or journal for " cite$ * " to crossref " * crossref *
638 %{ "In {\em " journal * "\/}" * }
643 pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
644 "{" * crossref * "}" *
645 citen.used #1 + 'citen.used :=
648 FUNCTION {format.crossref.editor}
649 { editor #1 "{vv~}{ll}" format.name$
650 editor num.names$ duplicate$
655 { editor #2 "{ff }{vv }{ll}{, jj}" format.name$ "others" =
657 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
665 FUNCTION {format.book.crossref}
667 % { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
670 % { "Vol." volume tie.or.space.connect add.period$
674 % editor field.or.null author field.or.null =
678 %{ "need editor, key, or series for " cite$ * " to crossref " *
679 % crossref * warning$
682 %{ "{\em " * series * "\/}" * }
688 % { format.crossref.editor * }
690 pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
691 "{" * crossref * "}" *
692 citen.used #1 + 'citen.used :=
695 FUNCTION {format.incoll.inproc.crossref}
697 % editor field.or.null author field.or.null =
701 % { "need editor, key, or booktitle for " cite$ * " to crossref " *
702 % crossref * warning$
705 % { "In {\em " booktitle * "\/}" * }
711 % { "In " format.crossref.editor * }
713 pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
714 "{" * crossref * "}" *
715 citen.used #1 + 'citen.used :=
718 FUNCTION {cite.title}
719 { title empty$ journal empty$ not and
720 { key empty$ { journal }{ key } if$ emphasize }
721 { title empty$ key empty$ and
722 { "empty title and key in " cite$ * warning$ "" }
723 { key empty$ {title}{key} if$
728 type$ "proceedings" =
733 type$ "incollection" =
734 type$ "inproceedings" =
735 type$ "mastersthesis" =
738 type$ "unpublished" =
740 {"``" swap$ * "''" * }
751 FUNCTION {cite.label}
754 % { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
769 author.shared author.different =
770 { "{vv~}{ll}" format.names.custom }
771 { author.shared author.last =
772 { "{f.~}{vv~}{ll}{, jj}" format.names.custom }
773 { author.shared author.flast =
774 { "{ff~}{vv~}{ll}{, jj}" format.names.custom }
775 { "{vv~}{ll}" format.names.custom ", " * cite.title * }
781 author.duplicate { ", " * cite.title * }{} if$
792 FUNCTION {output.bibitem}
801 before.all 'output.state :=
806 format.authors "author" output.check
808 format.title "title" output.check
811 { journal emphasize "journal" output.check after.title 'output.state :=
812 %format.date "year" output.check
814 format.vol.num.year.pages output
816 { format.article.crossref output.nonnull
830 { format.editors "author and editor" output.check }
831 { format.authors output.nonnull }
834 format.btitle "title" output.check
837 { author empty$ 'skip$ { format.editors.mid output new.sentence } if$
838 format.edition output
840 format.bvolume.or.num.series output
842 format.publisher "publisher" output.check
843 format.date "year" output.check
845 {% format.date "year" output
847 format.book.crossref output.nonnull
859 format.authors output
861 format.title "title" output.check
862 howpublished address new.block.checkb
874 { format.editors "author and editor" output.check }
875 { format.authors output.nonnull }
878 format.btitle "title" output.check
881 { author empty$ 'skip$ { format.editors.mid output new.sentence } if$
882 format.edition output
884 format.bvolume.or.num.series output
886 format.publisher "publisher" output.check
887 format.date "year" output.check
889 format.chapter.pages "chapter and pages" output.check
892 {% format.chapter.pages "chapter and pages" output.check
894 format.book.crossref output.nonnull
903 FUNCTION {incollection}
905 format.authors "author" output.check
907 { new.block type output }
911 format.title "title" output.check
915 booktitle emphasize "booktitle" output.check
917 format.editors.mid "editor" output.check
919 format.edition output
921 format.bvolume.or.num.series output
923 format.publisher "publisher" output.check
925 format.date "year" output.check
927 format.chapter.pages output
929 { format.incoll.inproc.crossref output.nonnull
930 %format.chapter.pages output
940 FUNCTION {inproceedings}
942 format.authors "author" output.check
944 format.title "title" output.check
947 { %format.in.ed.booktitle "booktitle" output.check
948 booktitle "booktitle" output.check
950 format.editors.mid output
952 format.edition output
954 format.bvolume.or.num.series output
956 format.edition output
958 format.publisher output
959 format.date "year" output.check
961 %{ organization publisher new.sentence.checkb
962 % organization output
964 % format.date "year" output.check
966 %{ address output.nonnull
967 % format.date "year" output.check
969 % organization output
976 { format.incoll.inproc.crossref output.nonnull
987 FUNCTION {conference} { inproceedings }
992 { organization empty$
994 { organization output.nonnull
999 { format.authors output.nonnull }
1002 format.btitle "title" output.check
1004 format.edition output
1007 { organization empty$
1008 { address new.block.checka
1014 { organization address new.block.checkb
1027 FUNCTION {mastersthesis}
1029 format.authors "author" output.check
1031 format.title "title" output.check
1033 "Diss." format.thesis.type output.nonnull
1034 after.title 'output.state :=
1035 school "school" output.check
1037 format.date "year" output.check
1047 format.authors output
1048 title howpublished new.block.checkb
1051 %howpublished new.block.checka
1062 FUNCTION {phdthesis}
1064 format.authors "author" output.check
1066 format.btitle "title" output.check
1068 "Diss." format.thesis.type output.nonnull
1069 after.title 'output.state :=
1070 school "school" output.check
1072 format.date "year" output.check
1080 FUNCTION {proceedings}
1083 { organization output }
1084 { format.editors output.nonnull }
1087 format.btitle "title" output.check
1089 format.bvolume.or.num.series output
1092 { publisher new.sentence.checka }
1093 { organization publisher new.sentence.checkb
1098 format.date "year" output.check
1100 { address output.nonnull
1101 format.date "year" output.check
1105 { organization output }
1117 FUNCTION {techreport}
1119 format.authors "author" output.check
1121 format.title "title" output.check
1123 format.tr.number output.nonnull
1124 institution "institution" output.check
1126 format.date "year" output.check
1132 FUNCTION {unpublished}
1134 format.authors "author" output.check
1136 format.title "title" output.check
1140 note "note" output.check
1145 FUNCTION {default.type} { misc }
1147 MACRO {jan} {"Jan."}
1149 MACRO {feb} {"Feb."}
1151 MACRO {mar} {"Mar."}
1153 MACRO {apr} {"Apr."}
1157 MACRO {jun} {"June"}
1159 MACRO {jul} {"July"}
1161 MACRO {aug} {"Aug."}
1163 MACRO {sep} {"Sept."}
1165 MACRO {oct} {"Oct."}
1167 MACRO {nov} {"Nov."}
1169 MACRO {dec} {"Dec."}
1171 MACRO {acmcs} {"ACM Computing Surveys"}
1173 MACRO {acta} {"Acta Informatica"}
1175 MACRO {cacm} {"Communications of the ACM"}
1177 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1179 MACRO {ibmsj} {"IBM Systems Journal"}
1181 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1183 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1186 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1188 MACRO {ipl} {"Information Processing Letters"}
1190 MACRO {jacm} {"Journal of the ACM"}
1192 MACRO {jcss} {"Journal of Computer and System Sciences"}
1194 MACRO {scp} {"Science of Computer Programming"}
1196 MACRO {sicomp} {"SIAM Journal on Computing"}
1198 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1200 MACRO {tods} {"ACM Transactions on Database Systems"}
1202 MACRO {tog} {"ACM Transactions on Graphics"}
1204 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1206 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1208 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1210 MACRO {tcs} {"Theoretical Computer Science"}
1221 FUNCTION {chop.word}
1224 s #1 len substring$ =
1225 { s len #1 + global.max$ substring$ }
1230 FUNCTION {sort.format.names}
1234 s num.names$ 'numnames :=
1235 numnames 'namesleft :=
1241 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1242 nameptr numnames = t "others" = and
1246 nameptr #1 + 'nameptr :=
1247 namesleft #1 - 'namesleft :=
1252 FUNCTION {sort.format.title}
1256 "The " #4 t chop.word
1260 #1 global.max$ substring$
1263 FUNCTION {author.sort}
1266 { "to sort, need author or key in " cite$ * warning$
1272 { author sort.format.names }
1276 FUNCTION {author.editor.sort}
1280 { "to sort, need author, editor, or key in " cite$ * warning$
1286 { editor sort.format.names }
1289 { author sort.format.names }
1293 FUNCTION {author.organization.sort}
1295 { organization empty$
1297 { "to sort, need author, organization, or key in " cite$ * warning$
1303 { "The " #4 organization chop.word sortify }
1306 { author sort.format.names }
1310 FUNCTION {editor.organization.sort}
1312 { organization empty$
1314 { "to sort, need editor, organization, or key in " cite$ * warning$
1320 { "The " #4 organization chop.word sortify }
1323 { editor sort.format.names }
1332 { type$ "proceedings" =
1333 'editor.organization.sort
1335 'author.organization.sort
1342 duplicate$ empty$ 'skip$ { " " * } if$
1344 { title field.or.null sort.format.title * " " * booktitle field.or.null sort.format.title * }
1349 year field.or.null sortify
1351 #1 entry.max$ substring$
1362 FUNCTION {init.vars}
1363 { #0 int.to.chr$ 'a :=
1364 #0 int.to.chr$ 'b :=
1369 FUNCTION {forward.author.dup.check}
1371 url empty$ 'skip$ { url.used #1 + 'url.used := } if$
1372 crossref empty$ 'skip$ { citen.used #1 + 'citen.used := } if$
1374 { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
1380 { b "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$
1381 a "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$ =
1382 { #1 'author.duplicate := }
1383 { #0 'author.duplicate := }
1390 FUNCTION {forward.author.share.check}
1392 % Pass through all entries, comparing current author to last one.
1394 { author.duplicate author empty$ or
1395 { author.duplicate { i 'author.shared := }{} if$}
1396 { b "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$
1397 author field.or.null "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$ =
1398 { author.flast 'author.shared := }
1399 { b "{vv~}{ll}" format.names.custom purify$
1400 author field.or.null "{vv~}{ll}" format.names.custom purify$ =
1401 { author.last 'author.shared := }
1402 { author.different 'author.shared := }
1407 author field.or.null 'b :=
1412 FUNCTION {reverse.author}
1416 { i 'author.shared := }
1421 { author.shared i 'author.shared := 'i := }
1422 { author.shared 'i := }
1426 j #1 = author.duplicate not and { #2 'author.duplicate := } {} if$
1427 author.duplicate 'j :=
1430 EXECUTE {init.consts}
1433 ITERATE {forward.author.dup.check}
1436 ITERATE {forward.author.share.check}
1439 REVERSE {reverse.author}
1441 %INTEGERS { number.label longest.label.width }
1443 %FUNCTION {initialize.longest.label}
1444 %{ "" 'longest.label :=
1445 % #1 'number.label :=
1446 % #0 'longest.label.width :=
1449 %FUNCTION {longest.label.pass}
1450 %{ number.label int.to.str$ 'label :=
1451 % number.label #1 + 'number.label :=
1452 % label width$ longest.label.width >
1453 % { label 'longest.label :=
1454 % label width$ 'longest.label.width :=
1460 %EXECUTE {initialize.longest.label}
1462 %ITERATE {longest.label.pass}
1464 FUNCTION {begin.bib}
1467 { "\ifx\undefined\citeN\let\citeN\cite\fi" write$ newline$ }
1471 { "\ifx\undefined\url\let\url\relax\fi" write$ newline$ }
1476 { preamble$ write$ newline$ }
1478 "\begin{thebibliography}{\rule{.5in}{0pt}}" write$ newline$
1483 ITERATE {call.type$}
1487 "\end{thebibliography}" write$ newline$