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 citealp.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 { "\emph{" 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$ { "\citealp" } { "\citealp[" 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$ { "\citealp" } { "\citealp[" 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$ { "\citealp" } { "\citealp[" 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$}
765 { cite.title * "( \ \ \ \ \unskip\unskip\unskip\unskip\unskip \unskip)" * }
767 author.shared author.different =
768 { "{vv~}{ll}" format.names.custom 's := }
769 { author.shared author.last =
770 { "{f.~}{vv~}{ll}{, jj}" format.names.custom 's := }
771 { author.shared author.flast =
772 { "{ff~}{vv~}{ll}{, jj}" format.names.custom 's := }
773 { "{vv~}{ll}" format.names.custom ", " * cite.title * 's := "WTF" warning$ }
780 "( \ \ \ \ \unskip\unskip\unskip\unskip\unskip " *
781 author.duplicate { cite.title * }{ "\unskip" * } if$
782 ")" * swap$ "{ff~}{vv~}{ll}{, jj}" format.names.custom *
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.block } 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.block } 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}
1372 url empty$ 'skip$ { url.used #1 + 'url.used := } if$
1373 crossref empty$ 'skip$ { citealp.used #1 + 'citealp.used := } if$
1375 { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
1381 { b "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$
1382 a "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$ =
1383 { #1 'author.duplicate := }
1384 { #0 'author.duplicate := }
1391 FUNCTION {forward.author.share.check}
1393 % Pass through all entries, comparing current author to last one.
1395 { author.duplicate author empty$ or
1396 { author.duplicate { i 'author.shared := }{} if$}
1397 { b "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$
1398 author field.or.null "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$ =
1399 { author.flast 'author.shared := }
1400 { b "{vv~}{ll}" format.names.custom purify$
1401 author field.or.null "{vv~}{ll}" format.names.custom purify$ =
1402 { author.last 'author.shared := }
1403 { author.different 'author.shared := }
1408 author field.or.null 'b :=
1413 FUNCTION {reverse.author}
1417 { i 'author.shared := }
1422 { author.shared i 'author.shared := 'i := }
1423 { author.shared 'i := }
1427 j #1 = author.duplicate not and { #2 'author.duplicate := } {} if$
1428 author.duplicate 'j :=
1431 EXECUTE {init.consts}
1434 ITERATE {forward.author.dup.check}
1437 ITERATE {forward.author.share.check}
1440 REVERSE {reverse.author}
1442 %INTEGERS { number.label longest.label.width }
1444 %FUNCTION {initialize.longest.label}
1445 %{ "" 'longest.label :=
1446 % #1 'number.label :=
1447 % #0 'longest.label.width :=
1450 %FUNCTION {longest.label.pass}
1451 %{ number.label int.to.str$ 'label :=
1452 % number.label #1 + 'number.label :=
1453 % label width$ longest.label.width >
1454 % { label 'longest.label :=
1455 % label width$ 'longest.label.width :=
1461 %EXECUTE {initialize.longest.label}
1463 %ITERATE {longest.label.pass}
1465 FUNCTION {begin.bib}
1468 { "\expandafter\ifx\csname citealp\endcsname\relax\let\citealp\cite\fi"
1473 { "\expandafter\ifx\csname citealp\endcsname\relax\url\let\url\relax\fi"
1479 { preamble$ write$ newline$ }
1481 "\begin{thebibliography}{\rule{.5in}{0pt}}" write$ newline$
1486 ITERATE {call.type$}
1490 "\end{thebibliography}" write$ newline$