3 \ifcat a\noexpand @\let\next\relax\else \def\next{%
4 \documentclass{kluwer}\usepackage{doc}\MakePercentIgnore}\fi\next
5 \def\filedate{1998/02/11}
6 \def\filename{klutab.sty}
7 %\DoNotIndex{\@M,\def,\c@secnumdepth,\baselineskip,\@pnumwidth,\else,\fi}
8 %\DoNotIndex{\newcommand,\z@,\relax,\renewcommand,\ifnum,\csname,\endcsname}
9 %\DoNotIndex{\baselineskip,\vskip,\hskip,\relax,\secdef,\gdef,\@cla,\@clb}
10 %\DoNotIndex{\normalsize,\protect,\global,\setbox,\hbox,\vbox,\endinput}
11 %\DoNotIndex{\egroup,\endgroup,\bgroup,\begingroup,\let}
13 %\changes{1997/02/12}{TH: Inserted definition of `array' to accomodate `hline'.}
14 %\newcommand{\Bs}{$\backslash$}
19 %\setlength{\marginparwidth}{0in}
20 %\addtolength{\textwidth}{4pc}
25 %\author{Kluwer Academic Publishers\surname{}}
28 % This internal stylefile takes care of tabulars.
34 % All of this is quite simple code. What happens
35 % is that some extra lines for use in tabulars are defined and
36 % included in the original definition of |tabular| and
37 % |tabular*|. These have a bit of extra vertical space which breaks
38 % the use of vertical rules in tabular's, which is why the old
39 % definitions are saved as |TABULAR| and |TABULAR*|.
41 % There are some variations on |\cline|. I moved internal commands out of the
42 % definition of |tabular| so they could be used in |tabular*| easily. \\[6pt]
43 % |\rcline| == hbox 3pt to the left\\
44 % |\lcline| == hbox 3pt to the right\\
45 % |\lrcline| == both \\
46 % |\rlcline| == |\lrcline| (to provide symmetry)
48 % All of the environments have
49 % been changed so that they also set the value of |\@tabwidth|, which
50 % is needed by |klufloa.sty|.
52 % |tabular*| has been adjusted to flush out the excess space over all
53 % columns instead of to the right of the last one. This is controlled
54 % by the value of |\stretchtabsep|, whose default value equals |\hfil|
56 %\newpage\section{Implementation}
58 \NeedsTeXFormat{LaTeX2e}
59 \ProvidesPackage{klutab}[\filedate ]
61 % \subsection{Tabular}
62 % First some needed values. The `array' things may not belong here,
63 % but is also not save to put them somewhere else. After all, \LaTeX\
64 % seems to think this is correct.
72 % Internal versions of the rules check whether first arg $>1$, and assign
73 % |\@tabklu@tmpa| accordingly. Next, execute |\@tabklu@tmpa| and
74 % unskip vertical width of rule. (All three are similar)
79 \global\advance\@cla\m@ne
81 \global\let\@tabklu@tmpa\@rclinea
83 \global\let\@tabklu@tmpa\@rclineb
86 \global\advance\@clb-\@cla }%
88 \noalign{\vskip-\arrayrulewidth}%
91 \multispan\@cla&\multispan\@clb
94 \leaders\hrule \@height \arrayrulewidth\hfill
100 \leaders\hrule \@height \arrayrulewidth\hfill
102 \def\@lcline[#1-#2]{%
104 \global\@cla #1\relax
105 \global\advance\@cla\m@ne
107 \global\let\@tabklu@tmpa\@lclinea
109 \global\let\@tabklu@tmpa\@lclineb
111 \global\@clb #2\relax
112 \global\advance\@clb-\@cla
114 \noalign{\vskip-\arrayrulewidth}%
117 \multispan\@cla&\multispan\@clb
119 \leaders\hrule \@height \arrayrulewidth\hfill
120 \hbox to 3pt{\hfil }\cr}%
124 \leaders\hrule \@height \arrayrulewidth\hfill
125 \hbox to 3pt{\hfil }\cr}%
126 \def\@lrcline[#1-#2]{%
128 \global\@cla #1\relax
129 \global\advance\@cla\m@ne
131 \global \let\@tabklu@tmpa\@lrclinea
133 \global \let\@tabklu@tmpa\@lrclineb
135 \global \@clb #2\relax
136 \global \advance\@clb-\@cla
139 \noalign{\vskip -\arrayrulewidth}%
142 \multispan\@cla&\multispan\@clb
143 \hbox to 3pt{\hfil }%
144 \unskip\leaders\hrule \@height \arrayrulewidth\hfill
145 \hbox to 3pt{\hfil }%
149 \hbox to 3pt{\hfil }%
150 \unskip\leaders\hrule \@height \arrayrulewidth\hfill
151 \hbox to 3pt{\hfil }%
154 % This is used for |tabular*|
156 \newlength\stretchtabsep
157 \setlength\stretchtabsep{0pt plus 1fil}
159 % |\hline| has been redefined to provide some extra vertical
160 % space. Unforunately, we could not do the same for |\cline| and
161 % friend, because there can be more than one in one row. The old value
162 % of |\hline| is saved in |\savehline| in case you need it.
164 % |\arraystretch| is left to it's default value, but we did want extra
165 % spacing, so |\strut| is redefined (indirectly) to give some.
167 % And then, the entire tabular is saved in a |\hbox| so we can measure
168 % it up later. (See above for why we need to know this). There is a
169 % grouping level added to stop definitions from running away, but
170 % maybe this isn't needed. Not sure.
173 \def\tabular{\begingroup
174 \def\hline{\noalign{\vskip3pt}\savehline\noalign{\vskip3pt}}%
175 \def\rcline##1{\@rcline[##1]}%
176 \def\lcline##1{\@lcline[##1]}%
177 \def\lrcline##1{\@lrcline[##1]}%
178 \let\rlcline=\lrcline
179 \setbox\strutbox\hbox{\vrule height.8\baselineskip
180 depth.4\baselineskip width\z@}%
181 \setbox0=\hbox\bgroup\def\@halignto{}\@tabular}%
183 % |\endtabular| is quite straightforward.
185 \def\endtabular{\crcr\egroup\egroup $\egroup
186 \egroup \tabwidth{\wd0}\unhbox0 \endgroup}%
189 % Apparently we need to restore the definition of |\hline|
190 % inside of array's. This is just a quick hack that 'fixes'
193 \let\klu@intarray\array
194 \let\klu@intendarray\endarray
195 \def\array{\begingroup \let\hline\savehline \klu@intarray }
196 \def\endarray{\klu@intendarray \endgroup}
199 % |tabular*| follows the same rules, except for redefining
200 % |\@tabacol| to insert a |\hfil| value for |\tabskip| in the first
201 % preamble-entry (and all following, but these don't count),
202 % thereby stretching out all intercolumn space instead
203 % of just the last (\LaTeX\ standard behaviour).
205 \@namedef{tabular*}#1{%
208 \def\hline{\noalign{\vskip3pt}\savehline\noalign{\vskip3pt}}%
209 \def\rcline##1{\@rcline[##1]}%
210 \def\lcline##1{\@lcline[##1]}%
211 \def\lrcline##1{\@lrcline[##1]}%
212 \let\rlcline=\lrcline
213 \setbox\strutbox\hbox{\vrule height.8\baselineskip
214 depth.4\baselineskip width\z@}%
215 \setbox0=\hbox\bgroup\def\@halignto{to #1}%
216 \def\@tabacol{\edef\@preamble{\@preamble
217 \tabskip \stretchtabsep \hskip \tabcolsep}}\@tabular}
218 \@namedef{endtabular*}{\endtabular}
221 % \subsection{TABULAR}
222 % This is just ordinary \LaTeX\ tabular, apart from the |\hbox|.
225 \let\savehline\hline %compatibility
226 \let\rcline\cline \let\lcline\cline
227 \let\lrcline\cline \let\rlcline\cline
228 \setbox0=\hbox\bgroup\def\@halignto{}\@tabular}%
229 \def\endTABULAR{\crcr\egroup\egroup $\egroup
230 \egroup \tabwidth{\wd0}\unhbox0 }%
231 \@namedef{TABULAR*}#1{%
232 \let\savehline\hline %compatibility
233 \let\rcline\cline \let\lcline\cline
234 \let\lrcline\cline \let\rlcline\cline
235 \setbox0=\hbox\bgroup\def\@halignto{to #1}\@tabular}%
236 \@namedef{endTABULAR*}{\endtabular}
239 %\def\IndexParms{\hbadness=10000}