diff options
author | Karl Berry <karl@freefriends.org> | 2006-06-30 13:14:33 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-06-30 13:14:33 +0000 |
commit | 2e9f3d4c5505449dcb952eda85a9f94979511477 (patch) | |
tree | 3021fc1ec0d140c5c24ebabebd557f19f45b61f9 /Master/texmf-dist/source/latex/makecell | |
parent | 281653d1f79bf062977588523f8a8a89f4716c1f (diff) |
makecell 0.1c update
git-svn-id: svn://tug.org/texlive/trunk@1728 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/makecell')
-rw-r--r-- | Master/texmf-dist/source/latex/makecell/makecell.dtx | 422 |
1 files changed, 327 insertions, 95 deletions
diff --git a/Master/texmf-dist/source/latex/makecell/makecell.dtx b/Master/texmf-dist/source/latex/makecell/makecell.dtx index 0cf9df93053..b26f47ba5b0 100644 --- a/Master/texmf-dist/source/latex/makecell/makecell.dtx +++ b/Master/texmf-dist/source/latex/makecell/makecell.dtx @@ -1,7 +1,7 @@ % \iffalse % % makecell.dtx - tabular column heads and multilined cells. -% (c) 2005 Olga Lapko (Lapko.O@g23.relcom.ru) +% (c) 2005--2006 Olga Lapko (Lapko.O@g23.relcom.ru) % % This program is provided under the terms of the % LaTeX Project Public License distributed from CTAN @@ -16,7 +16,7 @@ %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{makecell} %<*package> - [2005/07/02 v0.1a Multilined Cells and Tabular Heads] + [2006/06/28 v0.1c Multilined Cells and Tabular Heads] %</package> % %<*batchfile> @@ -40,8 +40,14 @@ \IfFileExists{multirow.sty}{\usepackage{multirow}}{} \IfFileExists{hyperref.sty}{\usepackage{hyperref}}{} \IfFileExists{hypcap.sty}{\usepackage{hypcap}}{} -\IfFileExists{caption.sty}{\usepackage[font=small,labelfont=bf,labelsep=period]{caption}[2004/11/28] -\IfFileExists{floatrow.sty}{\usepackage[font=small,style=plaintop,captionskip=5pt]{floatrow}}{\let\ttabbox\relax}}{} +\IfFileExists{caption.sty} + {\usepackage[font=small,labelfont=bf,labelsep=period]{caption}[2004/11/28] + \IfFileExists{floatrow.sty} + {\usepackage[font=small,style=plaintop,captionskip=5pt]{floatrow}} + {}}{} +\makeatletter +\@ifundefined{ttabbox}{\let\ttabbox\relax}{} +\makeatother \usepackage{tabularx} \EnableCrossrefs \CodelineIndex @@ -64,7 +70,7 @@ %</driver> % \fi % -% \CheckSum{664} +% \CheckSum{887} % % \GetFileInfo{makecell.dtx} % @@ -80,18 +86,20 @@ % \date{\filedate} % \maketitle % \begin{abstract} -% This package offers command |\thead|, based on one-column tabular -% environment for tabular column heads. This macro allows to support -% common layout for tabular column heads in documentation. Another command, +% This package helps to create common layout for tabular material. +% The |\thead| command, based on one-column tabular environment, is offered +% for creation of tabular column heads. This macro allows to support common +% layout for tabular column heads in whole documentation. Another command, % |\makecell|, is offered for creation of multilined tabular cells. % % Package also offers: \quad 1)\nobreak\enskip macro |\makegapedcells|, which -% changes vertical spaces around all cells (like in \pkg{tabls} package) in -% tabular; \quad 2)\nobreak\enskip macros |\multirowhead| and |\multirowcell|, -% which use |\multirow| macro from \pkg{multirow} package.\smallskip +% changes vertical spaces around all cells in tabular, like in \pkg{tabls} +% package, but uses code of \pkg{array} package. (Macro |\makegapedcells| +% redefines macro |\@classz| from this package. Macro |\nomakegapedcells| +% cancels this redefinition.); \quad 2)\nobreak\enskip macros |\multirowhead| +% and |\multirowcell|, which use |\multirow| macro from \pkg{multirow} +% package.\smallskip % -% Current package calls \pkg{array} package. (Macro |\makegapedcells| also -% temporarily redefines macro |\@classz| from this package.) % \end{abstract} % % \section{Tabular Cells and Column Heads} @@ -100,15 +108,16 @@ % % \DescribeMacro{\makecell} % Macro creates one-column tabular with predefined common settings of -% alignment, spacing and vertical spaces around (see section~\ref{sec:sets}). This will be useful for -% creation of multilined cells. This macro allows optional alignment settings. +% alignment, spacing and vertical spaces around (see section~\ref{sec:sets}). +% This will be useful for creation of multilined cells. This macro allows optional +% alignment settings. % \begin{quote} % |\makecell|\oarg{vertical or/and horizontal alignment}\marg{cell text} % \end{quote} % For vertical alignment you use \texttt{t}, \texttt{b}, or \texttt{c}---%^^A -% this letters you usually put in optional argument of \env{tabular} or \texttt{array} -% environments. For horizontal alignment you may use alignment settings -% like \texttt{r}, \texttt{l}, or \texttt{c}, or more complex, like +% this letters you usually put in optional argument of \env{tabular} or +% \texttt{array} environments. For horizontal alignment you may use alignment +% settings like \texttt{r}, \texttt{l}, or \texttt{c}, or more complex, like % |{p{3cm}}|. Since this package loads \pkg{array} package, you may % use such alignment settings like |{>{\parindent1cm}p{3cm}}|. %\begin{verbatim} @@ -147,25 +156,29 @@ % \hline % \makecell*[{{p{3cm}}}]{Cell long text with predefined width} & 52--58\\ % \hline -% \makecell[{{>{\parindent1em}p{3cm}}}]{Cell long text with predefined width} & 52--58\\ +% \makecell[{{>{\parindent1em}p{3cm}}}]{Cell long text with predefined width} & +% 52--58\\ % \hline % \end{tabular}} % \end{table} % % Starred form of command, |\makecell*|, creates vertical |\jot| spaces around. % -% \emph{Note}. When you define column alignment like |p{3cm}| in optional argument of -% |\makecell| (or |\thead|, see below), please follow these rules: \quad 1)\nobreak\enskip if -% vertical alignment defined, write column alignment in group, e.g. |[c{p{3cm}}]|; \quad -% 2)\nobreak\enskip if it is absent, write column alignment in double group---%^^A -% |[{{p{3cm}}}]|, or add empty group---|[{}{p{3cm}}]|. Be also careful with vertical -% alignment when you define column alignment as paragraph block: e.g., use |{{b{3cm}}}| for -% bottom alignment. +% \emph{Note}. When you define column alignment like |p{3cm}| in optional argument +% of |\makecell| (or |\thead|, see below), please follow these rules: \quad +% 1)\nobreak\enskip if +% vertical alignment defined, write column alignment in group, e.g. |[c{p{3cm}}]|; +% \quad 2)\nobreak\enskip if it is absent, write column alignment in double +% group---|[{{p{3cm}}}]|, or add empty group---|[{}{p{3cm}}]|. Be also careful +% with vertical alignment when you define column alignment as paragraph block: +% e.g., use |{{b{3cm}}}| for bottom alignment (and |{{m{3cm}}}| for centered +% vertical alignment). % % \DescribeMacro{\thead} -% Macro creates one-column tabular for column heads with predefined -% common settings (see table~\ref{tab:thead}). This macro uses common layout for column heads: -% font, alignment, spacing, and vertical spaces around (see section~\ref{sec:sets}). +% Macro creates one-column \texttt{tabular} for column heads with predefined +% common settings (see table~\ref{tab:thead}). This macro uses common layout for +% column heads: font, alignment, spacing, and vertical spaces around +% (see section~\ref{sec:sets}). %\begin{verbatim} %\renewcommand\theadset{\def\arraystretch{.85}}% %\begin{tabular}{|l|c|} @@ -197,10 +210,12 @@ % Creates table heads rotated by 90$^\circ$ counterclockwise. % Macro uses the same font and spacing settings as previous % one, but column alignment changed to |p{\rotheadsize}| with |\raggedright| -% justification: in this case left side of all text lines ``lie'' on one base line. +% justification: in this case left side of all text lines ``lies'' +% on one base line. % % \DescribeMacro{\rotheadsize} -% This parameter defines the width of rotated tabular heads. You may define that like: +% This parameter defines the width of rotated tabular heads. You may define +% that like: % \begin{quote} % |\setlength\rotheadsize{3cm}| % \end{quote} @@ -237,31 +252,33 @@ % \subsection{Settings For Tabular Cells}\label{sec:sets} % % This section describes macros, which make layout tuning for multilined cells, -% created by |\makecell| macro. The |\cellset| macro also is used by |\thead| macro. +% created by |\makecell| macro (and also |\multirowcell| and |\rotcell| macros). +% The |\cellset| macro also is used by |\thead| (|\rothead|, |\multirowtead|) +% macro. % % \DescribeMacro{\cellset} % Spacing settings for cells. Here you could use commands like: % \begin{quote} -% |\renewcommand\theadcell{\renewcommand\arraytretch{1}%|\\ +% |\renewcommand\cellset{\renewcommand\arraytretch{1}%|\\ % | \setlength\extrarowheight{0pt}}| % \end{quote} -% as was defined in current package. -% These settings used by both |\makecell| and |\thead| (|\rothead|) commands. +% as was defined in current package. These settings +% used by both |\makecell| and |\thead| (|\rothead|, |\multirowtead|) commands. % % \DescribeMacro{\cellalign} -% Default align for cells. Package offers vertical and horizontal centering alignment, it defined like: +% Default align for cells. Package offers vertical and horizontal centering +% alignment, it defined like: % \begin{quote} % |\renewcommand\cellalign{cc}| % \end{quote} -% -% \DescribeMacro{\cellgape} -% Define vertical spaces around |\makecell|, using |\gape| command if necessary. It defined like: +% Define vertical spaces around |\makecell|, using |\gape| command if necessary. +% It defined like: % \begin{quote} % |\renewcommand\cellgape{}| % \end{quote} % You may define this command like % \begin{quote} -% |\renewcommand\cellgape{\gape*{1pt}}| +% |\renewcommand\cellgape{\Gape[1pt]}| % \end{quote} % or % \begin{quote} @@ -269,17 +286,23 @@ % \end{quote} % (See also section~\ref{sec:gape} about |\gape| command.) % +% \DescribeMacro{\cellrotangle} +% The angle for rotated cells and column heads. The default value 90 +% (counterclockwise). This value definition is used by both |\rotcell| and +% |\rothead| macros. +% % \subsection{Settings For Column Heads} % % This section describes macros, which make layout tuning for tabular column heads, -% created by |\thead| (|\rothead|) macro. +% created by |\thead| (|\rothead|, |\multirowtead|) macro. % % \DescribeMacro{\theadfont} % Sets a special font for column heads. It could be smaller size % \begin{quote} % |\renewcommand\theadfont{\foonotesize}| % \end{quote} -% as was defined in current package. +% as was defined in current package (here we suppose that +% \verb|\small| command used for tabular contents itself). % Next example defines italic shape % \begin{quote} % |\renewcommand\theadfont{\itshape}| @@ -288,7 +311,7 @@ % \DescribeMacro{\theadset} % Spacing settings for column heads. Here you could use commands like: % \begin{quote} -% |\renewcommand\theadcell{\renewcommand\arraytretch{1}%|\\ +% |\renewcommand\theadset{\renewcommand\arraytretch{1}%|\\ % | \setlength\extrarowheight{0pt}}| % \end{quote} % @@ -299,7 +322,8 @@ % \end{quote} % % \DescribeMacro{\theadgape} -% Define vertical spaces around, using |\gape| command if necessary. It defined like: +% Define vertical spaces around, using |\gape| command if necessary. +% It defined like: % \begin{quote} % |\renewcommand\theadgape{\gape}| % \end{quote} @@ -315,15 +339,15 @@ % Sometimes \env{tabular} or \env{array} cells, or some elements in text need a % height/depth correction. The |\raisebox| command could help for it, but usage % of that macro in these cases, especially inside math, is rather complex. -% Current package offers the |\gape| macro, which usage is similar to |\smash| macro. -% The |\gape| macro allows to change height and/or depth of included +% Current package offers the |\gape| macro, which usage is similar to |\smash| +% macro. The |\gape| macro allows to change height and/or depth of included % box with necessary dimension. % % \DescribeMacro{\gape} -% This macro changes included box by |\jot| value (usually 3\,pt). It is defined with optional -% and mandatory arguments, like |\smash| macro, which (re)defined by \pkg{amsmath} package. -% Optional argument sets change of height only (\texttt{t}) or depth only~(\texttt{b}). -% Mandatory argument includes text. +% This macro changes included box by |\jot| value (usually 3\,pt). It is defined +% with optional and mandatory arguments, like |\smash| macro, which (re)defined by +% \pkg{amsmath} package. Optional argument sets change of height only (\texttt{t}) +% or depth only~(\texttt{b}). Mandatory argument includes text. % \begin{quote} % |\gape|\oarg{\texttt{t} or \texttt{b}}\marg{text} % \end{quote} @@ -348,8 +372,8 @@ % \end{quote} % % \DescribeMacro{\Gape} -% Another way of height/depth modification. This macro allows different correction for -% height and depth of box: +% Another way of height/depth modification. This macro allows different correction +% for height and depth of box: % \begin{quote} % |\Gape|\oarg{height corr}\oarg{depth corr}\marg{text} % \end{quote} @@ -388,20 +412,20 @@ % \DescribeMacro{\botstrut} % These three macros modify standard |\strut| by |\jot| value: % |\bottopstrut| changes both height and depth; -% |\topstrut| changes only height; +% \nopagebreak|\topstrut| changes only height; % |\botstrut| changes only depth. % These commands could be useful, for example, in first and last table rows. % % \emph{Note}. If you use % \pkg{bigstrut} package note that these macros duplicate \cmd{\bigstrut}, -% \cmd{\bigstrut[t]}, and \cmd{\bigstrut[b]} commands consequently. Please note that value, -% which increases strut in \cmd{\topstrut} etc. equals to \cmd{\jot}, but \cmd{\bigstrut} -% and others use a special dimension \cmd{\bigstrutjot}. +% \cmd{\bigstrut[t]}, and \cmd{\bigstrut[b]} commands consequently. Please note +% that value, which increases strut in \cmd{\topstrut} etc. equals to \cmd{\jot}, +% but \cmd{\bigstrut} and others use a special dimension \cmd{\bigstrutjot}. % % \section{How to Change Vertical Spaces Around in Whole Table}\label{sec:beta} % -% This section describes macros which try to emulate one of possibilities of \pkg{tabls} -% package: to get necessary vertical spacing around cells. +% This section describes macros which try to emulate one of possibilities of +% \pkg{tabls} package: to get necessary vertical spacing around cells. % % \DescribeMacro{\setcellgapes} % Sets the parameters for vertical spaces. It looks like |\gape*| command without @@ -413,16 +437,18 @@ % \begin{quote} % |\setcellgapes{5pt}| % \end{quote} -% You may also try to load negative values if you wish. This macro you may put in the -% preamble as common settings. +% You may also try to load negative values if you wish. This macro you may put in +% the preamble as common settings. % % \DescribeMacro{\makegapedcells} % \DescribeMacro{\nomakegapedcells} -% The first macro switches on vertical spacing settings. The second cancels first~one. +% The first macro switches on vertical spacing settings. The second cancels +% first~one. % % The \cmd{\makegapedcells} macro temporarily redefines macro % |\@classz| of \pkg{array} package, so use this mechanism carefully. -% Load |\makegapedcells| inside group or inside environment (see table~\ref{tab:gaped}): +% Load |\makegapedcells| inside group or inside environment +% (see table~\ref{tab:gaped}): %\begin{verbatim} %\begin{table}[h] %\makegapedcells @@ -433,7 +459,8 @@ % \begin{table} % \makegapedcells % \ttabbox -% {\caption{Example of multilined cells with additional vertical spaces}\label{tab:gaped}}% +% {\caption{Example of multilined cells with additional vertical spaces}%^^A +% \label{tab:gaped}}% % {\begin{tabular}{|c|c|} % \hline % Cell text & 28--31\\ @@ -448,26 +475,29 @@ % \hline % \makecell*[{{p{3cm}}}]{Cell long text with predefined width} & 52--58\\ % \hline -% \makecell[{{>{\parindent1em}p{3cm}}}]{Cell long text with predefined width} & 52--58\\ +% \makecell[{{>{\parindent1em}p{3cm}}}]{Cell long text with predefined width} +% & 52--58\\ % \hline % \end{tabular}} % \end{table} % -% Please note that space defined in |\setcellgapes| and space which creates |\gape| mechanism +% Please note that space defined in |\setcellgapes| and space which creates |\gape| +% mechanism % in commands for tabular cells (usually |\thead| or |\makecell*|) are summarized. % % \section{Multirow Table Heads and Cells} % -% The next examples show usage of macros which use |\multirow| command from \pkg{multirow} -% package.\nopagebreak +% The next examples show usage of macros which use |\multirow| command from +% \pkg{multirow} package.\nopagebreak % % At first goes short repetition of arguments of |\multirow| macro itself: % \begin{quote} % |\multirow|\marg{nrow}\oarg{njot}\marg{width}\oarg{vmove}\marg{contents} % \end{quote} % \marg{nrow} sets number of rows (i.e. text lines); -% \oarg{njot} is mainly used if you've used \pkg{bigstrut} package: it makes additional -% tuning of vertical position (see comments in \pkg{multirow} package); +% \oarg{njot} is mainly used if you've used \pkg{bigstrut} package: it makes +% additional tuning of vertical position (see comments in \pkg{multirow} +% package); % \marg{width} defines width of contents, the |*| sign used to indicate that % the text argument's natural width is to be used; % \oarg{vmove} is a length used for fine tuning: the text will be raised (or @@ -480,13 +510,14 @@ % \begin{quote} % |\multirowcell|\marg{nrow}\oarg{vmove}\oarg{hor alignment}\marg{contents} % \end{quote} -% in these macros were skipped \oarg{njot} and \marg{width}. Instead of tuning optional -% argument \oarg{njot} for vertical +% in these macros were skipped \oarg{njot} and \marg{width}. Instead of tuning +% optional argument \oarg{njot} for vertical % correction used \oarg{vmove} optional argument. % For the \marg{width} argument both |\multirowcell| and |\multirowthead| macros % use natural width of contents (i.e. the |*| argument used). % -% First example (table~\ref{tab:mrowI}) with ``|\multirow|'ed'' column heads and cells: +% First example (table~\ref{tab:mrowI}) with ``|\multirow|'ed'' column heads +% and cells: %\begin{verbatim} %\renewcommand\theadset{\def\arraystretch{.85}}% %\begin{tabular}{|l|c|c|} @@ -524,17 +555,19 @@ % \cline{1-2} % \makecell[r]{Right aligned\\ cell text} & D & \\ % \hline -% \makecell[b]{Bottom aligned\\ cell text} & E & \multirowcell{5}[1ex][r]{37--43\\52--58}\\ +% \makecell[b]{Bottom aligned\\ cell text} & E & +% \multirowcell{5}[1ex][r]{37--43\\52--58}\\ % \cline{1-2} % \makecell[{{p{5cm}}}]{Cell long long long long text with predefined width} & F & \\ % \cline{1-2} -% \makecell[{{>{\parindent1em}p{5cm}}}]{Cell long long long long text with predefined width} & G & \\ +% \makecell[{{>{\parindent1em}p{5cm}}}]{Cell long long long long text with +% predefined width} & G & \\ % \hline % \end{tabular}} % \end{table} % -% Second example (table~\ref{tab:mrowII}) with ``multirow'ed'' column heads and cells -% uses |\makegapedcells| command. The |\theadgape| command does nothing: +% Second example (table~\ref{tab:mrowII}) with ``multirow'ed'' column heads and +% cells uses |\makegapedcells| command. The |\theadgape| command does nothing: %\begin{verbatim} %\makegapedcells %\renewcommand\theadset{\def\arraystretch{.85}}% @@ -545,7 +578,8 @@ %\renewcommand\theadset{\def\arraystretch{.85}}% %\renewcommand\theadgape{} % \ttabbox -% {\caption{Example of ``\cmd{\multirow}'ed'' cells and additional vertical spaces}\label{tab:mrowII}}% +% {\caption{Example of ``\cmd{\multirow}'ed'' cells and additional vertical +% spaces}\label{tab:mrowII}}% % {\begin{tabular}{|l|c|c|} % \hline % \multirowthead{4}{First Column head}& @@ -562,18 +596,21 @@ % \cline{1-2} % \makecell[r]{Right aligned \\ cell text} & D & \\ % \hline -% \makecell[b]{Bottom aligned \\ cell text} & E & \multirowcell{6}[0ex][r]{37--43\\52--58}\\ +% \makecell[b]{Bottom aligned \\ cell text} & E & +% \multirowcell{6}[0ex][r]{37--43\\52--58}\\ % \cline{1-2} -% \makecell[{{p{5cm}}}]{Cell long long long long text with predefined width} & F & \\ +% \makecell[{{p{5cm}}}]{Cell long long long long text with predefined width} +% & F & \\ % \cline{1-2} -% \makecell[{{>{\parindent1em}p{5cm}}}]{Cell long long long long text with predefined width} & G & \\ +% \makecell[{{>{\parindent1em}p{5cm}}}]{Cell long long long long text with +% predefined width} & G & \\ % \hline % \end{tabular}} % \end{table} % \bigskip % -% The last example (table~\ref{tab:mrowIII}) uses \env{tabularx} environment with |\hsize| -% in the width argument. +% The last example (table~\ref{tab:mrowIII}) uses \env{tabularx} environment with +% |\hsize| in the width argument. %\begin{verbatim} %\makegapedcells %\renewcommand\theadset{\def\arraystretch{.85}}% @@ -617,15 +654,67 @@ % \cline{1-2} % \makecell[r]{Right aligned \\ cell text} & D & \\ % \hline -% \makecell[b]{Bottom aligned \\ cell text} & E & \multirowcell{6}[0ex][r]{37--43\\52--58}\\ +% \makecell[b]{Bottom aligned \\ cell text} & E & +% \multirowcell{6}[0ex][r]{37--43\\52--58}\\ % \cline{1-2} -% \makecell[{{p{\hsize}}}]{Cell long long long long long long text with predefined width} & F & \\ +% \makecell[{{p{\hsize}}}]{Cell long long long long long long text with +% predefined width} & F & \\ % \cline{1-2} -% \makecell[{{>{\parindent1em}p{\hsize}}}]{Cell long long long long long long text with predefined width} & G & \\ +% \makecell[{{>{\parindent1em}p{\hsize}}}]{Cell long long long long long +% long text with predefined width} & G & \\ % \hline % \end{tabularx}} % \end{table} % +% \subsection{Multirow Table Heads and Cells: Second Variant} +% +% Another, simplified, variant of multirow cell: use +% |\makecell| and |\thead| commands, and set |\\| with +% negative space at the end, for example +%\begin{quote} +% |\thead{First Column head\\[-5ex]}| +%\end{quote} +% cells, which stay in one ``multi row'' will have the same value of this +% negative space, in spite of different number of lines in their contents. +% +% \section{Numbered Lines in Tabulars} +% +% The three commands |\eline|, |\nline|, |\rnline| allow to skip: +% \begin{quote} +% |\eline|\marg{number of cells} +% \end{quote} +% and numbering (|\nline|) a few/all sells in the row: +% \begin{quote} +% |\nline|\oarg{numbering type}\oarg{start number}\marg{number of cells} +% \end{quote} +% Command |\rnline| does the same as |\nline|, but allows numbering by +% Russian letters (it redefines +% \LaTeX's |\Alph| and |\alph| with |\Asbuk| and |\asbuk| consequently). +% (see table~\ref{tab:elines}) +%\begin{verbatim} +% \begin{tabular}{|*{12}{c|}} +% \hline +% \eline{6} \\ \hline +% \nline{6} \\ \hline +% \eline{3} & \nline[1][4]{3} \\ \hline +% \nline[(a)]{6} \\ \hline +% \nline[column I]{6} \\ \hline +% \end{tabular} +%\end{verbatim} +% +% \begin{table} +% \ttabbox +% {\caption{Examples of filling of cells}\label{tab:elines}}% +% {\begin{tabular}{|*{6}{c|}} +% \hline +% \eline{6} \\ \hline +% \nline{6} \\ \hline +% \eline{3} & \nline[1][4]{3} \\ \hline +% \nline[(a)]{6} \\ \hline +% \nline[column I]{6} \\ \hline +% \end{tabular}} +%\end{table} +% % \StopEventually{}\clearpage % % \section{Code of package} @@ -639,14 +728,15 @@ % % \begin{macro}{\makecell} % The definition of command for multilined cells. At first defined |\gape| stuff. -% Non-star from loads special setting for vertical space around (if it used). +% Non-star form loads special setting for vertical space around (if it used). % Star form always creates additional vertical |\jot|-spaces. % \begin{macrocode} \newcommand\makecell{\@ifstar{\let\tabg@pe\gape\makecell@}% {\let\tabg@pe\cellgape\makecell@}} % \end{macrocode} % Next macro loads vertical and horizontal common alignment for cells and -% defines spacing parameters |\arraystretch| and |\extrarowheight| if necessary. +% loads redefined spacing parameters |\arraystretch| and |\extrarowheight| +% if these parameters were redefined. % \begin{macrocode} \newcommand\makecell@{\def\t@bset{\cellset}% \let\mcell@align\cellalign @@ -664,8 +754,9 @@ {\let\tabg@pe\theadgape\thead@}} % \end{macrocode} % Next macro loads vertical and horizontal common alignment for column heads and -% defines spacing parameters |\arraystretch| and |\extrarowheight| if necessary. -% (First go settings for cells then special settings for column heads.) +% loads redefined spacing parameters |\arraystretch| and |\extrarowheight| +% if these parameters were redefined. +% (First go settings for cells, as for |\makecell|, then special settings for column heads.) % % For column heads also loaded font settings. % \begin{macrocode} @@ -697,8 +788,8 @@ % additional justification settings) % \begin{macrocode} \@ifdefinable\@rotcell{} -\def\@rotcell[#1]#2{\\[-.65\normalbaselineskip] - \turn{\cellrotangle}\makecell[#1]{#2}\endturn} +\def\@rotcell[#1]#2{\makecell{\\[-.65\normalbaselineskip] + \turn{\cellrotangle}\makecell[#1]{#2}\endturn}} \newcommand\@@rotcell[1]{\makecell{\\[-.65\normalbaselineskip] \turn{\cellrotangle}\makecell[c{>{\rightskip0explus \rotheadsize\hyphenpenalty0\pretolerance-1% @@ -719,8 +810,8 @@ {\let\theadgape\rotheadgape \@ifnextchar[{\@rothead}{\@@rothead}}} % \end{macrocode} -% For rotated column head default column setting is similar to |p{\rotheadsize}| (plus some -% additional justification settings) +% For rotated column head default column setting is similar to |p{\rotheadsize}| +% (plus some additional justification settings) % \begin{macrocode} \@ifdefinable\@rothead{} \def\@rothead[#1]#2{\thead{\\[-.65\normalbaselineskip] @@ -917,7 +1008,8 @@ % \begin{macro}{\theadalign} % The layout macros for tabular building settings.\nopagebreak % -% Spacing settings for tabular spacing inside cells (like |\arraystretch| or |\extrarowheight|).\nopagebreak +% Spacing settings for tabular spacing inside cells (like |\arraystretch| +% or |\extrarowheight|).\nopagebreak % \begin{macrocode} \newcommand\cellset{\def\arraystretch{1}\extrarowheight\z@ \nomakegapedcells} @@ -939,7 +1031,8 @@ % \begin{macrocode} \newcommand\theadfont{\footnotesize} % \end{macrocode} -% Special spacing settings for tabular spacing in column heads (like |\arraystretch| or/and |\extrarowheight|). +% Special spacing settings for tabular spacing in column heads (like |\arraystretch| +% or/and |\extrarowheight|). % \begin{macrocode} \newcommand\theadset{} % \end{macrocode} @@ -1105,5 +1198,144 @@ % \end{macrocode} % \end{macro} % +% \subsection{Rows of skipped and numbered cells} +% +% \begin{macro}{\eline} +% The row of empty cells. +% \begin{macrocode} +\newcommand\eline[1]{\count@ #1% + \advance\count@\m@ne + \loop \@temptokena\expandafter{\the\@temptokena&}% + \advance\count@\m@ne \ifnum\count@>\z@\repeat + \the\@temptokena\ignorespaces} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\rnline} +% \begin{macro}{\nline} +% The rows of numbered cells. The |\rnline| command replaces |\Alph| and +% |\alph| counter by |\Asbuk| and |\asbuk| consequently. +% \begin{macrocode} +\newcommand\rnline{\gdef + \TeXr@rus{\let\@Alph\@Asbuk\let\@alph\@asbuk}\@nline} +\newcommand\nline{\gdef\TeXr@rus{}\@nline} +\newcommand\@nline{\@ifnextchar[%] + {\@@nline}{\@@nline[1]}} +\@ifdefinable\@@nline{} +\def\@@nline[#1]{\@ifnextchar[%] + {\@@@nline[#1]}{\@@@nline[#1][1]}} +\@ifdefinable\@@@nline{} +\def\@@@nline[#1][#2]#3{\count@ #3% + \expandafter\TeXr@loop\@gobble{}#1\@@@ + \xdef\Num{\the\TeXr@lab}% + \@tempcnta#2\relax% + \expandafter\@temptokena\expandafter{\Num + \global\advance\@tempcnta\@ne}% + \advance\count@\m@ne + \loop\@temptokena\expandafter{\the\@temptokena& + \Num \global\advance\@tempcnta\@ne}% + \advance\count@\m@ne \ifnum\count@>\z@ \repeat + \the\@temptokena\ignorespaces} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% [Borrowed code stuff and explanation from \pkg{enumerate}/\pkg{paralist} +% packages just with changes of command names.] +% +% Internal token register used to build up the label command from the +% optional argument. +% \begin{macrocode} +\newtoks\TeXr@lab +% \end{macrocode} +% This just expands to a `?'. |\ref| will produce this, if no counter +% is printed. +% \begin{macrocode} +\def\TeXr@qmark{?} +% \end{macrocode} +% The next four macros build up the command that will print the item +% label. They each gobble one token or group from the optional argument, +% and add corresponding tokens to the register |\@enLab|. They each end +% with a call to |\@enloop|, which starts the processing of the next +% token. +% \begin{macro}{\TeXr@label} +% Add the counter to the label. |#2| will be one of the `special' +% tokens |A a I i 1|, and is thrown away. |#1| will be a command +% like |\Roman|. +% \begin{macrocode} +\def\TeXr@label#1#2{% + \xdef\TeXr@the{\noexpand#1\@tempcnta}% + \TeXr@lab\expandafter{\the\TeXr@lab\TeXr@rus\TeXr@the}% + \advance\@tempcnta1 + \TeXr@loop} +% \end{macrocode} +% The only foreign command in this stuff. It indicates whether +% the list has numeration by Russian letters. +% \begin{macrocode} +\def\TeXr@rus{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TeXr@space} +% \begin{macro}{\TeXr@sp@ce} +% Add a space to the label. The tricky bit is to gobble the space token, +% as you can not do this with a macro argument. +% \begin{macrocode} +\def\TeXr@space{\afterassignment\TeXr@sp@ce\let\@tempa= } +\def\TeXr@sp@ce{\TeXr@lab\expandafter{\the\TeXr@lab\space}\TeXr@loop} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\TeXr@group} +% Add a |{ }| group to the label. +% \begin{macrocode} +\def\TeXr@group#1{\TeXr@lab\expandafter{\the\TeXr@lab{#1}}\TeXr@loop} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TeXr@other} +% Add anything else to the label +% \begin{macrocode} +\def\TeXr@other#1{\TeXr@lab\expandafter{\the\TeXr@lab#1}\TeXr@loop} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\TeXr@loop} +% \begin{macro}{\TeXr@loop@} +% The body of the main loop. +% Eating tokens this way instead of using |\@tfor| lets you see +% spaces and {\bf all} braces. |\@tfor| would treat {\tt a} and +% |{a}| as special, but not |{{a}}|. +% \begin{macrocode} +\def\TeXr@loop{\futurelet\TeXr@temp\TeXr@loop@} +% \end{macrocode} +% \begin{macrocode} +\def\TeXr@loop@{% + \ifx A\TeXr@temp \def\@tempa{\TeXr@label\@Alph }\else + \ifx a\TeXr@temp \def\@tempa{\TeXr@label\@alph }\else + \ifx i\TeXr@temp \def\@tempa{\TeXr@label\@roman }\else + \ifx I\TeXr@temp \def\@tempa{\TeXr@label\@Roman }\else + \ifx 1\TeXr@temp \def\@tempa{\TeXr@label\@arabic}\else + \ifx \@sptoken\TeXr@temp \let\@tempa\TeXr@space \else + \ifx \bgroup\TeXr@temp \let\@tempa\TeXr@group \else + \ifx \@@@\TeXr@temp \let\@tempa\@gobble \else + \let\@tempa\TeXr@other +% \end{macrocode} +% Hook for possible extensions +% \begin{macrocode} + \TeXr@hook + \fi\fi\fi\fi\fi\fi\fi\fi + \@tempa} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\TeXr@hook} +% \begin{macrocode} +\providecommand\TeXr@hook{} +% \end{macrocode} +% \end{macro} +% % \Finale \endinput |