% altcite.sty   created 01/31/94 by bert@mit.edu
%
% Substyle to allow an ``alternative'' citation style that looks like
% author (date) and can be intermixed with the normal citation style.

%%% NOTE: This is a crock, adapted from LaTeX 2.09 code.
%%% If this stuff changes in later versions of LaTeX, this'll probably break.
%%% Also, the date must NOT start with a closed paren.  =)

\def\altcite%
{\@ifnextchar [{\@tempswatrue\alt@citex}{\@tempswafalse\alt@citex[]}}

\def\alt@citex[#1]#2%
{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  \def\@citea{}\alt@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{,\penalty\@m\ }\@ifundefined
       {b@\@citeb}{{\bf ?}\@warning
       {Citation `\@citeb' on page \thepage \space undefined}}%
\hbox{\expandafter\alt@crock\csname b@\@citeb\endcsname}}}{#1}}

\def\alt@crock#1{\expandafter\alt@break#1, )}
\def\alt@break#1, {#1 (\@ifnextchar ){{\bf ?}}{\alt@fix}}
\def\alt@fix#1, ){#1)}

\def\alt@cite#1#2{{#1\if@tempswa , #2\fi}}
