Added \urldate and \theurldate
[latex-mlastyle.git] / mlastyle.dtx
index bdcb18fbe7646b6af551b598d42a43454a916dca..038c4510a86057ff27df8795ecf5628524ebe4a5 100644 (file)
@@ -123,26 +123,22 @@ Schlegl",
 %
 % \GetFileInfo{mlastyle.sty}
 %
-% \DoNotIndex{\ }
-% \DoNotIndex{\.}
+% \DoNotIndex{\ ,\:,\/}
 % \DoNotIndex{\@afterindentfalse,\@afterindenttrue}
 % \DoNotIndex{\@arabic}
 % \DoNotIndex{\@author}
 % \DoNotIndex{\@auxout}
-% \DoNotIndex{\@citea,\@citeb}
+% \DoNotIndex{\@biblabel,\@citea,\@citeb,\@citex}
 % \DoNotIndex{\@date}
 % \DoNotIndex{\@empty}
 % \DoNotIndex{\@for}
 % \DoNotIndex{\@ifnextchar,\@ifstar,\@ifundefined}
 % \DoNotIndex{\@latex@warning}
 % \DoNotIndex{\@listI}
-% \DoNotIndex{\@listi}
-% \DoNotIndex{\@listii}
-% \DoNotIndex{\@listiii}
-% \DoNotIndex{\@listiv}
-% \DoNotIndex{\@listv}
-% \DoNotIndex{\@listvi}
+% \DoNotIndex{\@listi,\@listii,\@listiii}
+% \DoNotIndex{\@listiv,\@listv,\@listvi}
 % \DoNotIndex{\@m}
+% \DoNotIndex{\@noitemerr}
 % \DoNotIndex{\@startsection}
 % \DoNotIndex{\@tempswafalse}
 % \DoNotIndex{\@title}
@@ -151,9 +147,12 @@ Schlegl",
 % \DoNotIndex{\ExecuteOptions}
 % \DoNotIndex{\G@refundefinedtrue}
 % \DoNotIndex{\NAT@@citetp,\NAT@citetp,\NAT@ctype,\NAT@date,\NAT@sep}
+% \DoNotIndex{\ifNAT@par,\ifNAT@swa}
 % \DoNotIndex{\ProcessOptions}
 % \DoNotIndex{\RequirePackage}
 % \DoNotIndex{\UL@start,\UL@stop}
+% \DoNotIndex{\url@samestyle,\urlstyle,\UrlBigBreaks,\UrlBreakPenalty}
+% \DoNotIndex{\do@url@hyp}
 % \DoNotIndex{\addtolength}
 % \DoNotIndex{\advance}
 % \DoNotIndex{\baselineskip}
@@ -192,7 +191,7 @@ Schlegl",
 % \DoNotIndex{\headrulewidth}
 % \DoNotIndex{\if@filesw}
 % \DoNotIndex{\if@tempswa}
-% \DoNotIndex{\ifcase}
+% \DoNotIndex{\ifcase,\ifhmode,\ifnum}
 % \DoNotIndex{\ifmlastyle@bibstyle}
 % \DoNotIndex{\ifmlastyle@format}
 % \DoNotIndex{\ifmlastyle@pages}
@@ -215,6 +214,7 @@ Schlegl",
 % \DoNotIndex{\linespread}
 % \DoNotIndex{\list}
 % \DoNotIndex{\listparindent}
+% \DoNotIndex{\mathchardef}
 % \DoNotIndex{\makeenmark}
 % \DoNotIndex{\mbox}
 % \DoNotIndex{\ml@}
@@ -226,6 +226,7 @@ Schlegl",
 % \DoNotIndex{\mlastyle@formattrue}
 % \DoNotIndex{\mlastyle@instructor}
 % \DoNotIndex{\mlastyle@intbib}
+% \DoNotIndex{\mlastyle@intnfs}
 % \DoNotIndex{\mlastyle@pagesfalse}
 % \DoNotIndex{\mlastyle@pagestrue}
 % \DoNotIndex{\mlastyle@papersizefalse}
@@ -235,6 +236,7 @@ Schlegl",
 % \DoNotIndex{\mlastyle@slash}
 % \DoNotIndex{\mlastyle@slashnext}
 % \DoNotIndex{\mlastyle@slashx}
+% \DoNotIndex{\mlastyle@star}
 % \DoNotIndex{\mlastyle@stylefalse}
 % \DoNotIndex{\mlastyle@styletrue}
 % \DoNotIndex{\mlastyle@surname}
@@ -242,6 +244,7 @@ Schlegl",
 % \DoNotIndex{\mlastyle@timestrue}
 % \DoNotIndex{\mlastyle@underlinefalse}
 % \DoNotIndex{\mlastyle@underlinetrue}
