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$ duplicate$ i #1 substring$ quote$ =
258 swap$ i #1 - #1 substring$ "\" = not and %"
259 { duplicate$ #1 i #1 - substring$ swap$
260 i #1 + global.max$ substring$
262 { swap$ duplicate$ #-1 #1 substring$ "'" =
263 { swap$ "\thinspace'" }
268 { duplicate$ #1 #1 substring$ "`" =
282 duplicate$ #1 #1 substring$ "`" =
283 { "``\thinspace" swap$ * }
286 duplicate$ #-1 #1 substring$ "'" =
294 INTEGERS { nameptr namesleft numnames }
296 FUNCTION {format.names.custom}
300 s num.names$ 'numnames :=
301 numnames 'namesleft :=
303 { s nameptr u format.name$ 't :=
320 nameptr #1 + 'nameptr :=
321 namesleft #1 - 'namesleft :=
326 FUNCTION {format.names}
327 { "{ff~}{vv~}{ll}{, jj}" format.names.custom }
329 % Changed first author to last name first
330 FUNCTION {format.names.beginning}
333 s num.names$ 'numnames :=
334 numnames 'namesleft :=
337 { s nameptr "{vv~}{ll}{, ff}{, jj}" format.name$
338 duplicate$ #1 #1 substring$ "u" change.case$ swap$
339 #2 global.max$ substring$ * 't := }
340 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := }
358 nameptr #1 + 'nameptr :=
359 namesleft #1 - 'namesleft :=
364 % Added check for duplicate authors
365 FUNCTION {format.authors}
368 { author.duplicate #1 =
370 { author format.names.beginning }
376 % Changed to MLA editor abbreviations
377 % author.duplicate also applies
378 FUNCTION {format.editors}
381 { author empty$ author.duplicate #1 = and
383 { editor format.names.beginning }
385 editor num.names$ #1 >
393 FUNCTION {format.editors.mid}
397 editor num.names$ #1 >
401 editor format.names *
406 % Formats the address and publisher
407 FUNCTION {format.publisher}
410 { address ": " * publisher * }
414 % Changed to preserve case and use quotes
415 FUNCTION {format.title}
423 { t #1 #1 substring$ "-" =
424 { t #1 #2 substring$ "--" = not
426 t #2 global.max$ substring$ 't :=
428 { { t #1 #1 substring$ "-" = }
430 t #2 global.max$ substring$ 't :=
436 { t #1 #1 substring$ *
437 t #2 global.max$ substring$ 't :=
444 FUNCTION {format.date}
448 { "there's a month but no year in " cite$ * warning$
455 { month "~" * year * }
462 FUNCTION {format.btitle}
464 %title num.chars int.to.str$ top$
466 %{ xx title num.chars < }
467 %{ title xx #1 + duplicate$ 'xx := #1 substring$ top$ } while$
470 FUNCTION {tie.or.space.connect}
471 { duplicate$ text.length$ #3 <
478 FUNCTION {either.or.check}
481 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
485 FUNCTION {format.bvolume.or.num.series}
488 { series field.or.null }
491 { number "there's a number but no series in " cite$ * warning$ }
493 %output.state mid.sentence =
497 number tie.or.space.connect
503 { "Vol." volume tie.or.space.connect
506 { " of " * series emphasize * add.period$ }
510 { number * " vols." * }
512 %"volume and number" number either.or.check
517 FUNCTION {format.number.series}
524 % Changed edition to MLA abbreviation
525 FUNCTION {format.edition}
529 { "Vers.~" version *}
532 { edition "l" change.case$ 's := edition 't :=
534 "10th" "tenth" "9th" "ninth" "8th" "eighth" "7th" "seventh" "6th" "sixth"
535 "5th" "fifth" "4th" "fourth" "3rd" "third" "2nd" "second" "1st" "first"
536 {duplicate$ empty$ { pop$ #0 }{ #1 } if$ }{ s = { 't := }{ pop$ } if$ }
539 "edition and version" version either.or.check
544 INTEGERS { multiresult }
546 FUNCTION {multi.page.check}
555 swap$ duplicate$ "," =
558 { #1 'multiresult := }
559 { t #2 global.max$ substring$ 't := }
566 FUNCTION {format.pages}
569 { %pages multi.page.check
570 % { "pages" pages n.dashify tie.or.space.connect }
571 % { "page" pages tie.or.space.connect }
578 FUNCTION {format.vol.num.year.pages}
582 { "there's a number but no volume in " cite$ * warning$ }
591 " (" * format.date * ")" *
596 { ", " * format.edition * }
600 { ": " * pages n.dashify * }
605 FUNCTION {format.vol.num.pages}
606 { volume field.or.null
609 { "(" number * ")" * *
611 { "there's a number but no volume in " cite$ * warning$ }
619 { pop$ format.pages }
620 { ":" * pages n.dashify * }
626 % chapter might be useful if type is set to "pars."
627 FUNCTION {format.chapter.pages}
632 { type "t" change.case$ }
634 chapter n.dashify tie.or.space.connect
637 { ", " * format.pages * }
643 FUNCTION {format.in.ed.booktitle}
647 { "In " booktitle emphasize * }
648 { booktitle emphasize add.period$ format.editors.mid * }
654 FUNCTION {empty.misc.check}
655 { author empty$ title empty$ howpublished empty$
656 month empty$ year empty$ note empty$
659 { "all relevant fields are empty in " cite$ * warning$ }
664 FUNCTION {format.thesis.type}
668 type "t" change.case$
673 FUNCTION {format.tr.number}
675 { "Technical Report" }
680 { number tie.or.space.connect }
684 FUNCTION {format.url}
688 { "There's a url but no accessdate in " cite$ * warning$ "" }
691 "$<$\url{" * url * "}$>$" *
694 { do.period " Path: " * urlpath * }
700 FUNCTION {format.article.crossref}
703 %{ "need key or journal for " cite$ * " to crossref " * crossref *
707 %{ "In {\em " journal * "\/}" * }
712 pages empty$ { "\citealp" } { "\citealp[" format.chapter.pages * "]" * } if$
713 "{" * crossref * "}" *
716 FUNCTION {format.crossref.editor}
717 { editor #1 "{vv~}{ll}" format.name$
718 editor num.names$ duplicate$
723 { editor #2 "{ff }{vv }{ll}{, jj}" format.name$ "others" =
725 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
733 FUNCTION {format.book.crossref}
735 % { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
738 % { "Vol." volume tie.or.space.connect add.period$
742 % editor field.or.null author field.or.null =
746 %{ "need editor, key, or series for " cite$ * " to crossref " *
747 % crossref * warning$
750 %{ "{\em " * series * "\/}" * }
756 % { format.crossref.editor * }
758 pages empty$ { "\citealp" } { "\citealp[" format.chapter.pages * "]" * } if$
759 "{" * crossref * "}" *
762 FUNCTION {format.incoll.inproc.crossref}
764 % editor field.or.null author field.or.null =
768 % { "need editor, key, or booktitle for " cite$ * " to crossref " *
769 % crossref * warning$
772 % { "In {\em " booktitle * "\/}" * }
778 % { "In " format.crossref.editor * }
780 pages empty$ { "\citealp" } { "\citealp[" format.chapter.pages * "]" * } if$
781 "{" * crossref * "}" *
784 FUNCTION {cite.title}
785 { title empty$ journal empty$ not and
786 { key empty$ { journal }{ key } if$ emphasize }
787 { title empty$ key empty$ and
788 { "empty title and key in " cite$ * warning$ "" }
789 { key empty$ {title}{key} if$
794 type$ "proceedings" =
799 type$ "incollection" =
800 type$ "inproceedings" =
801 type$ "mastersthesis" =
804 type$ "unpublished" =
817 FUNCTION {cite.label}
820 % { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
834 "(" * empty.title * ")" * }
836 author.shared author.different =
837 { "{vv~}{ll}" format.names.custom 's := }
838 { author.shared author.last =
839 { "{f.~}{vv~}{ll}{, jj}" format.names.custom 's := }
840 { author.shared author.flast =
841 { "{ff~}{vv~}{ll}{, jj}" format.names.custom 's := }
842 { "{vv~}{ll}" format.names.custom ", " * cite.title * 's := "WTF" warning$ }
850 author.duplicate { cite.title * }{} if$
851 ")" * swap$ "{ff~}{vv~}{ll}{, jj}" format.names.custom *
862 FUNCTION {output.bibitem}
871 before.all 'output.state :=
876 format.authors "author" output.check
878 format.title "title" output.check
881 { journal emphasize "journal" output.check after.title 'output.state :=
882 address empty$ skip$ { "[" address * "]" * output } if$
883 %format.date "year" output.check
885 format.vol.num.year.pages output
887 { format.article.crossref output.nonnull
901 { format.editors "author and editor" output.check }
902 { format.authors output.nonnull }
905 format.btitle "title" output.check
908 { author empty$ 'skip$ { format.editors.mid output new.block } if$
909 format.edition output
911 format.bvolume.or.num.series output
913 format.publisher "publisher" output.check
914 format.date "year" output.check
916 {% format.date "year" output
918 format.book.crossref output.nonnull
930 format.authors output
932 format.title "title" output.check
933 howpublished address new.block.checkb
945 { format.editors "author and editor" output.check }
946 { format.authors output.nonnull }
949 format.btitle "title" output.check
952 { author empty$ 'skip$ { format.editors.mid output new.block } if$
953 format.edition output
955 format.bvolume.or.num.series output
957 format.publisher "publisher" output.check
958 format.date "year" output.check
960 format.chapter.pages "chapter and pages" output.check
963 {% format.chapter.pages "chapter and pages" output.check
965 format.book.crossref output.nonnull
974 FUNCTION {incollection}
976 format.authors "author" output.check
978 { new.block type output }
982 format.title "title" output.check
986 booktitle emphasize "booktitle" output.check
988 format.editors.mid "editor" output.check
990 format.edition output
992 format.bvolume.or.num.series output
994 format.publisher "publisher" output.check
996 format.date "year" output.check
998 format.chapter.pages output
1000 { format.incoll.inproc.crossref output.nonnull
1001 %format.chapter.pages output
1011 FUNCTION {inproceedings}
1013 format.authors "author" output.check
1015 format.title "title" output.check
1018 { %format.in.ed.booktitle "booktitle" output.check
1019 booktitle "booktitle" output.check
1021 format.editors.mid output
1023 format.edition output
1025 format.bvolume.or.num.series output
1027 format.edition output
1029 format.publisher output
1030 format.date "year" output.check
1032 %{ organization publisher new.sentence.checkb
1033 % organization output
1035 % format.date "year" output.check
1037 %{ address output.nonnull
1038 % format.date "year" output.check
1040 % organization output
1047 { format.incoll.inproc.crossref output.nonnull
1048 %format.pages output
1058 FUNCTION {conference} { inproceedings }
1063 { organization empty$
1065 { organization output.nonnull
1070 { format.authors output.nonnull }
1073 format.btitle "title" output.check
1075 format.edition output
1078 { organization empty$
1079 { address new.block.checka
1085 { organization address new.block.checkb
1098 FUNCTION {mastersthesis}
1100 format.authors "author" output.check
1102 format.title "title" output.check
1104 "Diss." format.thesis.type do.period output.nonnull
1105 after.title 'output.state :=
1106 school "school" output.check
1108 format.date "year" output.check
1118 format.authors output
1119 title howpublished new.block.checkb
1122 %howpublished new.block.checka
1133 FUNCTION {phdthesis}
1135 format.authors "author" output.check
1137 format.btitle "title" output.check
1139 "Diss." format.thesis.type do.period output.nonnull
1140 after.title 'output.state :=
1141 school "school" output.check
1143 format.date "year" output.check
1151 FUNCTION {proceedings}
1154 { organization output }
1155 { format.editors output.nonnull }
1158 format.btitle "title" output.check
1160 format.bvolume.or.num.series output
1163 { publisher new.sentence.checka }
1164 { organization publisher new.sentence.checkb
1169 format.date "year" output.check
1171 { address output.nonnull
1172 format.date "year" output.check
1176 { organization output }
1188 FUNCTION {techreport}
1190 format.authors "author" output.check
1192 format.title "title" output.check
1194 format.tr.number output.nonnull
1195 institution "institution" output.check
1197 format.date "year" output.check
1203 FUNCTION {unpublished}
1205 format.authors "author" output.check
1207 format.title "title" output.check
1211 note "note" output.check
1216 FUNCTION {default.type} { misc }
1218 MACRO {jan} {"Jan."}
1220 MACRO {feb} {"Feb."}
1222 MACRO {mar} {"Mar."}
1224 MACRO {apr} {"Apr."}
1228 MACRO {jun} {"June"}
1230 MACRO {jul} {"July"}
1232 MACRO {aug} {"Aug."}
1234 MACRO {sep} {"Sept."}
1236 MACRO {oct} {"Oct."}
1238 MACRO {nov} {"Nov."}
1240 MACRO {dec} {"Dec."}
1242 MACRO {acmcs} {"ACM Computing Surveys"}
1244 MACRO {acta} {"Acta Informatica"}
1246 MACRO {cacm} {"Communications of the ACM"}
1248 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1250 MACRO {ibmsj} {"IBM Systems Journal"}
1252 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1254 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1257 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1259 MACRO {ipl} {"Information Processing Letters"}
1261 MACRO {jacm} {"Journal of the ACM"}
1263 MACRO {jcss} {"Journal of Computer and System Sciences"}
1265 MACRO {scp} {"Science of Computer Programming"}
1267 MACRO {sicomp} {"SIAM Journal on Computing"}
1269 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1271 MACRO {tods} {"ACM Transactions on Database Systems"}
1273 MACRO {tog} {"ACM Transactions on Graphics"}
1275 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1277 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1279 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1281 MACRO {tcs} {"Theoretical Computer Science"}
1292 FUNCTION {chop.word}
1295 s #1 len substring$ =
1296 { s len #1 + global.max$ substring$ }
1301 FUNCTION {sort.format.names}
1305 s num.names$ 'numnames :=
1306 numnames 'namesleft :=
1312 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1313 nameptr numnames = t "others" = and
1317 nameptr #1 + 'nameptr :=
1318 namesleft #1 - 'namesleft :=
1323 FUNCTION {sort.format.title}
1327 "The " #4 t chop.word
1331 #1 global.max$ substring$
1334 FUNCTION {author.sort}
1337 { "to sort, need author or key in " cite$ * warning$
1343 { author sort.format.names }
1347 FUNCTION {author.editor.sort}
1351 { "to sort, need author, editor, or key in " cite$ * warning$
1357 { editor sort.format.names }
1360 { author sort.format.names }
1364 FUNCTION {author.organization.sort}
1366 { organization empty$
1368 { "to sort, need author, organization, or key in " cite$ * warning$
1374 { "The " #4 organization chop.word sortify }
1377 { author sort.format.names }
1381 FUNCTION {editor.organization.sort}
1383 { organization empty$
1385 { "to sort, need editor, organization, or key in " cite$ * warning$
1391 { "The " #4 organization chop.word sortify }
1394 { editor sort.format.names }
1403 { type$ "proceedings" =
1404 'editor.organization.sort
1406 'author.organization.sort
1413 duplicate$ empty$ 'skip$ { " " * } if$
1415 { title field.or.null sort.format.title * " " * booktitle field.or.null sort.format.title * }
1420 year field.or.null sortify
1422 #1 entry.max$ substring$
1432 FUNCTION {init.vars}
1433 { #0 int.to.chr$ 'a :=
1434 #0 int.to.chr$ 'b :=
1439 FUNCTION {forward.author.dup.check}
1441 url empty$ 'skip$ { url.used #1 + 'url.used := } if$
1442 crossref empty$ 'skip$ { citealp.used #1 + 'citealp.used := } if$
1444 { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
1450 { b "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$
1451 a "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$ =
1452 { #1 'author.duplicate := }
1453 { #0 'author.duplicate := }
1460 FUNCTION {forward.author.share.check}
1462 % Pass through all entries, comparing current author to last one.
1464 { author.duplicate author empty$ or
1465 { author.duplicate { i 'author.shared := }{} if$}
1466 { b "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$
1467 author field.or.null "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$ =
1468 { author.flast 'author.shared := }
1469 { b "{vv~}{ll}" format.names.custom purify$
1470 author field.or.null "{vv~}{ll}" format.names.custom purify$ =
1471 { author.last 'author.shared := }
1472 { author.different 'author.shared := }
1477 author field.or.null 'b :=
1482 FUNCTION {reverse.author}
1486 { i 'author.shared := }
1491 { author.shared i 'author.shared := 'i := }
1492 { author.shared 'i := }
1496 j #1 = author.duplicate not and { #2 'author.duplicate := } {} if$
1497 author.duplicate 'j :=
1500 EXECUTE {init.consts}
1503 ITERATE {forward.author.dup.check}
1506 ITERATE {forward.author.share.check}
1509 REVERSE {reverse.author}
1511 %INTEGERS { number.label longest.label.width }
1513 %FUNCTION {initialize.longest.label}
1514 %{ "" 'longest.label :=
1515 % #1 'number.label :=
1516 % #0 'longest.label.width :=
1519 %FUNCTION {longest.label.pass}
1520 %{ number.label int.to.str$ 'label :=
1521 % number.label #1 + 'number.label :=
1522 % label width$ longest.label.width >
1523 % { label 'longest.label :=
1524 % label width$ 'longest.label.width :=
1530 %EXECUTE {initialize.longest.label}
1532 %ITERATE {longest.label.pass}
1534 FUNCTION {begin.bib}
1537 { "\expandafter\ifx\csname citealp\endcsname\relax\let\citealp\cite\fi"
1542 { "\expandafter\ifx\csname citealp\endcsname\relax\url\let\url\relax\fi"
1548 { preamble$ write$ newline$ }
1550 "\begin{thebibliography}{\rule{.5in}{0pt}}" write$ newline$
1555 ITERATE {call.type$}
1559 "\end{thebibliography}" write$ newline$