1 % BibTeX bibliography style `mlastyle'
2 % Based on BibTeX standard bibliography style `plain'
3 % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
4 % Copyright (C) 1985, all rights reserved.
5 % Copying of this file is authorized only if either
6 % (1) you make absolutely no changes to your copy, including name, or
7 % (2) if you do make changes, you name it something other than
8 % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
9 % This restriction helps ensure that all standard styles are identical.
10 % The file btxbst.doc has the documentation for this style.
41 { author.duplicate author.shared }
44 INTEGERS { output.state before.all mid.sentence after.sentence after.block after.title author.different author.last author.flast citealt.used url.used }
46 % Rearranged such that true values require capital letters
47 FUNCTION {init.consts}
54 #0 'author.different :=
57 %#3 'author.firstlast :=
63 STRINGS { s t u } % Added u
65 % Puts the period inside any quotes
68 duplicate$ #-1 #3 substring$ "'''" =
69 { duplicate$ text.length$ #3 - text.prefix$ add.period$ "'\thinspace''" * }
70 { duplicate$ #-1 #3 substring$ "''}" =
71 { #2 global.max$ substring$ duplicate$
72 text.length$ #2 - text.prefix$ add.period$ "{" swap$ * "''}" * }
73 { duplicate$ #-1 #2 substring$ "''" =
74 { duplicate$ text.length$ #2 - text.prefix$ add.period$ "''" * }
83 % Switched to do.period and added after.title
84 FUNCTION {output.nonnull}
86 output.state mid.sentence =
88 { output.state after.block =
93 { output.state before.all =
95 { output.state after.title =
97 { do.period " " * write$ }
103 mid.sentence 'output.state :=
116 FUNCTION {output.check}
119 { pop$ "empty " t * " in " * cite$ * warning$ }
124 % Switched to do.period
132 { output.state before.all =
134 { after.block 'output.state := }
138 FUNCTION {new.sentence}
139 { output.state after.block =
141 { output.state before.all =
143 { after.sentence 'output.state := }
150 %{ output.state after.block =
152 % { output.state before.all =
154 % { after.title 'output.state := }
178 FUNCTION {new.block.checka}
185 FUNCTION {new.block.checkb}
194 FUNCTION {new.sentence.checka}
201 FUNCTION {new.sentence.checkb}
210 FUNCTION {field.or.null}
220 { "{\em " swap$ * "}" * }
224 INTEGERS { nameptr namesleft numnames }
226 FUNCTION {format.names.custom}
230 s num.names$ 'numnames :=
231 numnames 'namesleft :=
233 { s nameptr u format.name$ 't :=
250 nameptr #1 + 'nameptr :=
251 namesleft #1 - 'namesleft :=
256 FUNCTION {format.names}
257 { "{ff~}{vv~}{ll}{, jj}" format.names.custom }
259 % Changed first author to last name first
260 FUNCTION {format.names.beginning}
263 s num.names$ 'numnames :=
264 numnames 'namesleft :=
267 { s nameptr "{vv~}{ll}{, ff}{, jj}" format.name$
268 duplicate$ #1 #1 substring$ "u" change.case$ swap$
269 duplicate$ #-1 swap$ text.length$ #1 - substring$ * 't := }
270 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := }
288 nameptr #1 + 'nameptr :=
289 namesleft #1 - 'namesleft :=
294 % Added check for duplicate authors
295 FUNCTION {format.authors}
298 { author.duplicate #1 =
300 { author format.names.beginning }
306 % Changed to MLA editor abbreviations
307 % author.duplicate also applies
308 FUNCTION {format.editors}
311 { author empty$ author.duplicate #1 = and
313 { editor format.names.beginning }
315 editor num.names$ #1 >
323 FUNCTION {format.editors.mid}
327 editor num.names$ #1 >
331 editor format.names *
336 % Formats the address and publisher
337 FUNCTION {format.publisher}
340 { address ": " * publisher * }
344 % Changed to preserve case and use quotes
345 FUNCTION {format.title}
348 { title #1 text.prefix$ "`" =
349 { "``\thinspace" title * "''" * }
350 { "``" title * "''" *}
360 { t #1 #1 substring$ "-" =
361 { t #1 #2 substring$ "--" = not
363 t #2 global.max$ substring$ 't :=
365 { { t #1 #1 substring$ "-" = }
367 t #2 global.max$ substring$ 't :=
373 { t #1 #1 substring$ *
374 t #2 global.max$ substring$ 't :=
381 FUNCTION {format.date}
385 { "there's a month but no year in " cite$ * warning$
392 { month "~" * year * }
398 FUNCTION {format.btitle}
402 FUNCTION {tie.or.space.connect}
403 { duplicate$ text.length$ #3 <
410 FUNCTION {either.or.check}
413 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
417 FUNCTION {format.bvolume.or.num.series}
420 { series field.or.null }
423 { number "there's a number but no series in " cite$ * warning$ }
425 %output.state mid.sentence =
429 number tie.or.space.connect
435 { "Vol." volume tie.or.space.connect
438 { " of " * series emphasize * add.period$ }
442 { number * " vols." * }
444 %"volume and number" number either.or.check
449 FUNCTION {format.number.series}
456 % Changed edition to MLA abbreviation
457 FUNCTION {format.edition}
461 { "Vers.~" version *}
464 { edition "l" change.case$ 's := edition 't :=
466 "10th" "tenth" "9th" "ninth" "8th" "eighth" "7th" "seventh" "6th" "sixth"
467 "5th" "fifth" "4th" "fourth" "3rd" "third" "2nd" "second" "1st" "first"
468 {duplicate$ empty$ { pop$ #0 }{ #1 } if$ }{ s = { 't := }{ pop$ } if$ }
471 "edition and version" version either.or.check
476 INTEGERS { multiresult }
478 FUNCTION {multi.page.check}
487 swap$ duplicate$ "," =
490 { #1 'multiresult := }
491 { t #2 global.max$ substring$ 't := }
498 FUNCTION {format.pages}
501 { %pages multi.page.check
502 % { "pages" pages n.dashify tie.or.space.connect }
503 % { "page" pages tie.or.space.connect }
510 FUNCTION {format.vol.num.year.pages}
514 { "there's a number but no volume in " cite$ * warning$ }
523 " (" * format.date * ")" *
528 { ", " * format.edition * }
532 { ": " * pages n.dashify * }
537 FUNCTION {format.vol.num.pages}
538 { volume field.or.null
541 { "(" number * ")" * *
543 { "there's a number but no volume in " cite$ * warning$ }
551 { pop$ format.pages }
552 { ":" * pages n.dashify * }
558 % chapter might be useful if type is set to "pars."
559 FUNCTION {format.chapter.pages}
564 { type "t" change.case$ }
566 chapter n.dashify tie.or.space.connect
569 { ", " * format.pages * }
575 FUNCTION {format.in.ed.booktitle}
579 { "In " booktitle emphasize * }
580 { booktitle emphasize add.period$ format.editors.mid * }
586 FUNCTION {empty.misc.check}
587 { author empty$ title empty$ howpublished empty$
588 month empty$ year empty$ note empty$
591 { "all relevant fields are empty in " cite$ * warning$ }
596 FUNCTION {format.thesis.type}
600 type "t" change.case$
605 FUNCTION {format.tr.number}
607 { "Technical Report" }
612 { number tie.or.space.connect }
616 FUNCTION {format.url}
620 { "There's a url but no accessdate in " cite$ * warning$ "" }
623 "$<$\url{" * url * "}$>$" *
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$ { " \citealt" } { " \citealt[" format.chapter.pages * "]" * } if$
645 "{" * crossref * "}" *
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$ { " \citealt" } { " \citealt[" format.chapter.pages * "]" * } if$
691 "{" * crossref * "}" *
694 FUNCTION {format.incoll.inproc.crossref}
696 % editor field.or.null author field.or.null =
700 % { "need editor, key, or booktitle for " cite$ * " to crossref " *
701 % crossref * warning$
704 % { "In {\em " booktitle * "\/}" * }
710 % { "In " format.crossref.editor * }
712 pages empty$ { " \citealt" } { " \citealt[" format.chapter.pages * "]" * } if$
713 "{" * crossref * "}" *
716 FUNCTION {cite.title}
717 { title empty$ journal empty$ not and
718 { key empty$ { journal }{ key } if$ emphasize }
719 { title empty$ key empty$ and
720 { "empty title and key in " cite$ * warning$ "" }
721 { key empty$ {title}{key} if$
726 type$ "proceedings" =
731 type$ "incollection" =
732 type$ "inproceedings" =
733 type$ "mastersthesis" =
736 type$ "unpublished" =
738 {"``" swap$ * "''" * }
749 FUNCTION {cite.label}
752 % { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
767 author.shared author.different =
768 { "{vv~}{ll}" format.names.custom }
769 { author.shared author.last =
770 { "{f.~}{vv~}{ll}{, jj}" format.names.custom }
771 { author.shared author.flast =
772 { "{ff~}{vv~}{ll}{, jj}" format.names.custom }
773 { "{vv~}{ll}" format.names.custom ", " * cite.title * }
779 author.duplicate { "(" * cite.title * ")" }{ "( )" * } if$
790 FUNCTION {output.bibitem}
799 before.all 'output.state :=
804 format.authors "author" output.check
806 format.title "title" output.check
809 { journal emphasize "journal" output.check after.title 'output.state :=
810 %format.date "year" output.check
812 format.vol.num.year.pages output
814 { format.article.crossref output.nonnull
828 { format.editors "author and editor" output.check }
829 { format.authors output.nonnull }
832 format.btitle "title" output.check
835 { author empty$ 'skip$ { format.editors.mid output new.sentence } if$
836 format.edition output
838 format.bvolume.or.num.series output
840 format.publisher "publisher" output.check
841 format.date "year" output.check
843 {% format.date "year" output
845 format.book.crossref output.nonnull
857 format.authors output
859 format.title "title" output.check
860 howpublished address new.block.checkb
872 { format.editors "author and editor" output.check }
873 { format.authors output.nonnull }
876 format.btitle "title" output.check
879 { author empty$ 'skip$ { format.editors.mid output new.sentence } if$
880 format.edition output
882 format.bvolume.or.num.series output
884 format.publisher "publisher" output.check
885 format.date "year" output.check
887 format.chapter.pages "chapter and pages" output.check
890 {% format.chapter.pages "chapter and pages" output.check
892 format.book.crossref output.nonnull
901 FUNCTION {incollection}
903 format.authors "author" output.check
905 { new.block type output }
909 format.title "title" output.check
913 booktitle emphasize "booktitle" output.check
915 format.editors.mid "editor" output.check
917 format.edition output
919 format.bvolume.or.num.series output
921 format.publisher "publisher" output.check
923 format.date "year" output.check
925 format.chapter.pages output
927 { format.incoll.inproc.crossref output.nonnull
928 %format.chapter.pages output
938 FUNCTION {inproceedings}
940 format.authors "author" output.check
942 format.title "title" output.check
945 { %format.in.ed.booktitle "booktitle" output.check
946 booktitle "booktitle" output.check
948 format.editors.mid output
950 format.edition output
952 format.bvolume.or.num.series output
954 format.edition output
956 format.publisher output
957 format.date "year" output.check
959 %{ organization publisher new.sentence.checkb
960 % organization output
962 % format.date "year" output.check
964 %{ address output.nonnull
965 % format.date "year" output.check
967 % organization output
974 { format.incoll.inproc.crossref output.nonnull
985 FUNCTION {conference} { inproceedings }
990 { organization empty$
992 { organization output.nonnull
997 { format.authors output.nonnull }
1000 format.btitle "title" output.check
1002 format.edition output
1005 { organization empty$
1006 { address new.block.checka
1012 { organization address new.block.checkb
1025 FUNCTION {mastersthesis}
1027 format.authors "author" output.check
1029 format.title "title" output.check
1031 "Diss." format.thesis.type output.nonnull
1032 after.title 'output.state :=
1033 school "school" output.check
1035 format.date "year" output.check
1045 format.authors output
1046 title howpublished new.block.checkb
1049 %howpublished new.block.checka
1060 FUNCTION {phdthesis}
1062 format.authors "author" output.check
1064 format.btitle "title" output.check
1066 "Diss." format.thesis.type output.nonnull
1067 after.title 'output.state :=
1068 school "school" output.check
1070 format.date "year" output.check
1078 FUNCTION {proceedings}
1081 { organization output }
1082 { format.editors output.nonnull }
1085 format.btitle "title" output.check
1087 format.bvolume.or.num.series output
1090 { publisher new.sentence.checka }
1091 { organization publisher new.sentence.checkb
1096 format.date "year" output.check
1098 { address output.nonnull
1099 format.date "year" output.check
1103 { organization output }
1115 FUNCTION {techreport}
1117 format.authors "author" output.check
1119 format.title "title" output.check
1121 format.tr.number output.nonnull
1122 institution "institution" output.check
1124 format.date "year" output.check
1130 FUNCTION {unpublished}
1132 format.authors "author" output.check
1134 format.title "title" output.check
1138 note "note" output.check
1143 FUNCTION {default.type} { misc }
1145 MACRO {jan} {"Jan."}
1147 MACRO {feb} {"Feb."}
1149 MACRO {mar} {"Mar."}
1151 MACRO {apr} {"Apr."}
1155 MACRO {jun} {"June"}
1157 MACRO {jul} {"July"}
1159 MACRO {aug} {"Aug."}
1161 MACRO {sep} {"Sept."}
1163 MACRO {oct} {"Oct."}
1165 MACRO {nov} {"Nov."}
1167 MACRO {dec} {"Dec."}
1169 MACRO {acmcs} {"ACM Computing Surveys"}
1171 MACRO {acta} {"Acta Informatica"}
1173 MACRO {cacm} {"Communications of the ACM"}
1175 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1177 MACRO {ibmsj} {"IBM Systems Journal"}
1179 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1181 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1184 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1186 MACRO {ipl} {"Information Processing Letters"}
1188 MACRO {jacm} {"Journal of the ACM"}
1190 MACRO {jcss} {"Journal of Computer and System Sciences"}
1192 MACRO {scp} {"Science of Computer Programming"}
1194 MACRO {sicomp} {"SIAM Journal on Computing"}
1196 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1198 MACRO {tods} {"ACM Transactions on Database Systems"}
1200 MACRO {tog} {"ACM Transactions on Graphics"}
1202 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1204 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1206 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1208 MACRO {tcs} {"Theoretical Computer Science"}
1219 FUNCTION {chop.word}
1222 s #1 len substring$ =
1223 { s len #1 + global.max$ substring$ }
1228 FUNCTION {sort.format.names}
1232 s num.names$ 'numnames :=
1233 numnames 'namesleft :=
1239 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1240 nameptr numnames = t "others" = and
1244 nameptr #1 + 'nameptr :=
1245 namesleft #1 - 'namesleft :=
1250 FUNCTION {sort.format.title}
1254 "The " #4 t chop.word
1258 #1 global.max$ substring$
1261 FUNCTION {author.sort}
1264 { "to sort, need author or key in " cite$ * warning$
1270 { author sort.format.names }
1274 FUNCTION {author.editor.sort}
1278 { "to sort, need author, editor, or key in " cite$ * warning$
1284 { editor sort.format.names }
1287 { author sort.format.names }
1291 FUNCTION {author.organization.sort}
1293 { organization empty$
1295 { "to sort, need author, organization, or key in " cite$ * warning$
1301 { "The " #4 organization chop.word sortify }
1304 { author sort.format.names }
1308 FUNCTION {editor.organization.sort}
1310 { organization empty$
1312 { "to sort, need editor, organization, or key in " cite$ * warning$
1318 { "The " #4 organization chop.word sortify }
1321 { editor sort.format.names }
1330 { type$ "proceedings" =
1331 'editor.organization.sort
1333 'author.organization.sort
1340 duplicate$ empty$ 'skip$ { " " * } if$
1342 { title field.or.null sort.format.title * " " * booktitle field.or.null sort.format.title * }
1347 year field.or.null sortify
1349 #1 entry.max$ substring$
1360 FUNCTION {init.vars}
1361 { #0 int.to.chr$ 'a :=
1362 #0 int.to.chr$ 'b :=
1367 FUNCTION {forward.author.dup.check}
1369 url empty$ 'skip$ { url.used #1 + 'url.used := } if$
1370 crossref empty$ 'skip$ { citealt.used #1 + 'citealt.used := } if$
1372 { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
1378 { b "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$
1379 a "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$ =
1380 { #1 'author.duplicate := }
1381 { #0 'author.duplicate := }
1388 FUNCTION {forward.author.share.check}
1390 % Pass through all entries, comparing current author to last one.
1392 { author.duplicate author empty$ or
1393 { author.duplicate { i 'author.shared := }{} if$}
1394 { b "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$
1395 author field.or.null "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$ =
1396 { author.flast 'author.shared := }
1397 { b "{vv~}{ll}" format.names.custom purify$
1398 author field.or.null "{vv~}{ll}" format.names.custom purify$ =
1399 { author.last 'author.shared := }
1400 { author.different 'author.shared := }
1405 author field.or.null 'b :=
1410 FUNCTION {reverse.author}
1414 { i 'author.shared := }
1419 { author.shared i 'author.shared := 'i := }
1420 { author.shared 'i := }
1424 j #1 = author.duplicate not and { #2 'author.duplicate := } {} if$
1425 author.duplicate 'j :=
1428 EXECUTE {init.consts}
1431 ITERATE {forward.author.dup.check}
1434 ITERATE {forward.author.share.check}
1437 REVERSE {reverse.author}
1439 %INTEGERS { number.label longest.label.width }
1441 %FUNCTION {initialize.longest.label}
1442 %{ "" 'longest.label :=
1443 % #1 'number.label :=
1444 % #0 'longest.label.width :=
1447 %FUNCTION {longest.label.pass}
1448 %{ number.label int.to.str$ 'label :=
1449 % number.label #1 + 'number.label :=
1450 % label width$ longest.label.width >
1451 % { label 'longest.label :=
1452 % label width$ 'longest.label.width :=
1458 %EXECUTE {initialize.longest.label}
1460 %ITERATE {longest.label.pass}
1462 FUNCTION {begin.bib}
1465 { "\ifx\undefined\citealt\let\citealt\cite\fi" write$ newline$ }
1469 { "\ifx\undefined\url\let\url\relax\fi" write$ newline$ }
1474 { preamble$ write$ newline$ }
1476 "\begin{thebibliography}{\rule{.5in}{0pt}}" write$ newline$
1481 ITERATE {call.type$}
1485 "\end{thebibliography}" write$ newline$