% ****** Start of file prabib.sty ******
%
%
%   This file is part of the APS files in the REVTeX 3.0 distribution.
%   Version 3.0 of REVTeX, November 10, 1992.
%
%   Copyright (c) 1992 The American Physical Society.
%
%   See the REVTeX 3.0 README file for restrictions and more information.
%

\typeout{Filename: prabib.sty, v3.0 <9/14/92>}

\def\@bibitem#1{\item\if@filesw \immediate\write\@auxout
{\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces}

\newdimen\WidestRefLabelThusFar

\global\WidestRefLabelThusFar\z@

\def\bibcite#1#2{\global\@namedef{b@#1}{#2}\@SetMaxRefLabel{#1}}

\def\@SetMaxRefLabel#1{%
{%
\if\@ExpandsToRefNumber{#1}%
\setbox0\hbox{\ifpreprintsty\@normalsize\else\small\fi
\rm[\csname b@#1\endcsname]}%
\else %
\setbox0\hbox{\ifpreprintsty\@normalsize\else\small\fi
$\scriptstyle\m@th{\csname b@#1\endcsname}$}%
\fi
\ifdim\wd0>\WidestRefLabelThusFar
\global\WidestRefLabelThusFar=\wd0
\fi
}%
}

\def\@ExpandsToRefNumber #1{%
TT\fi %
\@ifundefined{b@#1}%
{\@tempcntb=1
}%
{\edef\@tempb{\csname b@#1\endcsname}%
\def\@tempa{\@temptokena=\bgroup}%
\if0A { \else  \fi %
\afterassignment\@tempa
\@tempcntb=0\@tempb}%
}%
\ifnum\@tempcntb>0 %
}%

\def\cite{\@ifnextchar[{\@tempswatrue\@citex}{\@tempswafalse\@citex[]}}
\let\CITE\cite
\let\onlinecite\cite

\def\@citex[#1]#2{%
\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
\leavevmode\unskip\ \@cite{\@collapse{#2}}{#1}}

\def\@bylinecite{%
\@ifnextchar[{\@tempswatrue\@CITEX}{\@tempswafalse\@CITEX[]}%
}

\def\@CITEX[#1]#2{%
\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
\leavevmode\unskip$^{\scriptstyle\@CITE{\@collapse{#2}}{#1}}$}

\def\@cite#1#2{[{#1\if@tempswa , #2\fi}]} %
\def\@CITE#1#2{{#1\if@tempswa , #2\fi}} %

\def\@lbibitem[#1]#2{\item[\@BIBLABEL{#1}]\if@filesw
{\def\protect##1{\string ##1\space}\immediate
\write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}

\def\@biblabel#1{{[#1]}} %
\def\@BIBLABEL#1{$^{#1}\m@th$} %

\def\references{%
\ifpreprintsty
\newpage
\hbox to\hsize{\hss\large \refname\hss}%
\else
\vskip24pt
\hrule width\hsize\relax
\vskip 1.6cm
\fi
\list{\@biblabel{\arabic{enumiv}}}%
{\labelwidth\WidestRefLabelThusFar  \labelsep4pt %
\leftmargin\labelwidth %
\advance\leftmargin\labelsep %
\ifdim\baselinestretch pt>1 pt %
\parsep  4pt\relax %
\else %
\parsep  0pt\relax %
\fi
\itemsep\parsep %
\usecounter{enumiv}%
\let\p@enumiv\@empty
\def\theenumiv{\arabic{enumiv}}%
}%
\let\newblock\relax %
\sloppy\clubpenalty4000\widowpenalty4000
\sfcode`\.=1000\relax
\ifpreprintsty\else\small\fi
}

\def\endreferences{%
\def\@noitemerr{\@warning{Empty `thebibliography' environment}}%
\endlist     \let\@SetMaxRefLabel\@gobble
}

\def\thebibliography#1{\references}

\def\endthebibliography{\endreferences}

\def\@collapse#1{%
{%
\let\@temp\relax
\@tempcntb\@MM
\def\@citea{}%
\@for \@citeb:=#1\do{%
\@ifundefined{b@\@citeb}%
{\@temp\@citea{\bf ?}%
\@tempcntb\@MM\let\@temp\relax
\@warning{Citation `\@citeb ' on page \thepage\space undefined}%
}%
{\@tempcnta\@tempcntb \advance\@tempcnta\@ne
\edef\MyTemp{\csname b@\@citeb\endcsname}%
\def\@tempa{\@temptokena=\bgroup}%
\if0A{\fi%
\afterassignment\@tempa %
\@tempcntb=0\MyTemp\relax}%
\ifnum\@tempcntb=0\relax%
\@tempcntb=\@MM
\@citea\MyTemp
\let\@temp = \relax
\else %
\edef\@tempd{\number\@tempcntb}%
\ifnum\@tempcnta=\@tempcntb %
\ifx\@temp\relax %
\edef\@temp{\@citea\@tempd}%
\else
\edef\@temp{\hbox{--}\@tempd}%
\fi
\else %
\@temp\@citea\@tempd
\let\@temp\relax
\fi
\fi
}%
\def\@citea{,}%
}%
\@temp %
}%
}%
%
% ****** End of file prabib.sty ******

