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 STRINGS { s t u empty.title }
48 % Rearranged such that true values require capital letters
49 FUNCTION {init.consts}
56 #0 'author.different :=
59 %#3 'author.firstlast :=
63 " \ \ \ \ \unskip\unskip\unskip\unskip\unskip " 'empty.title :=
86 % text.length$ does not include braces
87 % ...this is probably unnecessary
91 { duplicate$ duplicate$ #1 chars substring$ = not }
92 { duplicate$ duplicate$ text.length$ swap$ #1 chars
93 substring$ text.length$ - chars + #1 + 'chars := }
95 { duplicate$ duplicate$ #1 chars #1 - substring$ = }
96 { chars #1 - 'chars := }
101 % Puts the period inside any quotes
104 duplicate$ #-1 #2 substring$ "''" =
106 { duplicate$ #-1 i - #11 substring$ "'\thinspace" = }
109 duplicate$ #-1 i - global.max$ substring$
110 add.period$ swap$ #-1 i substring$ *
113 duplicate$ #-1 #3 substring$ "''}" =
115 { duplicate$ #-1 i - #11 substring$ "'\thinspace" = }
118 duplicate$ #-1 i - global.max$ substring$
119 add.period$ swap$ #-1 i substring$ *
127 % Switched to do.period and added after.title
128 FUNCTION {output.nonnull}
130 output.state mid.sentence =
132 { output.state after.block =
137 { output.state before.all =
139 { output.state after.title =
141 { do.period " " * write$ }
147 mid.sentence 'output.state :=
160 FUNCTION {output.check}
163 { pop$ "empty " t * " in " * cite$ * warning$ }
168 % Switched to do.period
176 { output.state before.all =
178 { after.block 'output.state := }
182 FUNCTION {new.sentence}
183 { output.state after.block =
185 { output.state before.all =
187 { after.sentence 'output.state := }
194 %{ output.state after.block =
196 % { output.state before.all =
198 % { after.title 'output.state := }
204 FUNCTION {new.block.checka}
211 FUNCTION {new.block.checkb}
220 FUNCTION {new.sentence.checka}
227 FUNCTION {new.sentence.checkb}
236 FUNCTION {field.or.null}
246 { "\emph{" swap$ * "}" * }
256 { duplicate$ i #1 substring$ "" = not }
257 { duplicate$ i #1 substring$ quote$ =
258 { duplicate$ #1 i #1 - substring$ swap$
259 i #1 + global.max$ substring$
261 { swap$ duplicate$ #-1 #1 substring$ "'" =
262 { swap$ "\thinspace'" }
267 { duplicate$ #1 #1 substring$ "`" =
281 duplicate$ #1 #1 substring$ "`" =
282 { "``\thinspace" swap$ * }
285 duplicate$ #-1 #1 substring$ "'" =
293 INTEGERS { nameptr namesleft numnames }
295 FUNCTION {format.names.custom}
299 s num.names$ 'numnames :=
300 numnames 'namesleft :=
302 { s nameptr u format.name$ 't :=
319 nameptr #1 + 'nameptr :=
320 namesleft #1 - 'namesleft :=
325 FUNCTION {format.names}
326 { "{ff~}{vv~}{ll}{, jj}" format.names.custom }
328 % Changed first author to last name first
329 FUNCTION {format.names.beginning}
332 s num.names$ 'numnames :=
333 numnames 'namesleft :=
336 { s nameptr "{vv~}{ll}{, ff}{, jj}" format.name$
337 duplicate$ #1 #1 substring$ "u" change.case$ swap$
338 #2 global.max$ substring$ * 't := }
339 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := }
357 nameptr #1 + 'nameptr :=
358 namesleft #1 - 'namesleft :=
363 % Added check for duplicate authors
364 FUNCTION {format.authors}
367 { author.duplicate #1 =
369 { author format.names.beginning }
375 % Changed to MLA editor abbreviations
376 % author.duplicate also applies
377 FUNCTION {format.editors}
380 { author empty$ author.duplicate #1 = and
382 { editor format.names.beginning }
384 editor num.names$ #1 >
392 FUNCTION {format.editors.mid}
396 editor num.names$ #1 >
400 editor format.names *
405 % Formats the address and publisher
406 FUNCTION {format.publisher}
409 { address ": " * publisher * }
413 % Changed to preserve case and use quotes
414 FUNCTION {format.title}
422 { t #1 #1 substring$ "-" =
423 { t #1 #2 substring$ "--" = not
425 t #2 global.max$ substring$ 't :=
427 { { t #1 #1 substring$ "-" = }
429 t #2 global.max$ substring$ 't :=
435 { t #1 #1 substring$ *
436 t #2 global.max$ substring$ 't :=
443 FUNCTION {format.date}
447 { "there's a month but no year in " cite$ * warning$
454 { month "~" * year * }
461 FUNCTION {format.btitle}
463 %title num.chars int.to.str$ top$
465 %{ xx title num.chars < }
466 %{ title xx #1 + duplicate$ 'xx := #1 substring$ top$ } while$
469 FUNCTION {tie.or.space.connect}
470 { duplicate$ text.length$ #3 <
477 FUNCTION {either.or.check}
480 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
484 FUNCTION {format.bvolume.or.num.series}
487 { series field.or.null }
490 { number "there's a number but no series in " cite$ * warning$ }
492 %output.state mid.sentence =
496 number tie.or.space.connect
502 { "Vol." volume tie.or.space.connect
505 { " of " * series emphasize * add.period$ }
509 { number * " vols." * }
511 %"volume and number" number either.or.check
516 FUNCTION {format.number.series}
523 % Changed edition to MLA abbreviation
524 FUNCTION {format.edition}
528 { "Vers.~" version *}
531 { edition "l" change.case$ 's := edition 't :=
533 "10th" "tenth" "9th" "ninth" "8th" "eighth" "7th" "seventh" "6th" "sixth"
534 "5th" "fifth" "4th" "fourth" "3rd" "third" "2nd" "second" "1st" "first"
535 {duplicate$ empty$ { pop$ #0 }{ #1 } if$ }{ s = { 't := }{ pop$ } if$ }
538 "edition and version" version either.or.check
543 INTEGERS { multiresult }
545 FUNCTION {multi.page.check}
554 swap$ duplicate$ "," =
557 { #1 'multiresult := }
558 { t #2 global.max$ substring$ 't := }
565 FUNCTION {format.pages}
568 { %pages multi.page.check
569 % { "pages" pages n.dashify tie.or.space.connect }
570 % { "page" pages tie.or.space.connect }
577 FUNCTION {format.vol.num.year.pages}
581 { "there's a number but no volume in " cite$ * warning$ }
590 " (" * format.date * ")" *
595 { ", " * format.edition * }
599 { ": " * pages n.dashify * }
604 FUNCTION {format.vol.num.pages}
605 { volume field.or.null
608 { "(" number * ")" * *
610 { "there's a number but no volume in " cite$ * warning$ }
618 { pop$ format.pages }
619 { ":" * pages n.dashify * }
625 % chapter might be useful if type is set to "pars."
626 FUNCTION {format.chapter.pages}
631 { type "t" change.case$ }
633 chapter n.dashify tie.or.space.connect
636 { ", " * format.pages * }
642 FUNCTION {format.in.ed.booktitle}
646 { "In " booktitle emphasize * }
647 { booktitle emphasize add.period$ format.editors.mid * }
653 FUNCTION {empty.misc.check}
654 { author empty$ title empty$ howpublished empty$
655 month empty$ year empty$ note empty$
658 { "all relevant fields are empty in " cite$ * warning$ }
663 FUNCTION {format.thesis.type}
667 type "t" change.case$
672 FUNCTION {format.tr.number}
674 { "Technical Report" }
679 { number tie.or.space.connect }
683 FUNCTION {format.url}
687 { "There's a url but no accessdate in " cite$ * warning$ "" }
690 "$<$\url{" * url * "}$>$" *
693 { do.period " Path: " * urlpath * }
699 FUNCTION {format.article.crossref}
702 %{ "need key or journal for " cite$ * " to crossref " * crossref *
706 %{ "In {\em " journal * "\/}" * }
711 pages empty$ { "\citealp" } { "\citealp[" format.chapter.pages * "]" * } if$
712 "{" * crossref * "}" *
715 FUNCTION {format.crossref.editor}
716 { editor #1 "{vv~}{ll}" format.name$
717 editor num.names$ duplicate$
722 { editor #2 "{ff }{vv }{ll}{, jj}" format.name$ "others" =
724 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
732 FUNCTION {format.book.crossref}
734 % { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
737 % { "Vol." volume tie.or.space.connect add.period$
741 % editor field.or.null author field.or.null =
745 %{ "need editor, key, or series for " cite$ * " to crossref " *
746 % crossref * warning$
749 %{ "{\em " * series * "\/}" * }
755 % { format.crossref.editor * }
757 pages empty$ { "\citealp" } { "\citealp[" format.chapter.pages * "]" * } if$
758 "{" * crossref * "}" *
761 FUNCTION {format.incoll.inproc.crossref}
763 % editor field.or.null author field.or.null =
767 % { "need editor, key, or booktitle for " cite$ * " to crossref " *
768 % crossref * warning$
771 % { "In {\em " booktitle * "\/}" * }
777 % { "In " format.crossref.editor * }
779 pages empty$ { "\citealp" } { "\citealp[" format.chapter.pages * "]" * } if$
780 "{" * crossref * "}" *
783 FUNCTION {cite.title}
784 { title empty$ journal empty$ not and
785 { key empty$ { journal }{ key } if$ emphasize }
786 { title empty$ key empty$ and
787 { "empty title and key in " cite$ * warning$ "" }
788 { key empty$ {title}{key} if$
793 type$ "proceedings" =
798 type$ "incollection" =
799 type$ "inproceedings" =
800 type$ "mastersthesis" =
803 type$ "unpublished" =
816 FUNCTION {cite.label}
819 % { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
833 "(" * empty.title * ")" * }
835 author.shared author.different =
836 { "{vv~}{ll}" format.names.custom 's := }
837 { author.shared author.last =
838 { "{f.~}{vv~}{ll}{, jj}" format.names.custom 's := }
839 { author.shared author.flast =
840 { "{ff~}{vv~}{ll}{, jj}" format.names.custom 's := }
841 { "{vv~}{ll}" format.names.custom ", " * cite.title * 's := "WTF" warning$ }
849 author.duplicate { cite.title * }{} if$
850 ")" * swap$ "{ff~}{vv~}{ll}{, jj}" format.names.custom *
861 FUNCTION {output.bibitem}
870 before.all 'output.state :=
875 format.authors "author" output.check
877 format.title "title" output.check
880 { journal emphasize "journal" output.check after.title 'output.state :=
881 address empty$ skip$ { "[" address * "]" * output } if$
882 %format.date "year" output.check
884 format.vol.num.year.pages output
886 { format.article.crossref output.nonnull
900 { format.editors "author and editor" output.check }
901 { format.authors output.nonnull }
904 format.btitle "title" output.check
907 { author empty$ 'skip$ { format.editors.mid output new.block } if$
908 format.edition output
910 format.bvolume.or.num.series output
912 format.publisher "publisher" output.check
913 format.date "year" output.check
915 {% format.date "year" output
917 format.book.crossref output.nonnull
929 format.authors output
931 format.title "title" output.check
932 howpublished address new.block.checkb
944 { format.editors "author and editor" output.check }
945 { format.authors output.nonnull }
948 format.btitle "title" output.check
951 { author empty$ 'skip$ { format.editors.mid output new.block } if$
952 format.edition output
954 format.bvolume.or.num.series output
956 format.publisher "publisher" output.check
957 format.date "year" output.check
959 format.chapter.pages "chapter and pages" output.check
962 {% format.chapter.pages "chapter and pages" output.check
964 format.book.crossref output.nonnull
973 FUNCTION {incollection}
975 format.authors "author" output.check
977 { new.block type output }
981 format.title "title" output.check
985 booktitle emphasize "booktitle" output.check
987 format.editors.mid "editor" output.check
989 format.edition output
991 format.bvolume.or.num.series output
993 format.publisher "publisher" output.check
995 format.date "year" output.check
997 format.chapter.pages output
999 { format.incoll.inproc.crossref output.nonnull
1000 %format.chapter.pages output
1010 FUNCTION {inproceedings}
1012 format.authors "author" output.check
1014 format.title "title" output.check
1017 { %format.in.ed.booktitle "booktitle" output.check
1018 booktitle "booktitle" output.check
1020 format.editors.mid output
1022 format.edition output
1024 format.bvolume.or.num.series output
1026 format.edition output
1028 format.publisher output
1029 format.date "year" output.check
1031 %{ organization publisher new.sentence.checkb
1032 % organization output
1034 % format.date "year" output.check
1036 %{ address output.nonnull
1037 % format.date "year" output.check
1039 % organization output
1046 { format.incoll.inproc.crossref output.nonnull
1047 %format.pages output
1057 FUNCTION {conference} { inproceedings }
1062 { organization empty$
1064 { organization output.nonnull
1069 { format.authors output.nonnull }
1072 format.btitle "title" output.check
1074 format.edition output
1077 { organization empty$
1078 { address new.block.checka
1084 { organization address new.block.checkb
1097 FUNCTION {mastersthesis}
1099 format.authors "author" output.check
1101 format.title "title" output.check
1103 "Diss." format.thesis.type do.period output.nonnull
1104 after.title 'output.state :=
1105 school "school" output.check
1107 format.date "year" output.check
1117 format.authors output
1118 title howpublished new.block.checkb
1121 %howpublished new.block.checka
1132 FUNCTION {phdthesis}
1134 format.authors "author" output.check
1136 format.btitle "title" output.check
1138 "Diss." format.thesis.type do.period output.nonnull
1139 after.title 'output.state :=
1140 school "school" output.check
1142 format.date "year" output.check
1150 FUNCTION {proceedings}
1153 { organization output }
1154 { format.editors output.nonnull }
1157 format.btitle "title" output.check
1159 format.bvolume.or.num.series output
1162 { publisher new.sentence.checka }
1163 { organization publisher new.sentence.checkb
1168 format.date "year" output.check
1170 { address output.nonnull
1171 format.date "year" output.check
1175 { organization output }
1187 FUNCTION {techreport}
1189 format.authors "author" output.check
1191 format.title "title" output.check
1193 format.tr.number output.nonnull
1194 institution "institution" output.check
1196 format.date "year" output.check
1202 FUNCTION {unpublished}
1204 format.authors "author" output.check
1206 format.title "title" output.check
1210 note "note" output.check
1215 FUNCTION {default.type} { misc }
1217 MACRO {jan} {"Jan."}
1219 MACRO {feb} {"Feb."}
1221 MACRO {mar} {"Mar."}
1223 MACRO {apr} {"Apr."}
1227 MACRO {jun} {"June"}
1229 MACRO {jul} {"July"}
1231 MACRO {aug} {"Aug."}
1233 MACRO {sep} {"Sept."}
1235 MACRO {oct} {"Oct."}
1237 MACRO {nov} {"Nov."}
1239 MACRO {dec} {"Dec."}
1241 MACRO {acmcs} {"ACM Computing Surveys"}
1243 MACRO {acta} {"Acta Informatica"}
1245 MACRO {cacm} {"Communications of the ACM"}
1247 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1249 MACRO {ibmsj} {"IBM Systems Journal"}
1251 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1253 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1256 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1258 MACRO {ipl} {"Information Processing Letters"}
1260 MACRO {jacm} {"Journal of the ACM"}
1262 MACRO {jcss} {"Journal of Computer and System Sciences"}
1264 MACRO {scp} {"Science of Computer Programming"}
1266 MACRO {sicomp} {"SIAM Journal on Computing"}
1268 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1270 MACRO {tods} {"ACM Transactions on Database Systems"}
1272 MACRO {tog} {"ACM Transactions on Graphics"}
1274 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1276 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1278 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1280 MACRO {tcs} {"Theoretical Computer Science"}
1291 FUNCTION {chop.word}
1294 s #1 len substring$ =
1295 { s len #1 + global.max$ substring$ }
1300 FUNCTION {sort.format.names}
1304 s num.names$ 'numnames :=
1305 numnames 'namesleft :=
1311 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1312 nameptr numnames = t "others" = and
1316 nameptr #1 + 'nameptr :=
1317 namesleft #1 - 'namesleft :=
1322 FUNCTION {sort.format.title}
1326 "The " #4 t chop.word
1330 #1 global.max$ substring$
1333 FUNCTION {author.sort}
1336 { "to sort, need author or key in " cite$ * warning$
1342 { author sort.format.names }
1346 FUNCTION {author.editor.sort}
1350 { "to sort, need author, editor, or key in " cite$ * warning$
1356 { editor sort.format.names }
1359 { author sort.format.names }
1363 FUNCTION {author.organization.sort}
1365 { organization empty$
1367 { "to sort, need author, organization, or key in " cite$ * warning$
1373 { "The " #4 organization chop.word sortify }
1376 { author sort.format.names }
1380 FUNCTION {editor.organization.sort}
1382 { organization empty$
1384 { "to sort, need editor, organization, or key in " cite$ * warning$
1390 { "The " #4 organization chop.word sortify }
1393 { editor sort.format.names }
1402 { type$ "proceedings" =
1403 'editor.organization.sort
1405 'author.organization.sort
1412 duplicate$ empty$ 'skip$ { " " * } if$
1414 { title field.or.null sort.format.title * " " * booktitle field.or.null sort.format.title * }
1419 year field.or.null sortify
1421 #1 entry.max$ substring$
1431 FUNCTION {init.vars}
1432 { #0 int.to.chr$ 'a :=
1433 #0 int.to.chr$ 'b :=
1438 FUNCTION {forward.author.dup.check}
1440 url empty$ 'skip$ { url.used #1 + 'url.used := } if$
1441 crossref empty$ 'skip$ { citealp.used #1 + 'citealp.used := } if$
1443 { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
1449 { b "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$
1450 a "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$ =
1451 { #1 'author.duplicate := }
1452 { #0 'author.duplicate := }
1459 FUNCTION {forward.author.share.check}
1461 % Pass through all entries, comparing current author to last one.
1463 { author.duplicate author empty$ or
1464 { author.duplicate { i 'author.shared := }{} if$}
1465 { b "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$
1466 author field.or.null "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$ =
1467 { author.flast 'author.shared := }
1468 { b "{vv~}{ll}" format.names.custom purify$
1469 author field.or.null "{vv~}{ll}" format.names.custom purify$ =
1470 { author.last 'author.shared := }
1471 { author.different 'author.shared := }
1476 author field.or.null 'b :=
1481 FUNCTION {reverse.author}
1485 { i 'author.shared := }
1490 { author.shared i 'author.shared := 'i := }
1491 { author.shared 'i := }
1495 j #1 = author.duplicate not and { #2 'author.duplicate := } {} if$
1496 author.duplicate 'j :=
1499 EXECUTE {init.consts}
1502 ITERATE {forward.author.dup.check}
1505 ITERATE {forward.author.share.check}
1508 REVERSE {reverse.author}
1510 %INTEGERS { number.label longest.label.width }
1512 %FUNCTION {initialize.longest.label}
1513 %{ "" 'longest.label :=
1514 % #1 'number.label :=
1515 % #0 'longest.label.width :=
1518 %FUNCTION {longest.label.pass}
1519 %{ number.label int.to.str$ 'label :=
1520 % number.label #1 + 'number.label :=
1521 % label width$ longest.label.width >
1522 % { label 'longest.label :=
1523 % label width$ 'longest.label.width :=
1529 %EXECUTE {initialize.longest.label}
1531 %ITERATE {longest.label.pass}
1533 FUNCTION {begin.bib}
1536 { "\expandafter\ifx\csname citealp\endcsname\relax\let\citealp\cite\fi"
1541 { "\expandafter\ifx\csname citealp\endcsname\relax\url\let\url\relax\fi"
1547 { preamble$ write$ newline$ }
1549 "\begin{thebibliography}{\rule{.5in}{0pt}}" write$ newline$
1554 ITERATE {call.type$}
1558 "\end{thebibliography}" write$ newline$