%% hilbert.sty - Version 0.1.0 (5 May 2007)
%% Robert Rothenberg <rr at cs dot st-andrews dot ac dot uk>

%% This program is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by
%% the Free Software Foundation; either version 2 of the License, or
%% (at your option) any later version.
 
%% This program is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%% GNU General Public License for more details.

\usepackage{array,ifthen,amsmath}

\def\theoremwidth{70mm}
\def\reasonwidth{20mm}

\def\@eqnnum{{\normalfont \normalcolor (\theequation)}}

\newcounter{hilbert}

\newenvironment{hilbert}[1][0]{
  \refstepcounter{equation}
  \vspace{2ex}
  \begin{@hilbert}[#1]
}{
  \end{@hilbert}
  \hfill\hbox{\@eqnnum}%
  \vspace{2ex}
}

\newenvironment{hilbert*}[1][0]{
  \vspace{2ex}
  \begin{@hilbert}[#1]
}{
  \end{@hilbert}
  \vspace{2ex}
}

\newenvironment{@hilbert}[1][0]{
  \setcounter{hilbert}{#1}
  \noindent \begin{tabular}{r>{\(}p{\theoremwidth}<{\)}p{\reasonwidth}}
}{
  \end{tabular}
}
 
\renewcommand{\thehilbert}{\arabic{hilbert}}

\newcommand{\hi}[1][]{
 \refstepcounter{hilbert}
 \ifthenelse{\not\equal{#1}{}}{\label{#1}}{}
  \thehilbert. &
}

\newcommand{\ha}{ & }