+% \DoNotIndex{\mlastyle@urldate}
 % \DoNotIndex{\month}
 % \DoNotIndex{\newblock}
 % \DoNotIndex{\newcommand}
@@ -280,6 +283,7 @@ Schlegl",
 % \DoNotIndex{\usecounter}
 % \DoNotIndex{\unskip}
 % \DoNotIndex{\vskip}
+% \DoNotIndex{\xdef}
 % \DoNotIndex{\write}
 % \DoNotIndex{\year}
 % \DoNotIndex{\z@}
@@ -621,15 +625,26 @@ Schlegl",
 \let\lastname\surname
 %    \end{macrocode}
 % \end{macro}
-
+% \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[\mlastyle@space]{\mlastyle@brack(}{\mlastyle@brack)}%
-    {\unskip;}{a}{\mlastyle@comma}{,}
+  \bibpunct[ ]{(}{)}{;}{a}{,}{,}
+  %\bibpunct[\mlastyle@space]{\mlastyle@brack(}{\mlastyle@brack)}%
+  %  {\unskip;}{a}{\mlastyle@comma}{,}
   \gdef\mlastyle@brack##1{\ifx\NAT@date\mlastyle@notitle
     \ifmlastyle@pages ##1\else\ifNAT@swa\ifnum
     \NAT@ctype=0 ##1\else\unskip\fi\else\unskip\fi\fi\else ##1\fi}
@@ -757,16 +772,22 @@ Schlegl",
 % \end{macro}
 % \end{macro}
 % \subsection{Formatting}
-% Formatting is done if the \Lopt{mla} or \Lopt{format} option is set.
+% \begin{macro}{\urlstyle@mlastyle}
+% This first bit is always done, even if formatting is disabled.
 %    \begin{macrocode}
-\ifmlastyle@format
 %    \end{macrocode}
+% \end{macro}
 % \begin{macro}{\mlastyle@i}
 % This is the standard MLA format indent.
 %    \begin{macrocode}
   \newdimen\mlastyle@i \mlastyle@i=.5in
 %    \end{macrocode}
 % \end{macro}
+% Everything else is done only if the \Lopt{mla} or \Lopt{format} option
+% is set.
+%    \begin{macrocode}
+\ifmlastyle@format
+%    \end{macrocode}
 % \subsubsection{Macros}
 % \begin{macro}{\maketitle}
 % \begin{macro}{\and}
@@ -795,7 +816,7 @@ Schlegl",
 % No penalty for |\slash|.
 % ^^A\let\mlastyle@sl@sh=/
 %    \begin{macrocode}
-  \def\slash{/\penalty\z@}
+  \edef\slash{/\penalty\z@}
 %    \end{macrocode}
 % ^^A \def\mlastyle@slash{/\futurelet\mlastyle@slashnext\mlastyle@slashx}
 % ^^A \def\mlastyle@slashx{\ifx\mlastyle@slashnext/\else
@@ -955,6 +976,9 @@ Schlegl",
   \def\footnotesize{\normalsize}
 %    \end{macrocode}
 % ^^A\let\footnoterule\relax
+% \begin{macro}{\enoteformat}
+% \begin{macro}{\enoteheading}
+% \begin{macro}{\enotesize}
 % Endnotes are supported, but only if the \package{endnotes} package is
 % loaded {\em before\/} this package.
 %    \begin{macrocode}
@@ -964,16 +988,27 @@ Schlegl",
     \def\enotesize{\normalsize}
   \fi
 %    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
 % \subsubsection{Bibliography}
-% \textsc{To Do}: Switch to the \package{url} package.
+% \begin{macro}{\url@mlastyle}
+% |\url| is needed to format urls in the bibliography.
 %    \begin{macrocode}
-\ifx\@undefined\url{
-  \catcode`/=13
-    \gdef\url{\bgroup\catcode`/=13
-    \let/\slash\mlastyle@url}
-    \gdef\mlastyle@url#1{#1\egroup}
-}\fi
+\RequirePackage{url}
+\def\url@mlastyle{\url@samestyle
+  \mathchardef\UrlBreakPenalty 0
+  \def\UrlBigBreaks{\do\/\do@url@hyp}
+  }
+\urlstyle{mla}
 %    \end{macrocode}
+% \end{macro}
+% ^^A\ifx\@undefined\url{
+% ^^A  \catcode`/=13
+% ^^A    \gdef\url{\bgroup\catcode`/=13
+% ^^A    \let/\slash\mlastyle@url}
+% ^^A    \gdef\mlastyle@url#1{#1\egroup}}
+% ^^A}\fi
 % \begin{environment}{thebibliography}
 % The definition of |thebibliography| varies depending on the document
 % class.