diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/sttools/stabular.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/sttools/stabular.sty | 145 |
1 files changed, 59 insertions, 86 deletions
diff --git a/Master/texmf-dist/tex/latex/sttools/stabular.sty b/Master/texmf-dist/tex/latex/sttools/stabular.sty index 9f7a7ee9736..0ac82f47fc7 100644 --- a/Master/texmf-dist/tex/latex/sttools/stabular.sty +++ b/Master/texmf-dist/tex/latex/sttools/stabular.sty @@ -6,7 +6,7 @@ %% %% stabular.dtx (with options: `package') %% -%% Copyright (C) 1998-2012 by Sigitas Tolu\v{s}is <sigitas@vtex.lt> +%% Copyright (C) 1998-2014 by Sigitas Tolu\v{s}is <sigitas@vtex.lt> %% VTeX Ltd., Akademijos 4, Vilnius, Lithuania %% http://www.vtex.lt/tex/download/macros/ %% -------------------------------------------------------------------------- @@ -22,94 +22,20 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{stabular} - [2014/01/13 v1.2 Improve tabular environment] + [2014/03/20 v2.0 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}% - } +\ProvidesPackage{stabular}[2014/03/20] +\def\use@@pkg@@array@@variant{0} +\DeclareOption{array}{\def\use@@pkg@@array@@variant{1}} +\ProcessOptions* +\def\stabular{\let\@halignto\@empty\@stabular} \def\endstabular{\crcr\egroup\egroup\egroup} +\@namedef{stabular*}#1{% + \setlength\dimen@{#1}% + \edef\@halignto{to\the\dimen@}% + \@tabular + } \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 @@ -139,6 +65,53 @@ \lineskip\z@skip \baselineskip\z@skip \@preamble } +\def\pkgarray@@sarray[#1]#2{% + \@tempdima \ht \strutbox + \advance \@tempdima by\extrarowheight + \setbox \@arstrutbox \hbox{\vrule + \@height \arraystretch \@tempdima + \@depth \arraystretch \dp \strutbox + \@width \z@}% + \begingroup + \@mkpream{#2}% + \xdef\@preamble{\noexpand \ialign \@halignto + \bgroup \@arstrut \@preamble + \tabskip \z@ \cr}% + \endgroup + \@arrayleft + \bgroup + \let\@sharp##\let\protect\relax + \lineskip\z@ \baselineskip\z@ + \m@th + \let\\\@arraycr \let\tabularnewline\\ + %%\let\par\@empty + \@preamble + } +\def\pkgarray@@stabarray{\@ifnextchar[{\pkgarray@@sarray}{\pkgarray@@sarray[c]}} +\def\pkgarray@stabular{\gdef\@halignto{}\pkgarray@@stabular} +\expandafter\def\csname pkgarray@stabular*\endcsname#1{% + \setlength\dimen@{#1}% + \xdef\@halignto{to\the\dimen@}\pkgarray@@stabular} +\def\pkgarray@@stabular{% + \leavevmode + \bgroup + \col@sep\tabcolsep + \let\d@llarbegin\begingroup + \let\d@llarend\endgroup + \pkgarray@@stabarray + } +\def\pkgarray@endstabular{\crcr\egroup\egroup\gdef\@preamble{}\egroup} +\expandafter\let\csname pkgarray@endstabular*\endcsname\pkgarray@endstabular +\ifcase\use@@pkg@@array@@variant +\else + \@ifpackageloaded{array}{}{\RequirePackage{array}}% + \let\stabular\pkgarray@stabular + \expandafter\let\csname stabular*\expandafter\endcsname + \csname pkgarray@stabular*\endcsname + \let\endstabular\pkgarray@endstabular + \expandafter\let\csname endstabular*\expandafter\endcsname + \csname pkgarray@endstabular*\endcsname +\fi \endinput %% %% End of file `stabular.sty'. |