
\typeout{eqlist.sty by M. Vaeth: Revision 2.1}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{eqlist}[2002/08/15 v2.1]

\RequirePackage{eqparbox}

\newenvironment{eqlist}[1][\eqlistinit]{\eql@start{#1}}{\eql@end}
\newenvironment{eqlist*}[1][\eqliststarinit]{\eql@start{#1}}{\eql@end}
\newenvironment{Eqlist}[2][\eqlistinit]{\eql@startp{#1}{#2}}{\eql@end}
\newenvironment{Eqlist*}[2][\eqliststarinit]{\eql@startp{#1}{#2}}{\eql@end}

\ifx\eqlistinitpar\undefined
  \def\eqlistinitpar{\relax\listparindent\parindent\relax\parsep\parskip\relax}
\fi
\ifx\eqlistinit\undefined
  \def\eqlistinit{\eqlistinitpar}
\fi
\ifx\eqliststarinit\undefined
  \def\eqliststarinit{\topsep0pt\relax\itemsep0pt\relax%\partopsep0pt\relax
    \eqlistinitpar}
\fi
\ifx\eqlistlabel\undefined
  \def\eqlistlabel#1{#1}
\fi

\newcount\eql@cnt\relax\eql@cnt=0

\long\def\eql@start#1{\global\advance\eql@cnt by1\begin{list}{}{\expandafter
  \eql@mainprepn\expandafter{\romannumeral\eql@cnt}{#1}}}
\long\def\eql@startp#1#2{\begin{list}{}{\eql@mainprep{#2}{#1}}}
\def\eql@end{\end{list}}

\long\def\eql@mainprep#1#2{\let\longitem\eql@longitem
  \let\eqlistauto\eql@auto
  \let\eqlistnoauto\eql@noauto
  \def\eql@makelabel##1{\eqparbox[b]{#1}{\eql@long{##1}}\hfil}%
  \let\eql@normal\eql@makelabel
  \let\eql@current\eql@makelabel
  \setlength{\labelwidth}{\eqboxwidth{#1}}%
  \setlength{\leftmargin}{\labelwidth}%
  \let\makelabel\eqlistlabel
  #2\addtolength{\leftmargin}{\labelsep}%
  \let\eql@long\makelabel\def\makelabel{\eql@makelabel}}
\def\eql@mainprepn#1{\eql@mainprep{eqlistbox#1}}

\newcommand{\longitem}{\eql@illlegal\longitem\item}
\def\eql@longitem[#1]{\let\eql@makelabel\eql@long
  \item[#1]\let\eql@makelabel\eql@current}

\newcommand{\eqlistauto}[1]{\eql@illegal\eqlistauto}
\def\eql@auto#1{\def\eql@makelabel##1{\setbox0\hbox{\eql@long{##1}}%
    \ifdim#1>\wd0\relax
      \expandafter\eql@normal
    \else
      \expandafter\eql@long
    \fi{##1}}%
  \let\eql@current\eql@makelabel}
\newcommand{\eqlistnoauto}{\eql@illegal\eqlistnoauto}
\def\eql@noauto{\let\eql@makelabel\eql@normal\let\eql@current\eql@makelabel}
\def\eql@illegal#1{\errmessage{\string#1
  can only be used in eqlist or Eqlist environment}}

\endinput
%%
%% End of file `eqlist.sty'.
