summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-08-03 21:24:50 +0000
committerKarl Berry <karl@freefriends.org>2009-08-03 21:24:50 +0000
commit2be1f5b6a176fa29368bc5ca8a19c16ef23742e4 (patch)
tree4773af76fe69641d33a6641865c05cc8fa48a905 /Master/texmf-dist/source/latex
parent5a6870c92a91af362f2f511834a6094491774d46 (diff)
makecell 0.1e (3aug09)
git-svn-id: svn://tug.org/texlive/trunk@14523 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/makecell/makecell.dtx363
1 files changed, 312 insertions, 51 deletions
diff --git a/Master/texmf-dist/source/latex/makecell/makecell.dtx b/Master/texmf-dist/source/latex/makecell/makecell.dtx
index 75b094c8198..c0988087b49 100644
--- a/Master/texmf-dist/source/latex/makecell/makecell.dtx
+++ b/Master/texmf-dist/source/latex/makecell/makecell.dtx
@@ -16,7 +16,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{makecell}
%<*package>
- [2008/01/12 V0.1e Managing of Tab Column Heads and Cells]
+ [2009/08/03 V0.1e Managing of Tab Column Heads and Cells]
%</package>
%
%<*batchfile>
@@ -34,22 +34,14 @@
%
%<*driver>
\documentclass{ltxdoc}
-
-\usepackage{ifpdf}
-\ifpdf
- \usepackage{mathptmx,courier}
- \usepackage[scaled=0.90]{helvet}
- \addtolength\marginparwidth{15pt}
-\fi
-
-\usepackage{makecell}
\IfFileExists{rotating.sty}{\usepackage{rotating}}{}
\IfFileExists{footmisc.sty}{\usepackage[perpage,bottom]{footmisc}}{}
\IfFileExists{multirow.sty}{\usepackage{multirow}}{}
\IfFileExists{hyperref.sty}{\usepackage{hyperref}}{}
\IfFileExists{hypcap.sty}{\usepackage{hypcap}}{}
+\usepackage{makecell}
\IfFileExists{caption.sty}
- {\usepackage[font=small,labelfont=bf,labelsep=period]{caption}
+ {\usepackage[font=small,labelfont=bf,labelsep=period]{caption}[2004/11/28]
\IfFileExists{floatrow.sty}
{\usepackage[font=small,style=plaintop,captionskip=5pt]{floatrow}}
{}}{}
@@ -57,6 +49,8 @@
\@ifundefined{ttabbox}{\let\ttabbox\relax}{}
\makeatother
\usepackage{tabularx}
+\usepackage{slashbox}
+\usepackage{hhline}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
@@ -66,11 +60,11 @@
\clubpenalty10000
\makeatother
\providecommand*{\file}[1]{\texttt{#1}}
-\providecommand*{\pkg}[1]{\textsf{#1}}
+\providecommand*{\package}[1]{\textsf{#1}}
\providecommand*{\cls}[1]{\textsf{#1}}
\providecommand*{\env}[1]{\texttt{#1}}
-\OnlyDescription
+%\OnlyDescription
\begin{document}
\DocInput{makecell.dtx}
\PrintChanges
@@ -78,7 +72,7 @@
%</driver>
% \fi
%
-% \CheckSum{1245}
+% \CheckSum{1407}
%
% \GetFileInfo{makecell.dtx}
%
@@ -99,17 +93,21 @@
% 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.
+% There are also command |\makecellbox| command and |mcellbox| environment
+% usage of tabular cells inside text.
%
% Package also offers: \quad 1)\nobreak\enskip macro |\makegapedcells|,
% which 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 \pkg{array} package.
+% \package{tabls} package, but uses code of \package{array} package. (Macro
+% |\makegapedcells| redefines macro |\@classz| from \package{array} package.
% Macro |\nomakegapedcells| cancels this redefinition.);
% \quad 2)\nobreak\enskip macros |\multirowhead| and |\multirowcell|,
-% which use |\multirow| macro from \pkg{multirow} package;
+% which use |\multirow| macro from \package{multirow} package;
% \quad 3)\nobreak\enskip numbered rows |\nline| or skipping cells |\eline|
-% in tabulars;
-% \quad 4)\nobreak\enskip diagonally divided cells (|\diaghead|);
+% in tabulars; also are the skipping rows command |\erows| and
+% repeated rows command |\Xrows|;
+% \quad 4)\nobreak\enskip diagonally divided cells (|\diaghead|)
+% plus citation of sample file of \package{slashbox} package, which does the same;
% \quad 5)\nobreak\enskip |\hline| and |\cline| with defined thickness:
% |\Xhline| and |\Xcline| consequently.
% \smallskip
@@ -136,7 +134,7 @@
% 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
+% |{p{3cm}}|. Since this package loads \package{array} package, you may
% use such alignment settings like |{>{\parindent1cm}p{3cm}}|.
%\begin{verbatim}
%\begin{tabular}{|c|c|}
@@ -370,7 +368,7 @@
% \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
+% (re)defined by \package{amsmath} package. Optional argument sets change of
% height only (\texttt{t}) or depth only~(\texttt{b}). Mandatory argument
% includes text.
% \begin{quote}
@@ -446,7 +444,7 @@
% 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},
+% \package{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
@@ -457,7 +455,7 @@
% 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.
+% \package{tabls} package: to get necessary vertical spacing around cells.
%
% \DescribeMacro{\setcellgapes}
% Sets the parameters for vertical spaces:
@@ -477,7 +475,7 @@
% first~one.
%
% The \cmd{\makegapedcells} macro temporarily redefines macro
-% |\@classz| of \pkg{array} package, so use this mechanism carefully.
+% |\@classz| of \package{array} package, so use this mechanism carefully.
% Load |\makegapedcells| inside group or inside environment
% (see table~\ref{tab:gaped}):
%\begin{verbatim}
@@ -520,16 +518,16 @@
% \section{Multirow Table Heads and Cells}
%
% The next examples show usage of macros which use |\multirow| command from
-% \pkg{multirow} package.\nopagebreak
+% \package{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
+% \oarg{njot} is mainly used if you've used \package{bigstrut} package: it makes
% additional tuning of vertical position (see comments in
-% \pkg{multirow} package);
+% \package{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
@@ -741,7 +739,7 @@
% \end{tabular}
%\end{verbatim}
%
-% \begin{table}[hbt]
+% \begin{table}[H]
% \ttabbox
% {\caption{Examples of filling of cells}\label{tab:elines}}%
% {\begin{tabular}{|*{6}{c|}}
@@ -754,7 +752,64 @@
% \end{tabular}}
%\end{table}
%
-% \clearpage
+% Two ``lazy'' commands: for empty table rows
+% (|\erows|) and for rows with repeated text (|\Xrows|) were added in the version V0.1e.
+%
+%\DeleteShortVerb{\|}
+%\begin{verbatim}
+% \begin{tabular}{|*{4}{c|}}
+% \hline
+% \thead{No}&\thead{First Data}&\thead{Second Data}&\thead{Third Data} \\
+% \hline
+% \erows{4}{8}
+% \end{tabular}\quad
+% \begin{tabular}{||c||c||c||c||}
+% \hhline{|t:=:t:=:t:=:t:=:t|}
+% \thead{No}&\thead{First Data}&\thead{Second Data}&\thead{Third Data} \\
+% \hhline{|:=::=::=::=:|}
+% \erows[\\ \hhline{|:=::=::=::=:|}]{4}{8}
+% \eline{4}\\ \hhline{|b:=:b:=:b:=:b:=:b|}
+% \end{tabular}\quad
+% \begin{tabular}{|*{4}{c|}}
+% \hline
+% \thead{No}&\thead{First Data}&\thead{Second Data}&\thead{Third Data} \\
+% \hline
+% \Xrows{\refstepcounter{enumi}\arabic{enumi}.\eline{3}\\ \hline}{8}
+% \end{tabular}
+%\end{verbatim}
+%
+% \begin{table}[hbt]\extrarowheight1pt
+% \ttabbox[\hsize]
+% {\caption{Examples of filling of cells}\label{tab:elines}}%
+% {\begin{tabular}{|*{4}{c|}}
+% \hline
+% \thead{No}&\thead{First Data}&\thead{Second Data}&\thead{Third Data} \\
+% \hline
+% \erows{4}{8}
+% \end{tabular}\par\bigskip
+% \begin{tabular}{||c||c||c||c||}
+% \hhline{|t:*3{=:t:}=:t|}
+% \thead{No}&\thead{First Data}&\thead{Second Data}&\thead{Third Data} \\
+% \hhline{|:*3{=::}=:|}
+% \erows[\\ \hhline{|:*3{=::}=:|}]{4}{7}
+% \eline{4}\\
+% \hhline{|b:*3{=:b:}=:b|}
+% \end{tabular}\par\bigskip
+% \begin{tabular}{|*{4}{c|}}
+% \hline
+% \thead{No}&\thead{First Data}&\thead{Second Data}&\thead{Third Data} \\
+% \hline
+% \Xrows{\refstepcounter{enumi}\arabic{enumi}.\eline{4}\\ \hline}{8}
+% \end{tabular}}
+%\end{table}
+%\MakeShortVerb{\|}
+%
+% \section{Cells (One-Column Tabulars) in the Text}
+%
+% If the |\makecell| command appears in the text (outside outer tabular environment)
+% it could create wrong layout. The |\makecellbox| command
+% and |mcellbox| environment are created for one-column tabulars in the text.
+%
% \section{Diagonally Divided Cell}
%
% This variant of head's positioning is not too popular nowadays, but in
@@ -869,8 +924,166 @@
% is narrower then necessary
% column ends of diagonal don't touch corners of cell.
%
+% \section{Comparison: Diagonally Divided Cell with the slashbox package}
+%
+% I didn't know about the \texttt{slashbox} package in time
+% when the code for the diagonal cells was created. This package uses also picture
+% |\line| mechanism, but calculates slopes automatically. It creates the
+% |\backslash| direction of diagonal lines only. (The |\slash| direction seems to be
+% not correct. Or direction depends to traditions of current publishing house?)
+%
+% Here is used citation of the sample file distributed with the \texttt{slashbox} package%^^A
+% \footnote{by Koichi Yasuoka, May 27, 1993; minor modification by Toru Sato, May 31, 1993}.
+% The verbatim of the table examples are added only in citation.\smallskip
+%
+% \begingroup\slshape
+% The usage is pretty straightforward, such as
+%
+%\begin{table}[H]%
+%\begin{verbatim}
+%\begin{tabular}{|l||*{5}{c|}}\hline
+%\backslashbox{Room}{Date}
+%&\makebox[3em]{5/31}&\makebox[3em]{6/1}&\makebox[3em]{6/2}
+%&\makebox[3em]{6/3}&\makebox[3em]{6/4}\\\hline\hline
+%Meeting Room &&&&&\\\hline
+%Auditorium &&&&&\\\hline
+%Seminar Room &&&&&\\\hline
+%\end{tabular}
+%\end{verbatim}%
+%
+% \noindent
+% \begin{tabular}{|l||*{5}{c|}}\hline
+% \backslashbox{Room}{Date}
+% &\makebox[3em]{5/31}&\makebox[3em]{6/1}&\makebox[3em]{6/2}
+% &\makebox[3em]{6/3}&\makebox[3em]{6/4}\\\hline\hline
+% Meeting Room &&&&&\\\hline
+% Auditorium &&&&&\\\hline
+% Seminar Room &&&&&\\\hline
+% \end{tabular}
+%\end{table}%
+%
+% You may include a newline (\verb+\\+) in `Room' and/or `Date'.
+% Note that you will get spaces aside the slash line if there is a
+% wider column in the same column of a different line.
+% In such a case, you need to specify the width of the slashed column
+% by saying
+%
+%\begin{table}[H]%
+%\begin{verbatim}
+%\begin{tabular}{|l||*{4}{c|}}\hline
+%\backslashbox[48mm]{Room}{Date}
+%&\makebox[3em]{5/31}&\makebox[3em]{6/1}&\makebox[3em]{6/2}
+%&\makebox[3em]{6/3}\\\hline\hline
+%Room With a Long Name &&&&\\\hline
+%Auditorium &&&&\\\hline
+%Seminar Room &&&&\\\hline
+%\end{tabular}
+%\end{verbatim}%
+%
+% \noindent
+% \begin{tabular}{|l||*{4}{c|}}\hline
+% \backslashbox[48mm]{Room}{Date}
+% &\makebox[3em]{5/31}&\makebox[3em]{6/1}&\makebox[3em]{6/2}
+% &\makebox[3em]{6/3}\\\hline\hline
+% Room With a Long Name &&&&\\\hline
+% Auditorium &&&&\\\hline
+% Seminar Room &&&&\\\hline
+% \end{tabular}
+%\end{table}%
+%
+% \bigskip
+% The specified width is neglected if it is narrower than the natural
+% width of the column.
+%
+% \verb+\(back)slashbox+ assumes by default that there is a blank space
+% of width \verb+\tabcolsep+ on both sides of the column.
+% Thus the slash line might exceeds the boundary when you use \verb+@{}+
+% etc.
+%
+% You can avoid it by specifying
+%
+%\begin{table}[H]%
+%\begin{verbatim}
+%\begin{tabular}{|@{\ $\bullet$\hspace*{3mm}}l||*{5}{c|}}\hline
+%\multicolumn{1}{|@{}l||}{\backslashbox[0pt][l]{Room}{Date}}
+%&\makebox[3em]{5/31}&\makebox[4em]{6/1}&\makebox[3em]{6/2}
+%&\makebox[3em]{6/3}&\makebox[3em]{6/4}\\\hline\hline
+%Meeting Room &&&&&\\\hline
+%Auditorium &&&&&\\\hline
+%Seminar Room &&&&&\\\hline
+%\end{tabular}
+%\end{verbatim}%
+%
+% \bigskip
+%
+% \noindent
+% \begin{tabular}{|@{\ $\bullet$\hspace*{3mm}}l||*{5}{c|}}\hline
+% \multicolumn{1}{|@{}l||}{\backslashbox[0pt][l]{Room}{Date}}
+% &\makebox[3em]{5/31}&\makebox[4em]{6/1}&\makebox[3em]{6/2}
+% &\makebox[3em]{6/3}&\makebox[3em]{6/4}\\\hline\hline
+% Meeting Room &&&&&\\\hline
+% Auditorium &&&&&\\\hline
+% Seminar Room &&&&&\\\hline
+% \end{tabular}
+%\end{table}%
+%
+% Here \verb+[l]+ tells the command that there is no extra space on the
+% left of this column. You can use \verb+[r]+ and \verb+[lr]+ likewise.
+% You have to also specify the width of the column in this case, but it
+% can be~0pt.
+% \endgroup
+%
+% The addition for the sample with |\slashbox| command. This example demonstrates that you may combine
+% the \texttt{makecell} commands and |\backslashbox|.
+%
+%\begin{table}[H]%
+%\begin{verbatim}
+%\begin{tabular}{|l||*{5}{c|}}\hline
+%\theadset\theadfont\backslashbox{Room}{Date}
+%&\makebox[3em]{\thead{5/31}}&\makebox[3em]{\thead{6/1}}&\makebox[3em]{\thead{6/2}}
+%&\makebox[3em]{6/3}&\makebox[3em]{\thead{6/4}}\\\hline\hline
+%Meeting Room &&&&&\\\hline
+%Auditorium &&&&&\\\hline
+%Seminar Room &&&&&\\\hline
+%\end{tabular}
+%\end{verbatim}%
+%
+% \noindent
+% \begin{tabular}{|l||*{5}{c|}}\hline
+%\theadset\theadfont\backslashbox{Room}{Date}
+%&\makebox[3em]{\thead{5/31}}&\makebox[3em]{\thead{6/1}}&\makebox[3em]{\thead{6/2}}
+%&\makebox[3em]{6/3}&\makebox[3em]{\thead{6/4}}\\\hline\hline
+% Meeting Room &&&&&\\\hline
+% Auditorium &&&&&\\\hline
+% Seminar Room &&&&&\\\hline
+% \end{tabular}
+%\end{table}%
+%
+%\begin{table}[H]%
+%\begin{verbatim}
+%\begin{tabular}{|l||*{4}{c|}}\hline
+%\theadset\backslashbox[48mm]{Room}{Date}
+%&\makebox[3em]{\thead{5/31}}&\makebox[3em]{\thead{6/1}}&\makebox[3em]{\thead{6/2}}
+%&\makebox[3em]{\thead{6/3}}\\\hline\hline
+%Room With a Long Name &&&&\\\hline
+%Auditorium &&&&\\\hline
+%Seminar Room &&&&\\\hline
+%\end{tabular}
+%\end{verbatim}%
+%
+% \noindent
+% \begin{tabular}{|l||*{4}{c|}}\hline
+% \theadset\backslashbox[48mm]{Room}{Date}
+% &\makebox[3em]{\thead{5/31}}&\makebox[3em]{\thead{6/1}}&\makebox[3em]{\thead{6/2}}
+% &\makebox[3em]{\thead{6/3}}\\\hline\hline
+% Room With a Long Name &&&&\\\hline
+% Auditorium &&&&\\\hline
+% Seminar Room &&&&\\\hline
+% \end{tabular}
+%\end{table}%
+%
% \clearpage
-% \section{Thick \cmd{\hline} and \cmd{\cline}}
+% \section{Thick Rules for the hline and cline Commands}
%
% For horizontal rules in tabular there were added two commands
% \cmd{\Xhline} and \cmd{\Xcline}
@@ -942,7 +1155,7 @@
%
% \subsection{Multilined cells}
%
-% First goes request of \pkg{array} package.
+% First goes request of \package{array} package.
% \begin{macrocode}
\RequirePackage{array}
% \end{macrocode}
@@ -996,7 +1209,7 @@
% \end{macro}
%
% \begin{macro}{\rotcell}
-% The macro for rotated cell. If no \pkg{rotating} package loaded
+% The macro for rotated cell. If no \package{rotating} package loaded
% this macro works like |\makecell|.
% \begin{macrocode}
\newcommand\rotcell{\@ifundefined{turn}%
@@ -1009,9 +1222,9 @@
% some additional justification settings)
% \begin{macrocode}
\@ifdefinable\@rotcell{}
-\def\@rotcell[#1]#2{\makecell{\\[-.65\normalbaselineskip]
+\def\@rotcell[#1]#2{\makecell*{\\[-.65\normalbaselineskip]
\turn{\cellrotangle}\makecell[#1]{#2}\endturn}}
-\newcommand\@@rotcell[1]{\makecell{\\[-.65\normalbaselineskip]
+\newcommand\@@rotcell[1]{\makecell*{\\[-.65\normalbaselineskip]
\turn{\cellrotangle}\makecell[c{>{\rightskip0explus
\rotheadsize\hyphenpenalty0\pretolerance-1%
\noindent\hskip\z@}p{\rotheadsize}
@@ -1020,7 +1233,7 @@
% \end{macro}
%
% \begin{macro}{\rothead}
-% The macro for rotated tabular column heads. If no \pkg{rotating} package
+% The macro for rotated tabular column heads. If no \package{rotating} package
% loaded this macro works like |\thead|.
% \begin{macrocode}
\newcommand\rothead{\@ifundefined{turn}%
@@ -1046,7 +1259,7 @@
% \end{macro}
%
% \begin{macro}{\multirowcell}
-% The macro for multirow cells. If no \pkg{multirow} package loaded
+% The macro for multirow cells. If no \package{multirow} package loaded
% this macro works like |\makecell|.
% \begin{macrocode}
\newcommand\multirowcell{\@ifundefined{multirow}%
@@ -1065,7 +1278,7 @@
% \end{macro}
%
% \begin{macro}{\multirowthead}
-% The macro for multirow column heads. If no \pkg{multirow} package loaded
+% The macro for multirow column heads. If no \package{multirow} package loaded
% this macro works like |\thead|.
% \begin{macrocode}
\newcommand\multirowthead{\@ifundefined{multirow}%
@@ -1098,8 +1311,6 @@
% set |c|-argument as vertical or horizontal centering alignment if necessary.
% For \texttt{l} and \texttt{r} alignments also redefined alignment
% settings for |\makecell| (|\thead|) blocks.
-% \changes{V0.1d}{2007/05/24}{The \cmd{\empty} command changed to \cmd{\relax}
-% for usage inside \cmd{\@classz}}
% \begin{macrocode}
\newcommand\mcell@l{\def\mcell@ii{l}\let\mcell@c\mcell@ic
\global\let\mcell@left\relax}
@@ -1138,7 +1349,7 @@
\@ifdefinable\mcell@@@tabular{}
\def\mcell@tabular[#1]#2{\mcell@@tabular#1\@nil{#2}}
% \end{macrocode}
-% The code for this macro borrowed from \pkg{caption} 3.x package (AS).
+% The code for this macro borrowed from \package{caption} 3.x package (AS).
% \begin{macrocode}
\newcommand\mcell@ifinlist[2]{%
\let\next\@secondoftwo
@@ -1221,6 +1432,26 @@
% \end{macro}
% \end{macro}
%
+% \begin{environment}{\mcellbox}
+% \begin{macro}{\makecellbox}
+% \begin{macrocode}
+\@ifdefinable\mcell@start{}\@ifdefinable\mcell@stop{}
+\newcommand\mcellbox[1][c]{%
+ \expandafter\mcell@setalign\cellalign\@nil
+ \expandafter\mcell@setalign#1\@nil
+ \expandafter\mcell@box\expandafter\mcell@i\mcell@ii\@nil}
+\@ifdefinable\mcell@box{}
+\def\mcell@box#1#2\@nil{%
+ \ifdim\parindent<\z@\leavevmode\else\noindent\fi
+ \ifmmode\def\mcell@start{$\array}\def\mcell@stop{\endarray$}\else
+ \def\mcell@start{\tabular}\def\mcell@stop{\endtabular}\fi
+ \hbox\bgroup\cellset\mcell@start[#1]{@{}#2@{}}}%
+\def\endmcellbox {\mcell@stop\egroup}
+\newcommand\makecellbox[2][c]{\begin{mcellbox}[#1]#2\end{mcellbox}}
+% \end{macrocode}
+% \end{macro}
+% \end{environment}
+%
% \begin{macro}{\cellset}
% \begin{macro}{\cellgape}
% \begin{macro}{\cellalign}
@@ -1286,10 +1517,11 @@
%
% \begin{macro}{\gape}
% \begin{macro}{\setcellgapes}
-% The macro itself. It uses analogous to |\smash| macro from \pkg{amsmath}
+% The macro itself. It uses analogous to |\smash| macro from \package{amsmath}
% package.
% \begin{macrocode}
-\newcommand\gape{\@ifnextchar[\@gape{\@gape[tb]}}
+\@ifdefinable\gape{}
+\DeclareRobustCommand\gape{\@ifnextchar[\@gape{\@gape[tb]}}
% \end{macrocode}
%
% The |\setcellgapes| defines settings used by |\makegapedcells| command.
@@ -1349,7 +1581,8 @@
% \begin{macro}{\Gape}
% The macros which put box with necessary parameters in text and math mode.
% \begin{macrocode}
-\newcommand\Gape{\@ifnextchar[\@Gape{\@Gape[\jot]}}
+\@ifdefinable\Gape{}
+\DeclareRobustCommand\Gape{\@ifnextchar[\@Gape{\@Gape[\jot]}}
\@ifdefinable\@Gape{}\@ifdefinable\@@Gape{}
\def\@Gape[#1]{\@ifnextchar[{\@@Gape[#1]}{\@@Gape[#1][#1]}}
\def\@@Gape[#1][#2]{\def\depth{\dp\z@}\def\height{\ht\z@}%
@@ -1380,7 +1613,7 @@
% \end{macro}
% \end{macro}
%
-% \subsection{Modification of command from \pkg{array} package}
+% \subsection{Modification of command from \package{array} package}
%
% \begin{macro}{\makegapedcells}
% \begin{macro}{\nomakegapedcells}
@@ -1388,7 +1621,7 @@
% \begin{macrocode}
\@ifdefinable\mcell@oriclassz{\let\mcell@oriclassz\@classz}
% \end{macrocode}
-% This macros redefine and restore the |\@classz| macro from \pkg{array}
+% This macros redefine and restore the |\@classz| macro from \package{array}
% package.
% \begin{macrocode}
\newcommand\makegapedcells{\let\@classz\mcell@classz}
@@ -1406,7 +1639,7 @@
% \end{macro}
%
% \begin{macro}{\mcell@classz}
-% Redefined |\@classz| macro from \pkg{array} package.
+% Redefined |\@classz| macro from \package{array} package.
% \begin{macrocode}
\newcommand\mcell@classz{\@classx
\@tempcnta \count@
@@ -1436,7 +1669,8 @@
% \begin{macro}{\eline}
% The row of empty cells.
% \begin{macrocode}
-\newcommand\eline[1]{\count@ #1%
+\@ifdefinable\eline{}
+\DeclareRobustCommand\eline[1]{\@temptokena{}\count@ #1%
\advance\count@\m@ne
\loop \@temptokena\expandafter{\the\@temptokena&}%
\advance\count@\m@ne \ifnum\count@>\z@\repeat
@@ -1444,15 +1678,42 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\erows}
+% \begin{macro}{\Xrows}
+% Lazy macros for filling few rows.
+% \begin{macrocode}
+%\newtoks\@temptokenb\newtoks\@temptokenc
+%\newcommand\erows[3][\\ \hline]{\relax\@temptokenb{}\@temptokenc{}\@tempcnta#3\relax
+% \count@#2\advance\count@\m@ne\loop\showthe\@temptokenc
+% \@temptokenc\expandafter{\the\@temptokenc&}%
+% \advance\count@\m@ne \ifnum\count@>\z@\repeat
+% \loop
+% \global\@temptokenb\expandafter{\the\expandafter\@temptokenb\expandafter\the\@temptokenc#1}%
+% \advance\@tempcnta\m@ne \ifnum\@tempcnta>\z@\repeat
+% \the\@temptokenb\showthe\@temptokenb}
+\newcommand\erows[3][\\ \hline]{\@temptokena{}\count@ #3%
+ \loop \@temptokena\expandafter{\the\@temptokena\eline{#2}#1}%
+ \advance\count@\m@ne \ifnum\count@>\z@\repeat
+ \the\@temptokena}
+\newcommand\Xrows[2]{\@temptokena{}\count@ #2%
+ \loop \@temptokena\expandafter{\the\@temptokena#1}%
+ \advance\count@\m@ne \ifnum\count@>\z@\repeat
+ \the\@temptokena}
+% \end{macrocode}
+% \end{macro}
+% \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}
\newcounter{nlinenum}
-\newcommand\rnline{\gdef
+\@ifdefinable\rnline{}
+\DeclareRobustCommand\rnline{\gdef
\TeXr@rus{\let\@Alph\@Asbuk\let\@alph\@asbuk}\@nline}
-\newcommand\nline{\gdef\TeXr@rus{}\@nline}
+\@ifdefinable\nline{}
+\DeclareRobustCommand\nline{\gdef\TeXr@rus{}\@nline}
\newcommand\@nline{\@ifnextchar[%]
{\@@nline}{\@@nline[1]}}
\@ifdefinable\@@nline{}
@@ -1475,7 +1736,7 @@
% \end{macro}
% \end{macro}
%
-% [Borrowed code stuff and explanation from \pkg{enumerate}/\pkg{paralist}
+% [Borrowed code stuff and explanation from \package{enumerate}/\package{paralist}
% packages just with changes of command names.]
%
% Internal token register used to build up the label command from the
@@ -1693,7 +1954,7 @@
%
% \begin{macro}{\Xhline}
% The commands for |\hline| and |\cline| with necessary thickness.
-% \changes{0.0e}{2008/01/12}{The \cmd{\Xhline} adds support for long tables.}
+% Added code for the |longtable| environment.
% \begin{macrocode}
\newcommand\Xhline[1]{\noalign{\ifnum0=`}\fi\arrayrulewidth#1%
\ifx\hline\LT@hline\let\@xhline\LT@@hline\fi