Began work on \citeadd and \citeflush
authorTim Pope <code@tpope.net>
Thu, 20 Nov 2003 20:17:35 +0000 (20:17 +0000)
committerTim Pope <code@tpope.net>
Thu, 20 Nov 2003 20:17:35 +0000 (20:17 +0000)
Added \and definition to default surname

mlastyle.dtx

index 50847e0afe41f1fdeb6064bb4a1e80329ceff051..6aead1c72050814050113c37526bdc91bb2c28c3 100644 (file)
@@ -619,7 +619,7 @@ Schlegl",
 %    \begin{macrocode}
 \def\surname#1{\gdef\mlastyle@surname{#1}}
 \def\mlastyle@surname{\def\ml@##1 ##2,##3@@{##2}%
 %    \begin{macrocode}
 \def\surname#1{\gdef\mlastyle@surname{#1}}
 \def\mlastyle@surname{\def\ml@##1 ##2,##3@@{##2}%
-  \expandafter\ml@\@author, ,@@}
+  \def\and##1 {\unskip, }\expandafter\ml@\@author, ,@@}
 \let\lastname\surname
 %    \end{macrocode}
 % \end{macro}
 \let\lastname\surname
 %    \end{macrocode}
 % \end{macro}
@@ -951,13 +951,27 @@ Schlegl",
 %    \begin{macrocode}
   \let\cite\citep
   \let\mlastyle@citequeue\empty
 %    \begin{macrocode}
   \let\cite\citep
   \let\mlastyle@citequeue\empty
-  %\newcommand\citeflush{\ifx\mlastyle@citequeue\@empty\unskip
-    %\else\citetext{\mlastyle@citequeue}\global
-    %\let\mlastyle@citequeue\@empty\fi}
-  %\newcommand\citeadd[2][]{\ifx\mlastyle@citequeue\@empty
-    %\protected@xdef\mlastyle@citequeue{\citealp[#1]{#2}}\else
-    %\protected@xdef\mlastyle@citequeue{\mlastyle@citequeue\NAT@sep
-    %\ {\citealp[#1]{#2}}\fi}
+  \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\citepage[2][]{\citeyearpar[#1]{#2}}
   \newcommand\citepageM[2][]{\unskip{} \citeyearpar[#1]{#2}}
   \newcommand\citeindirect[2][]{\citep[qtd.\ in][#1]{#2}}