+% \begin{macro}{\urldate}
+% \begin{macro}{\theurldate}
+% These next two respectively set and get the default access date for URLs
+% in the works cited.
+% \begin{macrocode}
+\def\urldate#1{\gdef\mlastyle@urldate{#1}}
+\def\theurldate{\mlastyle@urldate}
+\let\mlastyle@urldate\@date
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \subsection{Style}
+% \begin{macro}{\bibstyle@mlastyle}
+% This first block is the beginnings of an implementation for
+% \package{natbib}. (Surely there is a better way to do this.)
+% \begin{macrocode}
+\newcommand{\bibstyle@mlastyle}{%
+ \bibpunct[ ]{(}{)}{;}{a}{,}{,}
+ \@ifundefined{chapter}
+ {\gdef\refname{Works Cited}}
+ {\gdef\bibname{Works Cited}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\NAT@citex}
+% The year field is normally empty but contains the title field if it is
+% needed. This is handled inconsistantly by \package{natbib}, so it is
+% fixed up here.
+% \begin{macrocode}
+\RequirePackage{natbib}
+\def\NAT@citex
+ [#1][#2]#3{%
+ \NAT@sort@cites{#3}%
+ \let\@citea\@empty
+ \let\@citec\@empty
+ \ifNAT@swa
+ \if*#1*\if*#2*\def\@citea{\def\@citec{\NAT@@close}\NAT@@open}\else
+ \NAT@@open\def\@citea{\def\@citec
+ {\NAT@cmt#2\NAT@@close}}\def\@citec{#2\NAT@@close}\fi\else
+ \NAT@@open#1\ \if*#2*\def\@citec{\unskip\NAT@@close}\else
+ \def\@citec{#2\NAT@@close}\def\@citea{\def\@citec
+ {\NAT@cmt#2\NAT@@close}}\fi\fi
+ \fi
+ \let\NAT@nm\@empty\let\NAT@year\@empty
+ \@for\@citeb:=\NAT@cite@list\do
+ {\edef\@citeb{\expandafter\@firstofone\@citeb}%
+ \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
+ \@ifundefined{b@\@citeb\@extra@b@citeb}{\@citea%
+ {\reset@font\bfseries ?}\NAT@citeundefined
+ \PackageWarning{natbib}%
+ {Citation `\@citeb' on page \thepage \space undefined}%
+ \def\NAT@date{}}%
+ {\let\NAT@last@nm=\NAT@nm\let\NAT@last@yr=\NAT@year
+ \NAT@parse{\@citeb}%
+ \ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
+ \let\NAT@name=\NAT@all@names
+ \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
+ \fi
+ \ifNAT@full\let\NAT@nm\NAT@all@names\else
+ \let\NAT@nm\NAT@name\fi
+ \ifNAT@swa\ifcase\NAT@ctype
+ \if*\NAT@date*
+ \@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
+ \NAT@nmfmt{\NAT@nm}\NAT@date\hyper@natlinkend
+ \else
+ \ifx\NAT@last@nm\NAT@nm\NAT@yrsep
+ \ifx\NAT@last@yr\@empty\let\NAT@last@yr\relax\fi
+ \ifx\NAT@last@yr\NAT@year
+ \def\NAT@temp{{?}}%
+ \ifx\NAT@temp\NAT@exlab\PackageWarningNoLine{natbib}%
+ {Multiple citation on page \thepage: same authors and
+ year\MessageBreak without distinguishing extra
+ letter,\MessageBreak appears as question mark}\fi
+ \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@exlab
+ \hyper@natlinkend
+ \else\unskip
+ \ \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@date
+ \hyper@natlinkend
+ \fi
+ \else\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
+ \NAT@nmfmt{\NAT@nm}%
+ \hyper@natlinkbreak{\NAT@aysep\ }{\@citeb\@extra@b@citeb}%
+ \NAT@date\hyper@natlinkend
+ \fi
+ \fi
+ \def\@citea{\NAT@sep\ }%
+ \or\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
+ \NAT@nmfmt{\NAT@nm}\hyper@natlinkend
+ \def\@citea{\NAT@sep\ }%
+ \or\if*\NAT@date*\else
+ \@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
+ \NAT@date\hyper@natlinkend
+ \def\@citea{\NAT@sep\ }\fi
+ \or\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
+ \NAT@alias\hyper@natlinkend
+ \def\@citea{\NAT@sep\ }%
+ \fi
+ \else\ifcase\NAT@ctype
+ \if*\NAT@date*
+ \@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
+ \NAT@nmfmt{\NAT@nm}\hyper@natlinkend
+ \if*#1*\def\@citea{\NAT@sep\ }%
+ \if*#2*\let\@citec\@empty\else
+ \def\@citec{\ \NAT@@open#2\NAT@@close}\fi
+ \else\ \NAT@@open\def\@citea{\NAT@@close\NAT@sep\ }
+ \if*#2*\def\@citec{\NAT@@close}\else
+ \def\@citec{\ #2\NAT@@close}\fi\fi
+ \else
+ \ifx\NAT@last@nm\NAT@nm\NAT@yrsep
+ \ifx\NAT@last@yr\NAT@year
+ \def\NAT@temp{{?}}%
+ \ifx\NAT@temp\NAT@exlab\PackageWarningNoLine{natbib}%
+ {Multiple citation on page \thepage: same authors and
+ year\MessageBreak without distinguishing extra
+ letter,\MessageBreak appears as question mark}\fi
+ \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@exlab
+ \hyper@natlinkend
+ \else\unskip
+ \ \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@date
+ \hyper@natlinkend
+ \fi
+ \else\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
+ \NAT@nmfmt{\NAT@nm}%
+ \hyper@natlinkbreak{\ \NAT@@open\if*#1*\else#1\ \fi}%
+ {\@citeb\@extra@b@citeb}%
+ \NAT@date\hyper@natlinkend\fi
+ \if*#2*\def\@citec{\NAT@@close}\else
+ \def\@citec{\NAT@cmt#2\NAT@@close}\fi
+ \def\@citea{\NAT@@close\NAT@sep\ }%
+ \fi
+ \or\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
+ \NAT@nmfmt{\NAT@nm}\hyper@natlinkend
+ \if*#2*\let\@citec\@empty\else
+ \def\@citec{ \NAT@@open#2\NAT@@close}\fi
+ \def\@citea{\NAT@sep\ }%
+ \or\if*\NAT@date*\else\@citea
+ \NAT@@open
+ \def\@citea{\NAT@@close\NAT@sep\ }%
+ \if*#2*\def\@citec{\NAT@@close}\else
+ \def\@citec{\NAT@cmt#2\NAT@@close}\fi
+ \hyper@natlinkstart{\@citeb\@extra@b@citeb}%
+ \NAT@date\hyper@natlinkend\fi
+ \or\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
+ \NAT@alias\hyper@natlinkend
+ \def\@citea{\NAT@sep\ }%
+ \fi
+ \fi
+ }}%
+ \@citec\ifhmode\unskip\fi\endgroup}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\NAT@parse@date}
+% |\NAT@parse@date| fails if the date contains a control sequence, so it
+% is also redefined.
+% \begin{macrocode}
+\def\NAT@parse@date#1#2#3#4#5#6@@{%
+ \ifcat\relax#1\def\NAT@year{}\def\NAT@exlab{}\else
+ \ifcat a#1\def\NAT@year{}\def\NAT@exlab{#1}\else
+ \ifcat a#2\def\NAT@year{#1}\def\NAT@exlab{#2}\else
+ \ifcat a#3\def\NAT@year{#1#2}\def\NAT@exlab{#3}\else
+ \ifcat a#4\def\NAT@year{#1#2#3}\def\NAT@exlab{#4}\else
+ \def\NAT@year{#1#2#3#4}\def\NAT@exlab{{#5}}\fi\fi\fi\fi\fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\cite}
+% \begin{macro}{\citealp}
+% ^^A\begin{macro}{\citepage}
+% ^^A\begin{macro}{\citequote}
+% The following macros, combined with \file{mlastyle.bst}, provide
+% for a bibliography in MLA style. Note that the definition of |\cite|,
+% |\citealp|, etc.\ vary depending on the options passed to
+% \package{mlastyle}.
+%
+% \begin{macro}{\mlastyle@intcite}
+% The original |\cite| 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, either |\citeC| or
+% |\citeM| and its ilk will utilize it.
+% \begin{macrocode}
+\newcommand{\mlastyle@relax}[2][]{\unskip}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{MLA Style}
+% \begin{macro}{\citeM}
+% If the \Lopt{mla} or \Lopt{style} options are used, the following is
+% executed.
+% \begin{macrocode}
+\ifmlastyle@style
+% \end{macrocode}
+% If the \Lopt{bibstyle} option is set, specify the bibliography style.
+% \begin{macrocode}
+ \ifmlastyle@bibstyle
+ \bibliographystyle{mlastyle}
+ \fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \let\cite\citep
+ \let\mlastyle@citequeue\@empty
+ \def\mlastyle@cite#1#2#3{\csname#1\endcsname[#2]{#3}}
+ \newcommand\citeflush{\ifhmode\unskip\fi
+ \ifx\mlastyle@citequeue\@empty\else\ \let\@citea\relax
+ \citetext{\@for\@citeb:=\mlastyle@citequeue\do{\@citea
+ \expandafter\mlastyle@cite\@citeb\def\@citea{\NAT@sep\ }}}%
+ \global\let\mlastyle@citequeue\@empty\fi}
+ \newcommand\mlastyle@citeadd[3]{\ifx\mlastyle@citequeue\@empty
+ \xdef\mlastyle@citequeue{{#1}{#2}{#3}}\else
+ \xdef\mlastyle@citequeue{\mlastyle@citequeue,%
+ {#1}{#2}{#3}}\fi}
+ \newcommand\citeadd[2][]{\mlastyle@citeadd{citealp}{#1}{#2}}
+ \newcommand\citea{\@ifstar
+ {\let\mlastyle@star*\mlastyle@citea}
+ {\let\mlastyle@star\@empty\mlastyle@citea}}
+ \newcommand\mlastyle@citea[2][]{\expandafter\citeauthor
+ \mlastyle@star{#2}\mlastyle@citeadd{citeyear}{#1}{#2}}
+ \newcommand\Citea{\@ifstar
+ {\let\mlastyle@star*\mlastyle@Citea}
+ {\let\mlastyle@star\@empty\mlastyle@Citea}}
+ \newcommand\mlastyle@Citea[2][]{\expandafter\Citeauthor
+ \mlastyle@star{#2}\mlastyle@citeadd{citeyear}{#1}{#2}}
+ \newcommand\citepage[2][]{\citeyearpar[#1]{#2}}
+ \newcommand\citepageM[2][]{\unskip\ \citeyearpar[#1]{#2}}
+ \newcommand\citeindirect[2][]{\citep[qtd.\ in][#1]{#2}}
+ \newcommand\citeindirectM[2][]{\unskip{} \citep[qtd.\ in][#1]{#2}}
+ \let\citeN\citealp
+ \let\citeC\mlastyle@relax
+% \end{macrocode}
+% \subsubsection{Plain Style}
+% \begin{macro}{\citeC}
+% This next block is used if the \Lopt{compat} or \Lopt{format} option is
+% set.
+% \begin{macrocode}
+\else
+% \end{macrocode}
+% If the \Lopt{bibstyle} option is set, specify the bibliography style.
+% \begin{macrocode}
+ \ifmlastyle@bibstyle
+ \bibliographystyle{plain}
+ \fi
+ \ifx\@undefined\citet
+ \newcommand{\mlastyle@cite}[2][]{\@tempswafalse\@citex[]{#2}}
+ \newcommand{\citeC}[2][]{~\@tempswafalse\@citex[]{#2}}
+ \else
+ \newcommand{\mlastyle@cite}[2][]{\citep[]{#2}}
+ \def\citeC{ \citep}
+ \fi
+ \let\cite\mlastyle@cite
+ \let\citepage\mlastyle@cite
+ \let\citeindirect\mlastyle@cite
+ \let\citeM\mlastyle@relax
+ \let\citepageM\mlastyle@relax
+ \let\citeindirectM\mlastyle@relax
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% ^^A\end{macro}
+% ^^A\end{macro}
+% \end{macro}
+% \end{macro}