Initial revision
authorTim Pope <code@tpope.net>
Thu, 13 Nov 2003 01:59:50 +0000 (01:59 +0000)
committerTim Pope <code@tpope.net>
Thu, 13 Nov 2003 01:59:50 +0000 (01:59 +0000)
.gitignore [new file with mode: 0644]
mlastyle.bst [new file with mode: 0644]
mlastyle.dtx [new file with mode: 0644]
mlastyle.ins [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..fafa557
--- /dev/null
@@ -0,0 +1,18 @@
+*.aux
+*.bbl
+*.blg
+*.brf
+*.cb
+*.dvi
+*.ent
+*.glo
+*.gls
+*.idx
+*.ilg
+*.ind
+*.inx
+*.log
+*.pdf
+*.ps
+*.toc
+/mlastyle.sty
diff --git a/mlastyle.bst b/mlastyle.bst
new file mode 100644 (file)
index 0000000..c7b9598
--- /dev/null
@@ -0,0 +1,1429 @@
+% BibTeX standard bibliography style `plain'
+       % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
+       % Copyright (C) 1985, all rights reserved.
+       % Copying of this file is authorized only if either
+       % (1) you make absolutely no changes to your copy, including name, or
+       % (2) if you do make changes, you name it something other than
+       % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
+       % This restriction helps ensure that all standard styles are identical.
+       % The file btxbst.doc has the documentation for this style.
+
+ENTRY
+  { address
+    author
+    booktitle
+    chapter
+    edition
+    editor
+    howpublished
+    institution
+    journal
+    key
+    month
+    note
+    number
+    organization
+    pages
+    publisher
+    school
+    series
+    title
+    type
+    volume
+    year
+  }
+  { author.duplicate author.shared }
+  { label }
+
+INTEGERS { output.state before.all mid.sentence after.sentence after.block after.title author.different author.last author.flast }
+
+% Rearranged such that true values require capital letters
+FUNCTION {init.consts}
+{ #-1 'after.title :=
+  #0 'mid.sentence :=
+  #1 'before.all :=
+  #2 'after.sentence :=
+  #3 'after.block :=
+
+  #0 'author.different :=
+  #1 'author.last :=
+  #2 'author.flast :=
+  %#3 'author.firstlast :=
+}
+
+STRINGS { s t u } % Added u
+
+% Puts the period inside any quotes
+FUNCTION {do.period}
+{ 
+  duplicate$ #-1 #3 substring$ "'''" =
+    { duplicate$ text.length$ #3 - text.prefix$ add.period$ "'\thinspace''" * }
+    { duplicate$ #-1 #3 substring$ "''}" =
+       { #2 global.max$ substring$ duplicate$
+         text.length$ #2 - text.prefix$ add.period$ "{" swap$ * "''}" * }
+       { duplicate$ #-1 #2 substring$ "''" =
+           { duplicate$ text.length$ #2 - text.prefix$ add.period$ "''" * }
+           { add.period$ }
+         if$
+       }
+      if$
+    }
+  if$
+}
+
+% Switched to do.period and added after.title
+FUNCTION {output.nonnull}
+{ 's :=
+  output.state mid.sentence =
+    { ", " * write$ }
+    { output.state after.block =
+       { do.period write$
+         newline$
+         "\newblock " write$
+       }
+       { output.state before.all =
+           'write$
+           { output.state after.title =
+               { " " * write$ }
+               { do.period " " * write$ }
+             if$
+           }
+         if$
+       }
+      if$
+      mid.sentence 'output.state :=
+    }
+  if$
+  s
+}
+
+FUNCTION {output}
+{ duplicate$ empty$
+    'pop$
+    'output.nonnull
+  if$
+}
+
+FUNCTION {output.check}
+{ 't :=
+  duplicate$ empty$
+    { pop$ "empty " t * " in " * cite$ * warning$ }
+    'output.nonnull
+  if$
+}
+
+% Switched to do.period
+FUNCTION {fin.entry}
+{ do.period
+  write$
+  newline$
+}
+
+FUNCTION {new.block}
+{ output.state before.all =
+    'skip$
+    { after.block 'output.state := }
+  if$
+}
+
+FUNCTION {new.sentence}
+{ output.state after.block =
+    'skip$
+    { output.state before.all =
+       'skip$
+       { after.sentence 'output.state := }
+      if$
+    }
+  if$
+}
+
+%FUNCTION {no.comma}
+%{ output.state after.block =
+%    'skip$
+%    { output.state before.all =
+%      'skip$
+%      { after.title 'output.state := }
+%      if$
+%    }
+%  if$
+%}
+
+FUNCTION {not}
+{   { #0 }
+    { #1 }
+  if$
+}
+
+FUNCTION {and}
+{   'skip$
+    { pop$ #0 }
+  if$
+}
+
+FUNCTION {or}
+{   { pop$ #1 }
+    'skip$
+  if$
+}
+
+FUNCTION {new.block.checka}
+{ empty$
+    'skip$
+    'new.block
+  if$
+}
+
+FUNCTION {new.block.checkb}
+{ empty$
+  swap$ empty$
+  and
+    'skip$
+    'new.block
+  if$
+}
+
+FUNCTION {new.sentence.checka}
+{ empty$
+    'skip$
+    'new.sentence
+  if$
+}
+
+FUNCTION {new.sentence.checkb}
+{ empty$
+  swap$ empty$
+  and
+    'skip$
+    'new.sentence
+  if$
+}
+
+FUNCTION {field.or.null}
+{ duplicate$ empty$
+    { pop$ "" }
+    'skip$
+  if$
+}
+
+FUNCTION {emphasize}
+{ duplicate$ empty$
+    { pop$ "" }
+    { "{\em " swap$ * "}" * }
+  if$
+}
+
+INTEGERS { nameptr namesleft numnames }
+
+FUNCTION {format.names.custom}
+{ 'u :=
+  's :=
+  #1 'nameptr :=
+  s num.names$ 'numnames :=
+  numnames 'namesleft :=
+    { namesleft #0 > }
+    { s nameptr u format.name$ 't :=
+      nameptr #1 >
+       { namesleft #1 >
+           { ", " * t * }
+           { numnames #2 >
+               { "," * }
+               'skip$
+             if$
+             t "others" =
+               { " et~al." * }
+               { " and " * t * }
+             if$
+           }
+         if$
+       }
+       't
+      if$
+      nameptr #1 + 'nameptr :=
+      namesleft #1 - 'namesleft :=
+    }
+  while$
+}
+
+FUNCTION {format.names}
+{ "{ff~}{vv~}{ll}{, jj}" format.names.custom }
+
+% Changed first author to last name first
+FUNCTION {format.names.beginning}
+{ 's :=
+  #1 'nameptr :=
+  s num.names$ 'numnames :=
+  numnames 'namesleft :=
+    { namesleft #0 > }
+    { nameptr #1 =
+       { s nameptr "{vv~}{ll}{, ff}{, jj}" format.name$
+         duplicate$ #1 #1 substring$ "u" change.case$ swap$
+         duplicate$ #-1 swap$ text.length$ #1 - substring$ * 't := }
+       { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := }
+      if$
+      nameptr #1 >
+       { namesleft #1 >
+           { ", " * t * }
+           { numnames #2 >
+               { "," * }
+               'skip$
+             if$
+             t "others" =
+               { " et~al." * }
+               { " and " * t * }
+             if$
+           }
+         if$
+       }
+       't
+      if$
+      nameptr #1 + 'nameptr :=
+      namesleft #1 - 'namesleft :=
+    }
+  while$
+}
+
+% Added check for duplicate authors
+FUNCTION {format.authors}
+{ author empty$
+    { "" }
+    { author.duplicate #1 =
+       { "-{}-{}-" }
+       { author format.names.beginning }
+      if$
+    }
+  if$
+}
+
+% Changed to MLA editor abbreviations
+% author.duplicate also applies
+FUNCTION {format.editors}
+{ editor empty$
+    { "" }
+    { author empty$ author.duplicate #1 = and
+       { "-{}-{}-" }
+       { editor format.names.beginning }
+      if$
+      editor num.names$ #1 >
+       { ", eds." * }
+       { ", ed." * }
+      if$
+    }
+  if$
+}
+
+FUNCTION {format.editors.mid}
+{ editor empty$
+    { "" }
+    {
+      editor num.names$ #1 >
+       { "Eds.\ " }
+       { "Ed.\ " }
+      if$
+      editor format.names *
+    }
+  if$
+}
+
+% Formats the address and publisher
+FUNCTION {format.publisher}
+{ address empty$
+    { publisher }
+    { address ": " * publisher * }
+  if$
+}
+
+% Changed to preserve case and use quotes
+FUNCTION {format.title}
+{ title empty$
+    { "" }
+    { title #1 text.prefix$ "`" =
+       { "``\thinspace" title * "''" * }
+       { "``" title * "''" *}
+      if$
+    }
+  if$
+}
+
+FUNCTION {n.dashify}
+{ 't :=
+  ""
+    { t empty$ not }
+    { t #1 #1 substring$ "-" =
+       { t #1 #2 substring$ "--" = not
+           { "--" *
+             t #2 global.max$ substring$ 't :=
+           }
+           {   { t #1 #1 substring$ "-" = }
+               { "-" *
+                 t #2 global.max$ substring$ 't :=
+               }
+             while$
+           }
+         if$
+       }
+       { t #1 #1 substring$ *
+         t #2 global.max$ substring$ 't :=
+       }
+      if$
+    }
+  while$
+}
+
+FUNCTION {format.date}
+{ year empty$
+    { month empty$
+       { "" }
+       { "there's a month but no year in " cite$ * warning$
+         month
+       }
+      if$
+    }
+    { month empty$
+       'year
+       { month " " * year * }
+      if$
+    }
+  if$
+}
+
+FUNCTION {format.btitle}
+{ title emphasize
+}
+
+FUNCTION {tie.or.space.connect}
+{ duplicate$ text.length$ #3 <
+    { "~" }
+    { "\ " }
+  if$
+  swap$ * *
+}
+
+FUNCTION {either.or.check}
+{ empty$
+    'pop$
+    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
+  if$
+}
+
+FUNCTION {format.bvolume.or.num.series}
+{ volume empty$
+    { number empty$
+       { series field.or.null }
+       { 
+         series empty$
+           { number "there's a number but no series in " cite$ * warning$ }
+           { series
+         %output.state mid.sentence =
+           %{ " Sers." * }
+           %{ "Sers." * }
+         %if$
+         number tie.or.space.connect
+         }
+         if$
+       }
+      if$
+    }
+    { "Vol." volume tie.or.space.connect
+      series empty$
+       'skip$
+       { " of " * series emphasize * add.period$ }
+      if$
+      number empty$
+       'skip$
+       { number * " vols." * }
+      if$
+      %"volume and number" number either.or.check
+    }
+  if$
+}
+
+FUNCTION {format.number.series}
+{ volume empty$
+    { "" }
+    { "" }
+  if$
+}
+
+% Changed edition to MLA abbreviation
+FUNCTION {format.edition}
+{ edition empty$
+    { "" }
+    { edition "l" change.case$ 's := edition 't :=
+      "" "9th" "ninth" "8th" "eighth" "7th" "seventh" "6th" "sixth" "5th" "fifth" "4th" "fourth" "3rd" "third" "2nd" "second" "1st" "first"
+      {duplicate$ empty$ { pop$ #0 }{ #1 } if$ }{ s = { 't := }{ pop$ } if$ }
+      while$
+%        output.state mid.sentence =
+%      { edition "l" change.case$ " ed." * }
+%      { edition "t" change.case$ " ed." * }
+%      if$
+    t " ed." *
+    }
+  if$
+}
+
+INTEGERS { multiresult }
+
+FUNCTION {multi.page.check}
+{ 't :=
+  #0 'multiresult :=
+    { multiresult not
+      t empty$ not
+      and
+    }
+    { t #1 #1 substring$
+      duplicate$ "-" =
+      swap$ duplicate$ "," =
+      swap$ "+" =
+      or or
+       { #1 'multiresult := }
+       { t #2 global.max$ substring$ 't := }
+      if$
+    }
+  while$
+  multiresult
+}
+
+FUNCTION {format.pages}
+{ pages empty$
+    { "" }
+    { %pages multi.page.check
+%      { "pages" pages n.dashify tie.or.space.connect }
+%      { "page" pages tie.or.space.connect }
+%      if$
+    pages n.dashify
+    }
+  if$
+}
+
+FUNCTION {format.vol.num.year.pages}
+{ volume empty$
+    { number empty$
+       'skip$
+       { "there's a number but no volume in " cite$ * warning$ }
+      if$
+      format.date
+    }
+    { volume
+      number empty$
+       'skip$
+       { "." * number * }
+      if$
+      " (" * format.date * ")" *
+    }
+  if$
+  edition empty$
+    'skip$
+    { ", " * format.edition * }
+  if$
+  pages empty$
+    'skip$
+    { ": " * pages n.dashify * }
+  if$
+}
+
+
+FUNCTION {format.vol.num.pages}
+{ volume field.or.null
+  number empty$
+    'skip$
+    { "(" number * ")" * *
+      volume empty$
+       { "there's a number but no volume in " cite$ * warning$ }
+       'skip$
+      if$
+    }
+  if$
+  pages empty$
+    'skip$
+    { duplicate$ empty$
+       { pop$ format.pages }
+       { ":" * pages n.dashify * }
+      if$
+    }
+  if$
+}
+
+% chapter might be useful if type is set to "pars."
+FUNCTION {format.chapter.pages}
+{ chapter empty$
+    'format.pages
+    { type empty$
+       { "Chapter" }
+       { type "t" change.case$ }
+      if$
+      chapter n.dashify tie.or.space.connect
+      pages empty$
+       'skip$
+       { ", " * format.pages * }
+      if$
+    }
+  if$
+}
+
+FUNCTION {format.in.ed.booktitle}
+{ booktitle empty$
+    { "" }
+    { editor empty$
+       { "In " booktitle emphasize * }
+       { booktitle emphasize add.period$ format.editors.mid * }
+      if$
+    }
+  if$
+}
+
+FUNCTION {empty.misc.check}
+{ author empty$ title empty$ howpublished empty$
+  month empty$ year empty$ note empty$
+  and and and and and
+  key empty$ not and
+    { "all relevant fields are empty in " cite$ * warning$ }
+    'skip$
+  if$
+}
+
+FUNCTION {format.thesis.type}
+{ type empty$
+    'skip$
+    { pop$
+      type "t" change.case$
+    }
+  if$
+}
+
+FUNCTION {format.tr.number}
+{ type empty$
+    { "Technical Report" }
+    'type
+  if$
+  number empty$
+    { "t" change.case$ }
+    { number tie.or.space.connect }
+  if$
+}
+
+FUNCTION {format.article.crossref}
+{ %key empty$
+    %{ journal empty$
+       %{ "need key or journal for " cite$ * " to crossref " * crossref *
+       %  warning$
+       %  ""
+       %}
+       %{ "In {\em " journal * "\/}" * }
+      %if$
+    %}
+    %{ "In " key * }
+  %if$
+  pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
+  "{" * crossref * "}" *
+}
+
+FUNCTION {format.crossref.editor}
+{ editor #1 "{vv~}{ll}" format.name$
+  editor num.names$ duplicate$
+  #2 >
+    { pop$ " et~al." * }
+    { #2 <
+       'skip$
+       { editor #2 "{ff }{vv }{ll}{, jj}" format.name$ "others" =
+           { " et~al." * }
+           { " and " * editor #2 "{vv~}{ll}" format.name$ * }
+         if$
+       }
+      if$
+    }
+  if$
+}
+
+FUNCTION {format.book.crossref}
+{% volume empty$
+%    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
+%      "In "
+%    }
+%    { "Vol." volume tie.or.space.connect add.period$
+%    }
+%  if$
+%  editor empty$
+%  editor field.or.null author field.or.null =
+%  or
+%    { key empty$
+%      { series empty$
+           %{ "need editor, key, or series for " cite$ * " to crossref " *
+           %  crossref * warning$
+           %  "" *
+           %}
+           %{ "{\em " * series * "\/}" * }
+         %if$
+%      }
+%      { key * }
+%      if$
+%    }
+%    { format.crossref.editor * }
+%  if$
+  %" \citeN{" * crossref * "}" *
+  pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
+  "{" * crossref * "}" *
+}
+
+FUNCTION {format.incoll.inproc.crossref}
+{% editor empty$
+%  editor field.or.null author field.or.null =
+%  or
+%    { key empty$
+%      { booktitle empty$
+%          { "need editor, key, or booktitle for " cite$ * " to crossref " *
+%            crossref * warning$
+%            ""
+%          }
+%          { "In {\em " booktitle * "\/}" * }
+%        if$
+%      }
+%      { "In " key * }
+%      if$
+%    }
+%    { "In " format.crossref.editor * }
+%  if$
+%  " \citeN{" * crossref * "}" *
+  pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
+  "{" * crossref * "}" *
+}
+
+FUNCTION {cite.title}
+{ title empty$ journal empty$ not and
+    { key empty$ { journal }{ key } if$ emphasize }
+    { title empty$ key empty$ and
+       { "empty title and key in " cite$ * warning$ "" }
+       { key empty$ {title}{key} if$
+         type$ "book" =
+         type$ "inbook" =
+         type$ "manual" =
+         type$ "phdthesis" =
+         type$ "proceedings" =
+         or or or or
+           { emphasize }
+           { type$ "article" =
+             %type$ "booklet" =
+             type$ "incollection" =
+             type$ "inproceedings" =
+             type$ "mastersthesis" =
+             type$ "misc" =
+             type$ "techreport" =
+             type$ "unpublished" =
+             or or or or or or
+               {"``" swap$ * "''" *  }
+               {}
+             if$
+           }
+         if$
+       }
+      if$
+    }
+  if$
+}
+
+FUNCTION {cite.label}
+{
+  %author empty$
+  %  { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
+  %  { author 'a := }
+  %if$
+  %abbr empty$ {
+  author empty$
+    { editor empty$
+       { "" }
+       { editor }
+      if$
+    }
+    { author }
+  if$
+  duplicate$ empty$
+    { pop$ cite.title }
+    {
+      author.shared author.different =
+       { "{vv~}{ll}" format.names.custom }
+       { author.shared author.last =
+           { "{f.~}{vv~}{ll}{, jj}" format.names.custom }
+           { author.shared author.flast =
+               { "{ff~}{vv~}{ll}{, jj}" format.names.custom }
+               { "{vv~}{ll}" format.names.custom ", " * cite.title * }
+             if$
+           }
+         if$
+       }
+      if$
+      author.duplicate { ", " * cite.title * }{} if$
+    }
+  if$
+      %}
+      %if$
+    %}
+    %{}% abbr }
+ % if$
+}
+
+% TODO
+FUNCTION {output.bibitem}
+{ newline$
+  "\bibitem[" write$
+  cite.label write$
+  "]{" write$
+  cite$ write$
+  "}" write$
+  newline$
+  ""
+  before.all 'output.state :=
+}
+
+FUNCTION {article}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.title "title" output.check
+  new.block
+  crossref missing$
+    { journal emphasize "journal" output.check after.title 'output.state :=
+      %format.date "year" output.check
+      %edition output
+      format.vol.num.year.pages output
+    }
+    { format.article.crossref output.nonnull
+      %format.pages output
+    }
+  if$
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {book}
+{ output.bibitem
+  author empty$
+    { format.editors "author and editor" output.check }
+    { format.authors output.nonnull }
+  if$
+  new.block
+  format.btitle "title" output.check
+  new.sentence
+  crossref missing$
+    { author empty$ 'skip$ { format.editors.mid output new.sentence } if$
+      format.edition output
+      new.sentence
+      format.bvolume.or.num.series output
+      new.block
+      format.publisher "publisher" output.check
+      format.date "year" output.check
+    }
+    {% format.date "year" output
+      new.block
+      format.book.crossref output.nonnull
+    }
+  if$
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {booklet}
+{ output.bibitem
+  format.authors output
+  new.block
+  format.title "title" output.check
+  howpublished address new.block.checkb
+  howpublished output
+  address output
+  format.date output
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {inbook}
+{ output.bibitem
+  author empty$
+    { format.editors "author and editor" output.check }
+    { format.authors output.nonnull }
+  if$
+  new.block
+  format.btitle "title" output.check
+  new.block
+  crossref missing$
+    { author empty$ 'skip$ { format.editors.mid output new.sentence } if$
+      format.edition output
+      new.sentence
+      format.bvolume.or.num.series output
+      new.block
+      format.publisher "publisher" output.check
+      format.date "year" output.check
+      new.sentence
+      format.chapter.pages "chapter and pages" output.check
+      %address output
+    }
+    {% format.chapter.pages "chapter and pages" output.check
+      new.block
+      format.book.crossref output.nonnull
+    }
+  if$
+  note output
+  fin.entry
+}
+
+FUNCTION {incollection}
+{ output.bibitem
+  format.authors "author" output.check
+  chapter empty$
+    { new.block type output }
+    {}
+  if$
+  new.block
+  format.title "title" output.check
+  new.block
+  crossref missing$
+    { 
+      booktitle emphasize "booktitle" output.check
+      new.sentence
+      format.editors.mid "editor" output.check
+      new.block
+      format.edition output
+      new.sentence
+      format.bvolume.or.num.series output
+      new.block
+      format.publisher "publisher" output.check
+      %address output
+      format.date "year" output.check
+      new.sentence
+      format.chapter.pages output
+    }
+    { format.incoll.inproc.crossref output.nonnull
+      %format.chapter.pages output
+    }
+  if$
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {inproceedings}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.title "title" output.check
+  new.block
+  crossref missing$
+    { %format.in.ed.booktitle "booktitle" output.check
+      booktitle "booktitle" output.check
+      new.sentence
+      format.editors.mid output
+      new.sentence
+      format.edition output
+      new.sentence
+      format.bvolume.or.num.series output
+      new.block
+      format.edition output
+      new.sentence
+      format.publisher output
+      format.date "year" output.check
+      %address empty$
+       %{ organization publisher new.sentence.checkb
+        % organization output
+        % publisher output
+        % format.date "year" output.check
+       %}
+       %{ address output.nonnull
+        % format.date "year" output.check
+        % new.sentence
+        % organization output
+        % publisher output
+       %}
+      %if$
+      new.sentence
+      format.pages output
+    }
+    { format.incoll.inproc.crossref output.nonnull
+      %format.pages output
+    }
+  if$
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {conference} { inproceedings }
+
+FUNCTION {manual}
+{ output.bibitem
+  author empty$
+    { organization empty$
+       'skip$
+       { organization output.nonnull
+         address output
+       }
+      if$
+    }
+    { format.authors output.nonnull }
+  if$
+  new.block
+  format.btitle "title" output.check
+  new.sentence
+  format.edition output
+  new.sentence
+  author empty$
+    { organization empty$
+       { address new.block.checka
+         address output
+       }
+       'skip$
+      if$
+    }
+    { organization address new.block.checkb
+      organization output
+      address output
+    }
+  if$
+  format.date output
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {mastersthesis}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.title "title" output.check
+  new.block
+  "Diss." format.thesis.type output.nonnull
+  after.title 'output.state :=
+  school "school" output.check
+  address output
+  format.date "year" output.check
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {misc}
+{ output.bibitem
+  format.authors output
+  title howpublished new.block.checkb
+  format.title output after.sentence 'output.state :=
+  howpublished new.block.checka
+  howpublished output
+  format.date output
+  new.block
+  note output
+  fin.entry
+  empty.misc.check
+}
+
+FUNCTION {phdthesis}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.btitle "title" output.check
+  new.block
+  "Diss." format.thesis.type output.nonnull
+  after.title 'output.state :=
+  school "school" output.check
+  address output
+  format.date "year" output.check
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {proceedings}
+{ output.bibitem
+  editor empty$
+    { organization output }
+    { format.editors output.nonnull }
+  if$
+  new.block
+  format.btitle "title" output.check
+  new.sentence
+  format.bvolume.or.num.series output
+  address empty$
+    { editor empty$
+       { publisher new.sentence.checka }
+       { organization publisher new.sentence.checkb
+         organization output
+       }
+      if$
+      publisher output
+      format.date "year" output.check
+    }
+    { address output.nonnull
+      format.date "year" output.check
+      new.sentence
+      editor empty$
+       'skip$
+       { organization output }
+      if$
+      publisher output
+    }
+  if$
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {techreport}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.title "title" output.check
+  new.block
+  format.tr.number output.nonnull
+  institution "institution" output.check
+  address output
+  format.date "year" output.check
+  new.block
+  note output
+  fin.entry
+}
+
+FUNCTION {unpublished}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.title "title" output.check
+  new.block
+  note "note" output.check
+  format.date output
+  fin.entry
+}
+
+FUNCTION {default.type} { misc }
+
+MACRO {jan} {"Jan."}
+
+MACRO {feb} {"Feb."}
+
+MACRO {mar} {"Mar."}
+
+MACRO {apr} {"Apr."}
+
+MACRO {may} {"May"}
+
+MACRO {jun} {"June"}
+
+MACRO {jul} {"July"}
+
+MACRO {aug} {"Aug."}
+
+MACRO {sep} {"Sept."}
+
+MACRO {oct} {"Oct."}
+
+MACRO {nov} {"Nov."}
+
+MACRO {dec} {"Dec."}
+
+MACRO {acmcs} {"ACM Computing Surveys"}
+
+MACRO {acta} {"Acta Informatica"}
+
+MACRO {cacm} {"Communications of the ACM"}
+
+MACRO {ibmjrd} {"IBM Journal of Research and Development"}
+
+MACRO {ibmsj} {"IBM Systems Journal"}
+
+MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
+
+MACRO {ieeetc} {"IEEE Transactions on Computers"}
+
+MACRO {ieeetcad}
+ {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
+
+MACRO {ipl} {"Information Processing Letters"}
+
+MACRO {jacm} {"Journal of the ACM"}
+
+MACRO {jcss} {"Journal of Computer and System Sciences"}
+
+MACRO {scp} {"Science of Computer Programming"}
+
+MACRO {sicomp} {"SIAM Journal on Computing"}
+
+MACRO {tocs} {"ACM Transactions on Computer Systems"}
+
+MACRO {tods} {"ACM Transactions on Database Systems"}
+
+MACRO {tog} {"ACM Transactions on Graphics"}
+
+MACRO {toms} {"ACM Transactions on Mathematical Software"}
+
+MACRO {toois} {"ACM Transactions on Office Information Systems"}
+
+MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
+
+MACRO {tcs} {"Theoretical Computer Science"}
+
+READ
+
+FUNCTION {sortify}
+{ purify$
+  "l" change.case$
+}
+
+INTEGERS { len }
+
+FUNCTION {chop.word}
+{ 's :=
+  'len :=
+  s #1 len substring$ =
+    { s len #1 + global.max$ substring$ }
+    's
+  if$
+}
+
+FUNCTION {sort.format.names}
+{ 's :=
+  #1 'nameptr :=
+  ""
+  s num.names$ 'numnames :=
+  numnames 'namesleft :=
+    { namesleft #0 > }
+    { nameptr #1 >
+       { "   " * }
+       'skip$
+      if$
+      s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
+      nameptr numnames = t "others" = and
+       { "et al" * }
+       { t sortify * }
+      if$
+      nameptr #1 + 'nameptr :=
+      namesleft #1 - 'namesleft :=
+    }
+  while$
+}
+
+FUNCTION {sort.format.title}
+{ 't :=
+  "A " #2
+    "An " #3
+      "The " #4 t chop.word
+    chop.word
+  chop.word
+  sortify
+  #1 global.max$ substring$
+}
+
+FUNCTION {author.sort}
+{ author empty$
+    { key empty$
+       { "to sort, need author or key in " cite$ * warning$
+         ""
+       }
+       { key sortify }
+      if$
+    }
+    { author sort.format.names }
+  if$
+}
+
+FUNCTION {author.editor.sort}
+{ author empty$
+    { editor empty$
+       { key empty$
+           { "to sort, need author, editor, or key in " cite$ * warning$
+             ""
+           }
+           { key sortify }
+         if$
+       }
+       { editor sort.format.names }
+      if$
+    }
+    { author sort.format.names }
+  if$
+}
+
+FUNCTION {author.organization.sort}
+{ author empty$
+    { organization empty$
+       { key empty$
+           { "to sort, need author, organization, or key in " cite$ * warning$
+             ""
+           }
+           { key sortify }
+         if$
+       }
+       { "The " #4 organization chop.word sortify }
+      if$
+    }
+    { author sort.format.names }
+  if$
+}
+
+FUNCTION {editor.organization.sort}
+{ editor empty$
+    { organization empty$
+       { key empty$
+           { "to sort, need editor, organization, or key in " cite$ * warning$
+             ""
+           }
+           { key sortify }
+         if$
+       }
+       { "The " #4 organization chop.word sortify }
+      if$
+    }
+    { editor sort.format.names }
+  if$
+}
+
+FUNCTION {presort}
+{ type$ "book" =
+  type$ "inbook" =
+  or
+    'author.editor.sort
+    { type$ "proceedings" =
+       'editor.organization.sort
+       { type$ "manual" =
+           'author.organization.sort
+           'author.sort
+         if$
+       }
+      if$
+    }
+  if$
+  duplicate$ empty$ 'skip$ { "    " * } if$
+  key empty$
+    { title field.or.null sort.format.title * "    " * booktitle field.or.null sort.format.title * }
+    { key sortify * }
+  if$
+  "    "
+  *
+  year field.or.null sortify
+  *
+  #1 entry.max$ substring$
+  'sort.key$ :=
+}
+
+ITERATE {presort}
+
+SORT
+
+STRINGS {a b}
+INTEGERS {i j}
+
+FUNCTION {init.vars}
+{ #0 int.to.chr$ 'a :=
+  #0 int.to.chr$ 'b :=
+  #0 'i :=
+  #0 'j :=
+}
+
+FUNCTION {forward.author.dup.check}
+{
+  author empty$
+    { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
+    { author 'a := }
+  if$
+  %'a :=
+  a empty$
+    'skip$
+    { b "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$
+      a "{ff~}{vv~}{ll}{, jj}" format.names.custom purify$ =
+       { #1 'author.duplicate := }
+       { #0 'author.duplicate := }
+      if$
+      a 'b :=
+    }
+  if$
+}
+
+FUNCTION {forward.author.share.check}
+%
+% Pass through all entries, comparing current author to last one.
+%
+{ author.duplicate author empty$ or
+  { author.duplicate { i 'author.shared := }{} if$}
+  { b "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$
+    author field.or.null "{f.~}{vv~}{ll}{, jj}" format.names.custom purify$ =
+    { author.flast 'author.shared := }
+    { b "{vv~}{ll}" format.names.custom purify$
+      author field.or.null "{vv~}{ll}" format.names.custom purify$ =
+      { author.last 'author.shared := }
+      { author.different 'author.shared := }
+      if$
+    }
+    if$
+    author.shared 'i :=
+    author field.or.null 'b :=
+  }
+  if$
+}
+
+FUNCTION {reverse.author}
+{ 
+  author.duplicate
+  { author.shared i <
+      { i 'author.shared := }
+      {}
+    if$
+  }
+  { author.shared i <
+      { author.shared i 'author.shared := 'i := }
+      { author.shared 'i := }
+    if$
+  }
+  if$
+  j #1 = author.duplicate not and { #2 'author.duplicate := } {} if$
+  author.duplicate 'j :=
+}
+
+EXECUTE {init.consts}
+
+EXECUTE {init.vars}
+ITERATE {forward.author.dup.check}
+
+EXECUTE {init.vars}
+ITERATE {forward.author.share.check}
+
+EXECUTE {init.vars}
+REVERSE {reverse.author}
+
+%INTEGERS { number.label longest.label.width }
+
+%FUNCTION {initialize.longest.label}
+%{ "" 'longest.label :=
+%  #1 'number.label :=
+%  #0 'longest.label.width :=
+%}
+
+%FUNCTION {longest.label.pass}
+%{ number.label int.to.str$ 'label :=
+%  number.label #1 + 'number.label :=
+%  label width$ longest.label.width >
+%    { label 'longest.label :=
+%      label width$ 'longest.label.width :=
+%    }
+%    'skip$
+%  if$
+%}
+
+%EXECUTE {initialize.longest.label}
+
+%ITERATE {longest.label.pass}
+
+FUNCTION {begin.bib}
+{ preamble$ empty$
+    'skip$
+    { preamble$ write$ newline$ }
+  if$
+  "\begin{thebibliography}{\rule{.5in}{0pt}}" write$ newline$
+  "\ifx\undefined\citeN\let\citeN\cite\fi" write$ newline$
+}
+
+EXECUTE {begin.bib}
+
+ITERATE {call.type$}
+
+FUNCTION {end.bib}
+{ newline$
+  "\end{thebibliography}" write$ newline$
+}
+
+EXECUTE {end.bib}
diff --git a/mlastyle.dtx b/mlastyle.dtx
new file mode 100644 (file)
index 0000000..d38f36c
--- /dev/null
@@ -0,0 +1,636 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2003 by Scott Pakin <pakin@uiuc.edu>
+% --------------------------------------------------
+% 
+% This file may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.2
+% of this license or (at your option) any later version.
+% The latest version of this license is in:
+%
+%    http://www.latex-project.org/lppl.txt
+%
+% and version 1.2 or later is part of all distributions of LaTeX 
+% version 1999/12/01 or later.
+%
+% \fi
+%
+% \iffalse
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<package>\ProvidesPackage{mlastyle}
+%<package>   [2003/10/21 v1.0 .dtx mlastyle file] 
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[compat]{mlastyle}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+%\OnlyDescription
+\begin{document}
+  \DocInput{mlastyle.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{0}
+%
+% \CharacterTable
+%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%   Digits        \0\1\2\3\4\5\6\7\8\9
+%   Exclamation   \!     Double quote  \"     Hash (number) \#
+%   Dollar        \$     Percent       \%     Ampersand     \&
+%   Acute accent  \'     Left paren    \(     Right paren   \)
+%   Asterisk      \*     Plus          \+     Comma         \,
+%   Minus         \-     Point         \.     Solidus       \/
+%   Colon         \:     Semicolon     \;     Less than     \<
+%   Equals        \=     Greater than  \>     Question mark \?
+%   Commercial at \@     Left bracket  \[     Backslash     \\
+%   Right bracket \]     Circumflex    \^     Underscore    \_
+%   Grave accent  \`     Left brace    \{     Vertical bar  \|
+%   Right brace   \}     Tilde         \~}
+%
+%
+% \changes{v1.0}{2003/09/25}{Initial version}
+%
+% \GetFileInfo{mlastyle.sty}
+%
+% \DoNotIndex{\the,\edef,\gdef,\voffset,\@undefined}
+% \DoNotIndex{\@centercr,\@for,\@date,\do,\@startsection}
+% \DoNotIndex{\@citea,\@citeb}
+% \DoNotIndex{\@empty,\@ignoretrue}
+% \DoNotIndex{\@ixpt}
+% \DoNotIndex{\@M,\@minus,\@ne,\@plus}
+% \DoNotIndex{\.,\ ,\\}
+% \DoNotIndex{\addtolength,\advance}
+% \DoNotIndex{\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
+% \DoNotIndex{\bullet}
+% \DoNotIndex{\cdot,\cr,\day,\DeclareOption}
+% \DoNotIndex{\def,\DocInput,\documentclass}
+% \DoNotIndex{\DoNotIndex,\egroup,\ifx,\else,\fi,\endtrivlist}
+% \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
+% \DoNotIndex{\endlist,\everycr,\ExecuteOptions,\expandafter}
+% \DoNotIndex{\filedate,\filename,\fileversion,\futurelet}
+% \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
+% \DoNotIndex{\hsize,\hskip,\hspace,\hss,\ifcase,\or,\fi}
+% \DoNotIndex{\ifvmode,\fi,\ifnum,\fi,\input}
+% \DoNotIndex{\kern,\leavevmode,\let,\leftmark}
+% \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark}
+% \DoNotIndex{\mbox,\month,\newcommand,\newcounter,\newenvironment}
+% \DoNotIndex{\mlastyle@bibstyletrue,\mlastyle@bibstylefalse}
+% \DoNotIndex{\mlastyle@formattrue,\mlastyle@formatfalse}
+% \DoNotIndex{\mlastyle@papersizetrue,\mlastyle@papersizefalse}
+% \DoNotIndex{\mlastyle@styletrue,\mlastyle@stylefalse}
+% \DoNotIndex{\mlastyle@timestrue,\mlastyle@timesfalse}
+% \DoNotIndex{\mlastyle@underlinetrue,\mlastyle@underlinefalse}
+% \DoNotIndex{\mlastyle@bibstyletrue,\mlastyle@bibstylefalse}
+% \DoNotIndex{\mlastyle@slashnext,\mlastyle@slashx}
+% \DoNotIndex{}
+% \DoNotIndex{\NeedsTeXFormat,\newdimen}
+% \DoNotIndex{\newpage,\nobreak,\noindent,\number}
+% \DoNotIndex{\or,\p@}
+% \DoNotIndex{\pagestyle,\par}
+% \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
+% \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
+% \DoNotIndex{\refstepcounter,\relax,\renewcommand,\renewenvironment}
+% \DoNotIndex{\reset@font}
+% \DoNotIndex{\rightmargin,\rlap,\rmfamily}
+% \DoNotIndex{\setbox,\setcounter,\setlength}
+% \DoNotIndex{\skip,\slshape,\space}
+% \DoNotIndex{\trivlist,\typeout,\tw@}
+% \DoNotIndex{\voffset,\vskip,\vspace,\year,\z@}
+%
+% \newcommand*{\Lopt}[1]{\textsf {#1}}
+% \newcommand*{\file}[1]{\texttt {#1}}
+% \newcommand*{\package}[1]{\textsf {#1}}
+% \newcommand*{\Lcount}[1]{\textsl {\small#1}}
+% \newcommand*{\pstyle}[1]{\textsl {#1}}
+%
+% \title{The \package{mlastyle} package\thanks{This document
+%   corresponds to \package{mlastyle}~\fileversion, dated \filedate.}}
+% \author{Tim Pope \\ \texttt{latex@rebelongto.us}}
+%
+% \maketitle
+%
+% \section{Introduction}
+%
+% MLA style is ugly.  Nevertheless, it is often required, particularly in
+% the humanities.
+%
+% \section{Usage}
+%
+% A sample document follows.
+% \begin{verbatim}
+%\documentclass[12pt]{article}
+%\usepackage{mlastyle}
+%
+%\author{John Doe}
+%\professor{Professor Smith}
+%\classname{English 101}
+%\date{1~Jan.\ 1970}
+%\title{The Futility of Compulsory English Classes}
+%
+%\begin{document}
+%\maketitle
+%'Nuff said.
+%\end{document}\end{verbatim}
+% \subsection{Initiation Macros}
+% \DescribeMacro{\maketitle}
+% \DescribeMacro{\professor}
+% \DescribeMacro{\classname}
+% The mandatory heading\index{heading|usage} is generated with
+% |\maketitle|.  Use the standard macros |\author|, |\title|, and |\date|
+% to specify the relevant information.  To define the professor and name
+% of the class, use the aptly named |\professor|\marg{name} and
+% |\classname|\marg{class} macros.
+%
+% \DescribeMacro{\lastname}
+% The last name for use in the header\index{header|usage} is derived from
+% |\author|.  If this does not produce the desired result, use
+% |\lastname|\marg{last name} to override it.
+%
+% \DescribeMacro{\date}
+% \DescribeMacro{\today}
+% MLA style recommends the DD~Mon.~YYYY format for specifying dates;
+% |\today| has been conveniently redefined to this.  However, other
+% formats can be used as long as done so consistantly throughout the
+% document.  Also note that the date in the header should be the due date
+% of the assignment, so be sure to explictly call |\date|\marg{due date}
+% if you actually finish your assignments early.
+%
+% \subsection{Environments}
+% \DescribeEnv{verse}
+% \DescribeEnv{quote}
+% \DescribeEnv{quotation}
+% Three environments have been modified from standard \LaTeX to better
+% suit MLA format.  To typeset poetry\index{poetry|usage} and
+% drama\index{drama|usage}, use the |verse| environment.
+% Quotations\index{quotations|usage} of a single paragraph or less always
+% use the |quote| environment.  For longer passages, use the |quotation|
+% environment if the beginning of the passage marks the beginning of a
+% paragraph.  Otherwise, use the |quote| environment.
+%
+% Be sure to follow MLA guidelines when using these environments.  Short
+% quotes should be enclosed in quotation marks and included directly in
+% the text.
+%
+% \subsection{Documentating Sources}
+%
+% Coupled with \BibTeX, \package{mlastyle} provides a experimental
+% implementation of MLA documentation style.  Load the bibliography style
+% by putting |\bibliographystyle{mlastyle}| in the document preamble.
+%
+% \StopEventually{\PrintChanges\PrintIndex}
+% \iffalse
+%<*package>
+% \fi
+% \section{Implementation}
+%
+% \subsection{Options}
+%
+% First, the options.
+%    \begin{macrocode}
+\newif\ifmlastyle@bibstyle
+\DeclareOption{bibstyle}{\mlastyle@bibstyletrue}
+\DeclareOption{nobibstyle}{\mlastyle@bibstylefalse}
+%    \end{macrocode}
+%    \begin{macrocode}
+\newif\ifmlastyle@papersize
+\DeclareOption{papersize}{\mlastyle@papersizetrue}
+\DeclareOption{nopapersize}{\mlastyle@papersizefalse}
+\newif\ifmlastyle@underline
+\DeclareOption{underline}{\mlastyle@underlinetrue}
+\DeclareOption{italics}{\mlastyle@underlinefalse}
+\newif\ifmlastyle@times
+\DeclareOption{times}{\mlastyle@timestrue}
+\DeclareOption{cm}{\mlastyle@timesfalse}
+\newif\ifmlastyle@style
+\DeclareOption{compat}{\mlastyle@stylefalse
+       \mlastyle@formatfalse
+       \mlastyle@underlinefalse}
+\DeclareOption{mla}{\mlastyle@styletrue
+       \mlastyle@formattrue
+       \mlastyle@underlinetrue}
+\newif\ifmlastyle@format
+\DeclareOption{format}{\mlastyle@stylefalse
+       \mlastyle@formattrue
+       \mlastyle@underlinetrue}
+\DeclareOption{style}{\mlastyle@styletrue
+       \mlastyle@formatfalse
+       \mlastyle@underlinefalse}
+\DeclareOption{singlespacequotes}{
+  \def\mlastyle@qspread{\linespread{1}\normalsize\vskip\baselineskip}}
+\DeclareOption{doublespacequotes}{\let\mlastyle@qspread\relax}
+\ExecuteOptions{nobibstyle,nopapersize,mla,cm,doublespacequotes}
+\ProcessOptions
+%    \end{macrocode}
+% If the \Lopt{papersize} option is set, add the appropriate
+% \textsc{PostScript} special, or adjust |\pdfpagewidth| and
+% |\pdfpageheight| if pdf\LaTeX{} is in use.
+%    \begin{macrocode}
+\ifmlastyle@papersize
+  \ifx\@undefined\pdfpagewidth
+    \special{papersize=\the\paperwidth,\the\paperheight}
+  \else
+    \setlength{\pdfpagewidth}{\paperwidth}
+    \setlength{\pdfpageheight}{\paperheight}
+  \fi
+\fi % \ifmlastyle@papersize
+%    \end{macrocode}
+% If the \Lopt{bibstyle} option is set, specify the bibliography style.
+%    \begin{macrocode}
+\ifmlastyle@bibstyle
+  \ifmlastyle@style
+    \bibliographystyle{mlastyle}
+  \else
+    \bibliographystyle{plain}
+  \fi
+\fi % \ifmlastyle@bibstyle
+%    \end{macrocode}
+% Load the \package{ulem} package if the \Lopt{underline} option is set.
+%    \begin{macrocode}
+\ifmlastyle@underline
+  \RequirePackage{ulem}
+\fi % \ifmlastyle@underline
+%    \end{macrocode}
+% Load the \package{times} package if the \Lopt{times} option is set.
+%    \begin{macrocode}
+\ifmlastyle@times
+  \RequirePackage{times}
+\fi % \ifmlastyle@times
+%    \end{macrocode}
+% \subsection{Macros}
+% \begin{macro}{\professor}
+% Define the professor.
+%    \begin{macrocode}
+\def\professor#1{\gdef\theprofessor{#1}}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\classname}
+% Define the class.
+%    \begin{macrocode}
+\def\classname#1{\gdef\theclassname{#1}}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\lastname}
+% Define the last name.
+%    \begin{macrocode}
+\def\lastname#1{\gdef\thelastname{#1}}
+%    \end{macrocode}
+% \end{macro}
+% \subsection{Formatting}
+% Formatting is only done if the \Lopt{format} option is set.  This is the
+% default.
+%    \begin{macrocode}
+\ifmlastyle@format
+%    \end{macrocode}
+% \subsubsection{Macros}
+% \begin{macro}{\maketitle}
+% Redefined |\maketitle| generate a heading in MLA format.
+%    \begin{macrocode}
+  \renewcommand{\maketitle}{\begin{flushleft}
+    \@author\par
+    \@ifundefined{theprofessor}{}{\theprofessor}\par
+    \@ifundefined{theclassname}{}{\theclassname}\par
+    \@date\end{flushleft}
+    \begin{center}\@title\end{center}\par
+  }
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\today}
+% |\today| is redefined to DD~Mon.~YYYY format.
+%    \begin{macrocode}
+\def\today{\number\day~\ifcase\month\or
+  Jan.\or Feb.\or Mar.\or Apr.\or May\or June\or July\or 
+  Aug.\or Sept.\or Oct.\or Nov.\or Dec.\fi\ \number\year}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\slash}
+% No penalty for |\slash|, and plain /'s permit line breaks if necessary.
+%    \begin{macrocode}
+  \def\slash{/\penalty\z@}
+  %\let\mlastyle@sl@sh=/
+  \def\mlastyle@slash{/\futurelet\mlastyle@slashnext\mlastyle@slashx}
+  \def\mlastyle@slashx{\ifx\mlastyle@slashnext/\else
+    \penalty\exhyphenpenalty\fi}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\section}
+% Sections are formatted by centering the section name and beginning a new
+% page.  Subsections simply center the section name.
+%    \begin{macrocode}
+  \renewcommand{\section}{\clearpage\@startsection{section}{1}{\z@
+    }{0pt}{1sp}{\centering}}
+  \renewcommand{\subsection}{\@startsection{subsection}{2}{\z@
+    }{0pt}{1sp}{\centering}}
+%    \end{macrocode}
+% \end{macro}
+% \subsubsection{Environments}
+% ^^A%\newenvironment{blocks}{\begin{quote} \linespread{1} \small \normalsize}{\end{quote} \linespread{2} \small \normalsize}
+% ^^A%\newenvironment{blockm}{\begin{quotation} \linespread{1} \small \normalsize}{\end{quotation} \linespread{2} \small \normalsize}
+% \begin{environment}{verse}
+% Indented 1 inch, with an additional .25 inch hanging indent.
+%    \begin{macrocode}
+  \renewenvironment{verse}{\list{}{\mlastyle@qspread
+    \advance\leftmargin.75in\itemindent-.25in
+    \listparindent\itemindent}\item\relax}{\endlist}
+%    \end{macrocode}
+% \end{environment}
+% \begin{environment}{quotation}
+% Indented 1 inch, with a paragraph indent of an additional .25 inches.
+%    \begin{macrocode}
+  \renewenvironment{quotation}{\list{}{\mlastyle@qspread
+    \advance\leftmargin.5in\itemindent.25in
+    \listparindent\itemindent}\item\relax}{\endlist}
+%    \end{macrocode}
+% \end{environment}
+% \begin{environment}{quote}
+% Identical to the |quotation| environment, except the first paragraph is not
+% indented.
+%    \begin{macrocode}
+  \renewenvironment{quote}{\list{}{\mlastyle@qspread
+    \advance\leftmargin.5in
+    \listparindent.25in}\item\relax}{\endlist}
+%    \end{macrocode}
+% \end{environment}
+% \begin{environment}{workscited}
+% Works Cited environment, for compatibility with \package{mla-paper}.
+%    \begin{macrocode}
+  \newenvironment{workscited}%
+    {\newpage{\centerline{Works Cited}}}{\newpage}
+  \newcommand{\bibent}{\noindent \hangindent .5in}
+%    \end{macrocode}
+% \end{environment}
+% \subsubsection{Margins}
+% Top and bottom margins are 1 inch each.  The header is flush with the
+% right margin at .5 inches from the top of the page.
+% ^^A%\settoheight{\headheight}{\llap{\parbox[b]{\textwidth}{\large\raggedleft Pope}}}
+%    \begin{macrocode}
+  \setlength{\voffset}{-0.5in}
+  \setlength{\textheight}{\paperheight}
+  \addtolength{\textheight}{-2in}
+  \setlength{\topmargin}{0in}
+  \addtolength{\headheight}{-1pt}
+  \setlength{\headheight}{1.4\headheight}% kludge
+  \setlength{\headsep}{0.5in}
+  \addtolength{\headsep}{-\headheight}
+  \setlength{\footskip}{0.25in}
+  \raggedbottom
+%    \end{macrocode}
+% Left and right margins in MLA format are each 1 inch wide.
+%    \begin{macrocode}
+  \setlength{\hoffset}{-0.5in}
+  \setlength{\textwidth}{\paperwidth}
+  \addtolength{\textwidth}{-2in}
+  \setlength{\oddsidemargin}{0.5in}
+  \setlength{\evensidemargin}{0.5in}
+  \setlength{\marginparwidth}{0.5in}
+%    \end{macrocode}
+% \subsubsection{Paragraphs}
+% Paragraphs should be left justified, with the first line indented .5
+% inches.
+%    \begin{macrocode}
+  \raggedright
+  \setlength{\parindent}{.5in}
+%    \end{macrocode}
+% MLA format specifies that all paragraphs should be indented, even those
+% beginning a new section.  This snippet from \package{indentfirst} changes
+% \LaTeX{} to meet that requirement.
+%    \begin{macrocode}
+  \let\@afterindentfalse\@afterindenttrue
+  \@afterindenttrue
+%    \end{macrocode}
+% Double space {\em everywhere}.
+% ^^A\RequirePackage{doublespace}
+%    \begin{macrocode}
+  \linespread{2.0}
+  \leftmargini\parindent
+  \def\@listi{\leftmargin\leftmargini
+  \parsep\z@\itemsep\z@\topsep -3\p@\relax}
+  \let\@listI\@listi
+  \@listi
+  \def\@listii{\leftmargin\leftmarginii
+  \parsep\z@\itemsep\z@\topsep -3\p@\relax}
+  \def\@listiii{\leftmargin\leftmarginiii
+  \parsep\z@\itemsep\z@\topsep -3\p@\relax}
+  \def\@listiv{\leftmargin\leftmarginiv
+  \parsep\z@\itemsep\z@\topsep -3\p@\relax}
+  \def\@listv{\leftmargin\leftmarginv
+  \parsep\z@\itemsep\z@\topsep -3\p@\relax}
+  \def\@listvi{\leftmargin\leftmarginvi
+  \parsep\z@\itemsep\z@\topsep -3\p@\relax}
+%    \end{macrocode}
+% \subsubsection{Header}
+% The last name and page number appear on every page, including the first.
+%    \begin{macrocode}
+  \RequirePackage{fancyhdr}
+  \fancypagestyle{plain}{\fancyhf{}}
+  \fancypagestyle{mlastyle}{
+    \fancyhf{}
+    \def\sw@llow##1 {}
+    \rhead{\@ifundefined{thelastname}%
+      {\expandafter\sw@llow\@author}{\thelastname} \thepage}
+    \renewcommand{\headrulewidth}{0pt}
+    \renewcommand{\footrulewidth}{0pt}
+  }
+  \pagestyle{mlastyle}
+%    \end{macrocode}
+% \subsubsection{Notes}
+% Footnotes should be indented .5 inches; however .56 inches is used
+% in a crude attempt to compensate for
+% the alignment provided by the \package{footmisc} package.  Endnotes are
+% preferred in MLA style anyway, so this should not be a problem in most
+% circumstances.
+%    \begin{macrocode}
+  \RequirePackage[ragged,norule]{footmisc}
+  \def\footnotelayout{\linespread{1}\footnotesize\raggedright{} }
+  \footnotemargin .56in
+  \skip\footins=2\baselineskip
+  \footnotesep 1.2\footnotesep
+  \addtolength\footnotesep{\baselineskip}
+  \def\footnotesize{\normalsize}
+%    \end{macrocode}
+% ^^A\let\footnoterule\relax
+% Endnotes are supported, but only if the \package{endnotes} package is
+% loaded {\em before\/} this package.
+%    \begin{macrocode}
+  \ifx\@undefined\endnote\else
+    \def\enoteheading{\newpage\section*{\notesname}}
+    \def\enoteformat{\leavevmode\makeenmark{} }
+    \def\enotesize{\normalsize}
+  \fi
+%    \end{macrocode}
+% \subsubsection{Miscellaneous}
+% With all packages loaded, we can now redefine |/|.
+%    \begin{macrocode}
+  \catcode`/=13
+  \let/=\mlastyle@slash
+%    \end{macrocode}
+% The definition of |\thebibliography| varies depending on the document
+% class.
+%    \begin{macrocode}
+  \@ifundefined{chapter}
+%    \end{macrocode}
+% Article class.
+%    \begin{macrocode}
+  {
+    \def\thebibliography#1{\newpage\section*{\refname}
+      \list{\@biblabel{\@arabic\c@enumiv}}%
+      {\settowidth\labelwidth{\@biblabel{#1}}}
+      \leftmargin\labelwidth
+      \advance\leftmargin\labelsep
+      \itemindent-\leftmargin
+      \def\newblock{}
+      \usecounter{enumiv}
+      \sloppy%\sfcode`\.=1000\relax
+      }}
+%    \end{macrocode}
+% Report/book class.
+%    \begin{macrocode}
+  {
+    \def\thebibliography#1{\chapter*{\bibname}
+      \list{\@biblabel{\@arabic\c@enumiv}}%
+      {\settowidth\labelwidth{\@biblabel{#1}}}
+      \leftmargin\labelwidth
+      \advance\leftmargin\labelsep
+      \itemindent-\leftmargin
+      \def\newblock{}
+      \usecounter{enumiv}
+      \sloppy%\sfcode`\.=1000\relax
+      }}
+%    \end{macrocode}
+% We're done formatting!
+%    \begin{macrocode}
+\fi % \ifmlastyle@format
+%    \end{macrocode}
+% \subsection{Works Cited}
+% \begin{macro}{\cite}
+% The following macros, combined with \file{mlastyle.bst}, provide
+% for a bibliography in MLA style.  Note that the definition of |\cite|,
+% |\citeN|, etc.\ vary depending on the options passed to
+% \package{mlastyle}.
+%
+% \begin{macro}{\mlastyle@intcite}
+% Since the original |\cite| is needed after it is overridden, it is stored
+% in |\mlastyle@intcite|.
+%    \begin{macrocode}
+\let\mlastyle@intcite\cite
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\mlastyle@relax}
+% This macro does nothing.  Depending on the options, ither |\citeC| or
+% |\citeM| and its ilk will utilize it.
+%    \begin{macrocode}
+\newcommand{\mlastyle@relax}[2][]{}
+%    \end{macrocode}
+% \end{macro}
+% \subsubsection{MLA Style}
+% \begin{macro}{\citeM}
+% If the \Lopt{compat} option is {\em not\/} used, the following is
+% executed.
+%    \begin{macrocode}
+\ifmlastyle@style
+  \def\@cite#1#2{(#1\if@tempswa{} #2\fi)}
+  \def\cite{\def\@cite##1##2{(##1\if@tempswa{} ##2\fi)}\mlastyle@intcite}
+  \def\citeN{\def\@cite##1##2{##1\if@tempswa{} ##2\fi}\mlastyle@intcite}
+  \def\citeM{\def\@cite##1##2{ (##1\if@tempswa{} ##2\fi)}\mlastyle@intcite}
+  \def\citepage{\def\@cite##1##2{\if@tempswa(##2)\fi}\mlastyle@intcite}
+  \def\citepageM{\def\@cite##1##2{\if@tempswa{} (##2)\fi}\mlastyle@intcite}
+  \def\citeindirect{\def\@cite##1##2%
+  {(qtd. in ##1\if@tempswa{} ##2\fi)}\mlastyle@intcite}
+  \def\citeindirectM{\def\@cite##1##2%
+  { (qtd. in ##1\if@tempswa{} ##2\fi)}\mlastyle@intcite}
+  \let\citeC\mlastyle@relax
+%    \end{macrocode}
+% \end{macro}
+% \iffalse
+% Place commas in-between citations in the same |\citeyear|, |\citeyearNP|,
+% |\citeN|, or |\shortciteN| command.
+% Use something like |\citeN{ref1,ref2,ref3}| and |\citeN{ref4}| for a list.
+%
+% \@citedata and \@citedatax:
+%  \def\@citedata{%
+%    \@ifnextchar [{\@tempswatrue\@citedatax}%
+%                {\@tempswafalse\@citedatax[]}%
+%  }
+%  \def\@citedatax[#1]#2{%
+%  \let\@citea\@empty
+%  \if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
+%    \def\@citea{}\@cite{\@for\@citeb:=#2\do%
+%      {\@citea\def\@citea{; }\@ifundefined% by Young
+%        {b@\@citeb}{{\bf ?}%
+%        \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
+%  {\csname b@\@citeb\endcsname}}}{#1}}%
+% \fi
+% \begin{macro}{\@citex}
+% This is the original |\@citex| from \LaTeX{} modified to use semicolons.
+%    \begin{macrocode}
+\def\@citex[#1]#2{%
+  \let\@citea\@empty
+  \@cite{\@for\@citeb:=#2\do
+    {\@citea\def\@citea{;\penalty-1\ }%
+     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
+     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
+     \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
+       \G@refundefinedtrue
+       \@latex@warning
+         {Citation `\@citeb' on page \thepage \space undefined}}%
+       {{\csname b@\@citeb\endcsname}}}}{#1}}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@biblabel}
+% No labels in the bibliography.
+%    \begin{macrocode}
+  \def\@biblabel#1{#1}
+  \labelsep\z@
+  \let\mlastyle@intbib\thebibliography
+  \def\thebibliography#1{\mlastyle@intbib{#1}
+    \itemindent-\leftmargin\def\@biblabel##1{}}
+%    \end{macrocode}
+% \end{macro}
+% Title the either the bibliography or the references ``Works Cited,''
+% depending on the document class.
+%    \begin{macrocode}
+  \@ifundefined{chapter}
+  {\renewcommand\refname{Works Cited}}
+  {\renewcommand\bibname{Works Cited}}
+%    \end{macrocode}
+%
+% ^^A% Define the command \workscited{bib}{style}{nocite}
+% ^^A%\newcommand{\workscited}[3]{%
+% ^^A%  \ifx\chapter\@undefined%
+% ^^A%    \addcontentsline{toc}{chapter}{\bfseries\bibname}% report style
+% ^^A%  \else
+% ^^A%    \addcontentsline{toc}{section}{\bfseries\refname}% article style
+% ^^A%  \fi
+% ^^A%  \bibliography{#1}\bibliographystyle{#2}\nocite{#3}}
+% ^^A% \fi
+% ^^A\newcommand{\annote}[1]{\begin{list}{}{%
+% ^^A                \setlength{\labelwidth}{0pt}
+% ^^A                \addtolength{\leftmargin}{\parindent}
+% ^^A                \setlength{\labelsep}{0pt}}%
+% ^^A                \item #1 \end{list}}
+% \subsubsection{Plain Style}
+% \begin{macro}{\citeC}
+% This next block is used only if the \Lopt{compat} option is set.
+%    \begin{macrocode}
+\else
+  \newcommand{\mlastyle@cite}[2][]{\@tempswafalse\@citex[]{#2}}
+  \let\cite\mlastyle@cite
+  \let\citepage\mlastyle@cite
+  \let\citeindirect\mlastyle@cite
+  \newcommand{\citeC}[2][]{ \@tempswafalse\@citex[]{#2}}
+  \let\citeM\mlastyle@relax
+  \let\citepageM\mlastyle@relax
+  \let\citeindirectM\mlastyle@relax
+\fi
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \iffalse
+%</package>
+% \fi
+%
+% \Finale
+\endinput
diff --git a/mlastyle.ins b/mlastyle.ins
new file mode 100644 (file)
index 0000000..b7008af
--- /dev/null
@@ -0,0 +1,56 @@
+%%
+%% Copyright (C) 2003 by Scott Pakin <pakin@uiuc.edu>
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.2 of this license
+%% or (at your option) any later version.  The latest version of this
+%% license is in:
+%% 
+%%    http://www.latex-project.org/lppl.txt
+%% 
+%% and version 1.2 or later is part of all distributions of LaTeX version
+%% 1999/12/01 or later.
+%%
+
+\input docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/mlastyle}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2003 by Scott Pakin <pakin@uiuc.edu>
+
+This file may be distributed and/or modified under the conditions of
+the LaTeX Project Public License, either version 1.2 of this license
+or (at your option) any later version.  The latest version of this
+license is in:
+
+   http://www.latex-project.org/lppl.txt
+
+and version 1.2 or later is part of all distributions of LaTeX version
+1999/12/01 or later.
+
+\endpreamble
+
+\askforoverwritefalse
+\generate{\file{mlastyle.sty}{\from{mlastyle.dtx}{package}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{*                                                           *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX:                    *}
+\Msg{*                                                           *}
+\Msg{*     mlastyle.sty                                          *}
+\Msg{*                                                           *}
+\Msg{* To produce the documentation run the file mlastyle.dtx    *}
+\Msg{* through LaTeX.                                            *}
+\Msg{*                                                           *}
+\Msg{* Happy TeXing!                                             *}
+\Msg{*                                                           *}
+\Msg{*************************************************************}
+
+\endbatchfile