%%
%% This is file `stabular.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% stabular.dtx  (with options: `package')
%% 
%% Copyright (C) 1998-2012 by Sigitas Tolu\v{s}is <sigitas@vtex.lt>
%% VTeX Ltd., Akademijos 4, Vilnius, Lithuania
%% http://www.vtex.lt/tex/download/macros/
%% --------------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% PURPOSE:   Improve tabular environment.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{stabular}
    [2012/05/29 v1.1 Improve tabular environment]
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{stabular}[1998/03/19]
\def\empty@finalstrut#1{%
  \unskip
  \ifhmode\nobreak\fi
  \vrule\@width\z@\@height\z@\@depth\z@
  }
\def\no@strut{%
  \global\setbox\@arstrutbox\hbox{%
    \vrule \@height\z@
           \@depth\z@
           \@width\z@
    }%
  \gdef\@endpbox{\empty@finalstrut\@arstrutbox\par\egroup\hfil}%
  }%
\def\yes@strut{\global\setbox\@arstrutbox\hbox{%
    \vrule \@height\arraystretch \ht\strutbox
           \@depth\arraystretch \dp\strutbox
           \@width\z@}%
    \gdef\@endpbox{\@finalstrut\@arstrutbox\par\egroup\hfil}%
}%
\def\@mkpream#1{\@firstamptrue\@lastchclass6
  \let\@preamble\@empty\def\empty@preamble{\add@ins}%
  \let\protect\@unexpandable@protect
  \let\@sharp\relax
  \let\add@ins\relax
  \let\@startpbox\relax
  \let\@endpbox\relax
  \@expast{#1}%
  \expandafter\@tfor \expandafter
    \@nextchar \expandafter:\expandafter=\reserved@a\do
       {\@testpach\@nextchar
    \ifcase \@chclass \@classz \or \@classi \or \@classii \or \@classiii
      \or \@classiv \or\@classv \fi\@lastchclass\@chclass}%
  \ifcase \@lastchclass \@acol
      \or \or \@preamerr \@ne\or \@preamerr \tw@\or \or \@acol \fi
  }
\def\@addamp{%
  \if@firstamp
    \@firstampfalse
    \edef\empty@preamble{\add@ins}%
  \else
    \edef\@preamble{\@preamble &}%
    \edef\empty@preamble{\expandafter\noexpand\empty@preamble &\add@ins}%
  \fi
  }
\newif\iftw@hlines \tw@hlinesfalse
\def\@xhline{%
  \ifx\reserved@a\hline
    \tw@hlinestrue
  \else
    \ifx\reserved@a\Hline
      \tw@hlinestrue
    \else
      \tw@hlinesfalse
    \fi
  \fi
  \iftw@hlines
    \aftergroup\do@after
  \fi
  \ifnum0=`{\fi}%
  }
\def\do@after{\emptyrow[\the\doublerulesep]}
\def\emptyrow{\noalign\bgroup
  \@ifnextchar[\@emptyrow{\@emptyrow[\z@]}%
  }
\def\@emptyrow[#1]{%
    \no@strut
    \gdef\add@ins{\vrule \@height\z@ \@depth#1 \@width\z@}%
  \egroup
  \empty@preamble\\
  \noalign{%
    \yes@strut
    \gdef\add@ins{\vrule \@height\z@ \@depth\z@ \@width\z@}%
    }%
  }
\def\tabrow#1{\noalign\bgroup
  \@ifnextchar[{\@tabrow{#1}}{\@tabrow{#1}[]}%
  }
\def\@tabrow#1[#2]{\no@strut\egroup
  #1\ifx.#2.\\\else\\[#2]\fi
  \noalign{\yes@strut}%
  }
\def\endstabular{\crcr\egroup\egroup\egroup}
\expandafter\let\csname endstabular*\endcsname\endstabular
\def\stabular{\let\@halignto\@empty\@stabular}
\@namedef{stabular*}#1{\def\@halignto{to#1}\@stabular}
\def\@stabular{\leavevmode
  \bgroup
    \let\@acol\@tabacol
    \let\@classz\@tabclassz
    \let\@classiv\@tabclassiv
    \let\\\@tabularcr
    \@stabarray
  }
\def\@stabarray{\m@th\@ifnextchar[\@sarray{\@sarray[c]}}
\def\@sarray[#1]#2{%
  \bgroup
    \setbox\@arstrutbox\hbox{%
      \vrule \@height\arraystretch\ht\strutbox
             \@depth\arraystretch \dp\strutbox
             \@width\z@
             }%
  \@mkpream{#2}%
  \edef\@preamble{%
    \ialign \noexpand\@halignto
      \bgroup \@arstrut \@preamble \tabskip\z@skip \cr
    }%
  \let\@startpbox\@@startpbox \let\@endpbox\@@endpbox
  \let\tabularnewline\\
  \let\par\@empty
  \let\@sharp##%
  \set@typeset@protect
  \lineskip\z@skip \baselineskip\z@skip
  \@preamble
  }
\endinput
%%
%% End of file `stabular.sty'.
