diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/makecell/tablists.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/makecell/tablists.dtx | 793 |
1 files changed, 793 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/makecell/tablists.dtx b/Master/texmf-dist/source/latex/makecell/tablists.dtx new file mode 100644 index 00000000000..0390c886b40 --- /dev/null +++ b/Master/texmf-dist/source/latex/makecell/tablists.dtx @@ -0,0 +1,793 @@ +% \iffalse +% +% tablists.dtx - tabulated list of short items. +% (c) 2007 Olga Lapko (Lapko.O@g23.relcom.ru) +% +% This program is provided under the terms of the +% LaTeX Project Public License distributed from CTAN +% archives in directory macros/latex/base/lppl.txt. +% +% \fi +% +% \iffalse +%<*driver> +\ProvidesFile{tablists.dtx} +%</driver> +%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] +%<package>\ProvidesPackage{tablists} +%<*package> + [2007/05/24 v0.0a (beta) Tabulated list of short items] +%</package> +% +%<*batchfile> +\begingroup + +\input docstrip.tex + +\keepsilent +\askforoverwritefalse + +\generate{\file{tablists.sty}{\from{tablists.dtx}{package}}} + +\endgroup +%</batchfile> +% +%<*driver> +\documentclass{ltxdoc} +\usepackage{paralist} +\usepackage{makecell} +\usepackage{tablists} +\IfFileExists{hyperref.sty}{\usepackage{hyperref}}{} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\makeatletter +\@beginparpenalty10000 +\widowpenalty10000 +\clubpenalty10000 +\makeatother +\providecommand*{\file}[1]{\texttt{#1}} +\providecommand*{\pkg}[1]{\textsf{#1}} +\providecommand*{\cls}[1]{\textsf{#1}} +\providecommand*{\env}[1]{\texttt{#1}} + +%\OnlyDescription +\begin{document} + \DocInput{tablists.dtx} + \PrintChanges +\end{document} +%</driver> +% \fi +% +% \CheckSum{447} +% +% \GetFileInfo{tablists.dtx} +% +% \DoNotIndex{\newcommand,\newenvironment} +% +% +% \title{The \textsf{tablists} package\thanks{This +% file has version number \fileversion, +% last revised \filedate.}} +% \author{% +% Olga Lapko\\ +% {\tt Lapko.O@g23.relcom.ru} } +% \date{\filedate} +% \maketitle +% \begin{abstract} +% This package gives variant of environment for creating of list of short +% items in the way of tabular alignment. That could be useful for list of +% exercises in math educational literature. It allows to build one-level +% and two-level tabulated lists. +% \end{abstract} +% +% \tableofcontents +% +%\newpage +% \section{Building Commands} +% +% \DescribeMacro{tabenum} +% \DescribeMacro{\tabenumitem} +% \DescribeMacro{\item} +% The \env{tabenum} environment prints short items aligned in columns. +% +% Each item starts with |\tabenumitem| command; you may use the |\item| +% macro instead of |\tabenumitem| in this environment. +% First example of \env{tabenum} list---please note that you may set optional +% argument in the same way as in modified environments from \pkg{enumerate} +% or \pkg{paralist} packages: +%\par\begin{small}% +%\begin{verbatim} +%\begin{tabenum}[\bfseries1)]% +%\tabenumitem +%$z=\displaystyle\frac xy$; +%\tabenumitem +%$2^x=9;$\cr +% +%\tabenumitem +%$3^{2x+3}=16 $; +%\tabenumitem +%$z=2x^2+4y^2$;\par +%\item +%$u=\sqrt{x^2+y^2+z^2}$; +%\item +%$v=gt+\displaystyle\frac{g}{4}t$;\\[1ex] +%\item +%$u=2^{5x-3y+z}$; +%\item +%$w=(v+7)^2+(u-3)^2$; +% +% +%\item +%$5^x=\displaystyle\frac{4}{3} ;$ +%\item +%$z=(x+1)^2+y^2$;\\* +%\item +%$2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$ +%\item +%$t=5u^2+8v^2$; +%\end{tabenum} +%\end{verbatim} +%\end{small}% +% \begin{tabenum}[\bfseries1)]% +% \tabenumitem +% $z=\displaystyle\frac xy$; +% \tabenumitem +% $2^x=9;$\cr +% +% \tabenumitem +% $3^{2x+3}=4 $; +% \tabenumitem +% $z=2x^2+4y^2$;\par +% \item +% $u=\sqrt{x^2+y^2+z^2}$; +% \item +% $v=gt+\displaystyle\frac{g}{4}t$;\\[1ex] +% \item +% $u=2^{5x-3y+z}$; +% \item +% $w=(v+7)^2+(u-3)^2$; +% +% +% \item +% $5^x=\displaystyle\frac{4}{3} ;$ +% \item +% $z=(x+1)^2+y^2$;\\* +% \item +% $2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$ +% \item +% $t=5u^2+8v^2$; +% \end{tabenum} +% +% You may see that empty line (or |\par| command), |\\| command and |\cr| +% do the same: start a new row. The |\\| macro works like in array environment +% and allows optional argument with vertical correction. +% (Also the |\\*| command suppresses breaking between pages, see next example.) +% +% Please note that two or more |\par|'s +% |\cr|'s or |\\|'s (and also any combination of these three commands) +% create additional empty lines. +% +% +% \DescribeMacro{\notabenumitem} +% \DescribeMacro{\noitem} +% \DescribeMacro{\skipitem} +% On the next step you can wish to do the list like before more compact. The +% |\multicolumn| does not work here correctly\footnote{ +% Also the plain \TeX's commands like \cs{omit} and \cs{span}/\cs{multispan} commands, +% I think, need too complex code.}. At first you may use plain \TeX's +% command |\hidewidth| to hide width of widest column entry; then you may use +% other variant of |\tabenumitem|(|\item|) command---|\notabenumitem|(|\noitem|)---%^^A +% this command increases list entry, but does not create a new column; +% third command |\skipitem| allows you to skip +% one \env{tabenum} column\footnote{The \env{tabenum} column includes two columns: +% it works like \texttt{rl} columns in \env{tabular} environment. Thus, \cs{skipitem} +% equals to \texttt{\&\&} combination.}. +% Next example show usage of these three commands: +%\par\begin{small}% +%\begin{verbatim} +%\begin{tabenum}[\bfseries1)]% +%\tabenumitem +%$z=\displaystyle\frac xy$; +%\notabenumitem +%$2^x=9;$ +%\tabenumitem +%$3^{2x+3}=4 $. +%\tabenumitem +%$z=2x^2+4y^2$;\nopagebreak +% +%\item +%$u=\sqrt{x^2+y^2+z^2}$; +%\item +%$v=gt+\displaystyle\frac{g}{4}t$, +%\item +%$u=2^{5x-3y+z}$.\cr +%\item +%$w=(v+7)^2+(u-3)^2$; +%\item +%$5^x=\displaystyle\frac{4}{3} ;$ +%\item +%$z=(x+1)^2+y^2$;\\* +%\item +%$2+5+8+ \ldots +(3n+2)=155$, +% $n\in \mathrm{N};$\hidewidth\skipitem +%\item +%$t=5u^2+8v^2$; +%\end{tabenum} +%\end{verbatim} +%\end{small}% +% \begin{tabenum}[\bfseries1)]% +% \tabenumitem +% $z=\displaystyle\frac xy$; +% \notabenumitem +% $2^x=9;$ +% \tabenumitem +% $3^{2x+3}=4 $. +% \tabenumitem +% $z=2x^2+4y^2$;\nopagebreak +% +% \item +% $u=\sqrt{x^2+y^2+z^2}$; +% \item +% $v=gt+\displaystyle\frac{g}{4}t$, +% \item +% $u=2^{5x-3y+z}$.\cr +% \item +% $w=(v+7)^2+(u-3)^2$; +% \item +% $5^x=\displaystyle\frac{4}{3} ;$ +% \item +% $z=(x+1)^2+y^2$;\\* +% \item +% $2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$\hidewidth\skipitem +% \item +% $t=5u^2+8v^2$; +% \end{tabenum} +% +% +% \subsection{Spacing} +% +% Vertical spaces around tabulated list are equal to the list ones |\topsep+\partopsep|. +% +% Space between rows depends on the |\jot| value, like in \pkg{amsmath} environments +% like \env{align}, \pkg{gather} etc. +% +% \DescribeMacro{\tabenumsep} +% The horizontal spacing between items of list. It defined like: +% \begin{quote} +% |\newcommand\tabenumsep{\hskip1em}| +% \end{quote} +% The |\labelsep| parameter is used after item number. +% +% \subsection{The \env{tabenum} environment inside a proper list} +% +% \DescribeMacro{\tabenumindent} +% The |\tabenumindent| macro sets left margin of \env{tabenum}. That could be useful +% inside, e.g., a proper list environments like \env{enumerate} or \env{itemise}. +% It can be defined like horizontal space/skip or text. +% For example: +% \begin{quote} +% |\renewcommand\tabenumindent{\hskip\parindent}| +% \end{quote} +% or +% \begin{quote} +% |\renewcommand\tabenumindent{Word }| +% \end{quote} +% +% \DescribeMacro{\liststrut} +% This command can be useful after alone list number (and not only with +% \env{tabenum} environment). The command raises first line of next +% text block at the baseline of previous. Without any option it puts negative +% baselineskip. If there is a high element (any math sentence) in the first +% line of next text, it must be written in option, the height of this argument used for +% compensating skips argument without |$|'s. +% +% Here the combination of these two commands: +%\par\begin{small}% +%\begin{verbatim} +%\begin{enumerate}[\bfseries1)]% +%\item\renewcommand\tabenumindent{1)\hskip\labelsep}% +% \liststrut[\displaystyle\frac xy] +%\begin{tabenum}[a)]% +%... +%\end{verbatim}% +%\end{small}% +% \begin{enumerate}[\bfseries1)]% +% \item\renewcommand\tabenumindent{1)\hskip\labelsep}% +% \liststrut[\displaystyle\frac /y] +% \begin{tabenum}[a)]% +% \tabenumitem +% {$z=\displaystyle\frac xy$}; +% \notabenumitem +% {$2^x=9;$} +% \tabenumitem +% {$3^{2x+3}=4 $}. +% \tabenumitem +% {$z=2x^2+4y^2$};\nopagebreak +% +% \item +% $u=\sqrt{x^2+y^2+z^2}$; +% \item +% $v=gt+\displaystyle\frac{g}{4}t$, +% \item +% $u=2^{5x-3y+z}$.\\ +% \item +% $w=(v+7)^2+(u-3)^2$; +% \item +% $5^x=\displaystyle\frac{4}{3} ;$ +% \item +% $z=(x+1)^2+y^2$;\cr +% \item +% $2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$\hidewidth\skipitem +% \item +% $t=5u^2+8v^2$; +% \end{tabenum} +% \end{enumerate}% +% +% \subsection{The \env{subtabenum} environment: second level, variant I} +% +% \DescribeMacro{subtabenum} +% The second level of equations/exersizes list \env{subtabenum} based on \env{tabular} +% environment. +% +%\begin{small}% +%\begin{verbatim} +%\begin{tabenum}[\bfseries 1)]% +%\item +%\begin{subtabenum}[a)]% +%\tabenumitem +%$z=\displaystyle\frac xy$; +%\notabenumitem +%$2^x=9;$ +%\tabenumitem +%$3^{2x+3}=4 $. +%\tabenumitem +%$z=2x^2+4y^2$; +%\end{subtabenum} +% +%\item +%\begin{subtabenum}[a)]% +%\item +%$u=\sqrt{x^2+y^2+z^2}$; +%\item +%$v=gt+\displaystyle\frac{g}{4}t$, +%\item +%$u=2^{5x-3y+z}$.\\ +%\item +%$w=(v+7)^2+(u-3)^2$; +%\item +%$5^x=\displaystyle\frac{4}{3} ;$ +%\item +%$z=(x+1)^2+y^2$;\\ +%\item +%$2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$\hidewidth\strut\skipitem +%\item +%$t=5u^2+8v^2$; +%\end{subtabenum} +%\end{tabenum} +%\end{verbatim}% +%\end{small}% +% \begin{tabenum}[\bfseries 1)]% +% \tabenumitem +% \begin{subtabenum}[a)]% +% \tabenumitem +% $z=\displaystyle\frac xy$; +% \notabenumitem +% $2^x=9;$ +% \tabenumitem +% $3^{2x+3}=4 $. +% \tabenumitem +% $z=2x^2+4y^2$; +% \end{subtabenum} +% +% \tabenumitem +% \begin{subtabenum}[a)] +% \item +% $u=\sqrt{x^2+y^2+z^2}$; +% \item +% $v=gt+\displaystyle\frac{g}{4}t$, +% \item +% $u=2^{5x-3y+z}$.\\ +% \item +% $w=(v+7)^2+(u-3)^2$; +% \item +% $5^x=\displaystyle\frac{4}{3} ;$ +% \item +% $z=(x+1)^2+y^2$;\\ +% \item +% $2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$\hidewidth\strut\skipitem +% \item +% $t=5u^2+8v^2$; +% \end{subtabenum} +% \end{tabenum} +% Please note that |\hidewidth| skip is followed by the |\strut| command inside +% \env{subtabenum} environment: +% the skips at the ``edges'' of \env{tabular} columns doesn't work. +% +% \subsection{The \cs{subtabenumitem}/\cs{subitem} macros: second level, variant II} +% +% The previous example shows that columns were destroyed from one +% \env{subtabenum} environment to another. +% +% There is another variant for two-level tabulated list. If you use second option +% in \env{tabenum} environment, you may use |\subtabenumitem|/|\subitem| commands +% for the second level. +% +% \DescribeMacro{\subtabenumitem} +% \DescribeMacro{\subitem} +% If you put |\subitem| after |\item|, you get extra space between +% two numbers, created by |\tabenumsep| skip. The |\negtabenumsep| command +% cancels this skip. +%\par\begin{small}\openup-.75pt +%\begin{verbatim} +%\def\tabenumsep{\qquad} +%\begin{tabenum}[\bfseries 1)][a)]% +%\tabenumitem\negtabenumsep +%\subtabenumitem +%$z=\displaystyle\frac xy$; +%\nosubtabenumitem +%$2^x=9;$ +%\subtabenumitem +%$3^{2x+3}=4 $. +%\subtabenumitem +%$z=2x^2+4y^2$;\\ +%\startnumber{4}\startsubnumber{1} +%\item\negtabenumsep +%\subitem +%$u=\sqrt{x^2+y^2+z^2}$; +%\subitem +%$v=gt+\displaystyle\frac{g}{4}t$, +%\subitem +%$u=2^{5x-3y+z}$.\\\skipitem\negtabenumsep +%\subitem +%$w=(v+7)^2+(u-3)^2$; +%\subitem +%$5^x=\displaystyle\frac{4}{3} ;$ +%\subitem +%$z=(x+1)^2+y^2$;\\\skipitem\negtabenumsep +%\subitem +%$2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$\hidewidth\skipitem +%\subitem +%$t=5u^2+8v^2$; +%\end{tabenum} +%\end{verbatim}% +%\end{small}% +% \begin{tabenum}[\bfseries 1)][a)]% +% \tabenumitem\negtabenumsep +% \subtabenumitem +% $z=\displaystyle\frac xy$; +% \nosubtabenumitem +% $2^x=9;$ +% \subtabenumitem +% $3^{2x+3}=4 $. +% \subtabenumitem +% $z=2x^2+4y^2$;\\ +%\startnumber{4}\startsubnumber{1} +% \item\negtabenumsep +% \subitem +% $u=\sqrt{x^2+y^2+z^2}$; +% \subitem +% $v=gt+\displaystyle\frac{g}{4}t$, +% \subitem +% $u=2^{5x-3y+z}$.\\\skipitem\negtabenumsep +% \subitem +% $w=(v+7)^2+(u-3)^2$; +% \subitem +% $5^x=\displaystyle\frac{4}{3} ;$ +% \subitem +% $z=(x+1)^2+y^2$;\\\skipitem\negtabenumsep +% \subitem +% $2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$\hidewidth\skipitem +% \subitem +% $t=5u^2+8v^2$; +% \end{tabenum} +% There were used two commands |\startnumber| and |\startsubnumber| which set +% next start numbers for items of each of two levels. There is not restarting commands +% for numeration of second level inside environment, +% so, in this case, we need set new start of sublevel by hand. The +% |\startnumber|\footnote{The \cs{startnumber} command can be used inside any list +% environment.} +% allows you to divide \env{tabenum} environment and restart with necessary counter. +% You may still use the traditional |\setcounter{enum..}{..}| combination, +% if you know the level of your list and \env{tabenum}/\allowbreak\env{subtabenum} % environments. +% +% \subsection{Restoring of \cs{item} as command from list environments} +% +% \DescribeMacro{\restorelistitem} +% For the cases when standard lists appear inside \env{tablist}, you may +% restore original |\item| meaning. +% +% \StopEventually{}\clearpage +% +% \section{Code of package} +% +% First goes request of \pkg{makecell} package. +% \begin{macrocode} +\RequirePackage{makecell} +% \end{macrocode} +% +% The horizontal separation space between items/columns. +% \begin{macrocode} +\newcommand\tabenumsep{\hskip1em} +\newcommand\negtabenumsep{\settowidth\@tempdima{\tabenumsep}\hspace*{-\@tempdima}} +% \end{macrocode} +% +% \begin{macro}{\tabenumitem} +% \begin{macro}{\subtabenumitem} +% Definition of aligned items of `tabular'ed list +% \begin{macrocode} +\newcommand\tabenumitem{&\@ifnextchar[%] + {\TeXr@@tabenumitem{&}}% + {\TeXr@tabenumitem{&}{\@enumctr}}} +% \end{macrocode} +% The macro for second level of tabulated items. +% \begin{macrocode} +\newcommand\subtabenumitem{&\@ifnextchar[%] + {\TeXr@@tabenumitem{&}}% + {\TeXr@tabenumitem{&}{\@subenumctr}}} +% \end{macrocode} +% The macros for list and optional numeration. +% \begin{macrocode} +\newcommand\TeXr@tabenumitem[2]{% + \refstepcounter{#2}\@nameuse{label#2}#1} +\@ifdefinable\TeXr@@tabenumitem{} +\def\TeXr@@tabenumitem#1[#2]{{#2}#1} +% \end{macrocode} +% \end{macro}% +% \end{macro}% +% +% \begin{macro}{\notabenumitem} +% \begin{macro}{\nosubtabenumitem} +% Definition of not aligned items with emulation of spaces around. +% The starred form of |\notabenumitem| skips space before number. +% \begin{macrocode} +\newcommand\notabenumitem{\@ifstar + {\TeXr@notabenumitem{\@enumctr}}% + {\tabenumsep\TeXr@notabenumitem{\@enumctr}}} +% \end{macrocode} +% The macro for second level of tabulated items. +% \begin{macrocode} +\newcommand\nosubtabenumitem{\@ifstar + {\TeXr@notabenumitem{\@subenumctr}}% + {\tabenumsep\TeXr@notabenumitem{\@subenumctr}}} +\newcommand\TeXr@notabenumitem[1]{\@ifnextchar[%] + {\TeXr@@tabenumitem{\hskip\labelsep}}% + {\TeXr@tabenumitem{\hskip\labelsep}{#1}}} +% \end{macrocode} +% \end{macro}% +% \end{macro}% +% +% \begin{macro}{\skipitem} +% Command allows to skip column of items in tabulated list. +% One item column occupies two tabular ones and needs |&&| for skipping +% \begin{macrocode} +\newcommand\skipitem[1][1]{\count@=#1\multiply\count@2\advance\count@\@ne + \eline{\count@}} +% \end{macrocode} +% \end{macro}% +% +% \begin{macro}{\tabenumindent} +% If this command empty there is no any indentation. To set necessary indentation +% you may define this command as any text or horizontal skip. +% \begin{macrocode} +\newcommand\tabenumindent{} +% \end{macrocode} +% \end{macro}% +% +% \begin{environment}{tabenum} +% \begin{environment}{rtabenum} +% Start of definition of tabulated lists themselves---\env{tabenum} +% and \env{rtabenum}. +% They allow usage of optional argument in the same way as in +% \env{enumerate} environment from \pkg{paralist} package. +% The second definition, \env{rtabenum}, replaces |\Alph|/|\alph| +% numeration for \texttt{A}/texttt{a} entries by Russian +% |\Asbuk|/|\asbuk| numeration. +% \begin{macrocode} +\newenvironment{rtabenum}{\let\Alph\Asbuk\let\alph\asbuk + \begin{tabenum}}{\end{tabenum}} +% \end{macrocode} +% +% These environments use mechanism of optional argument from |\@enumlabel@| +% command. +% \begin{macrocode} +\newcommand\tabenum{\@ifnextchar[{\TeXr@tabenum@}{\TeXr@tabenum@[]}} +\@ifdefinable\TeXr@tabenum@{} +\def\TeXr@tabenum@[#1]{\@ifnextchar[{\TeXr@tabenum@@[#1]}{\TeXr@tabenum@@[#1][]}} +% \end{macrocode} +% +% These environments allow two options for item numeration and subitem numeration. +% \begin{macrocode} +\@ifdefinable\TeXr@tabenum@@{} +\long\def\TeXr@tabenum@@[#1][#2]{\par + \addpenalty\@beginparpenalty +% \end{macrocode} +% Vertical spaces around \env{tabenum} similar to spaces in list environments. +% The space above reduced by |\jot| to make it equal to the space below. +% \begin{macrocode} + \@topsepadd\topsep\advance\@topsepadd\partopsep + \advance\@topsepadd-\jot + \ifdim\@topsepadd<\z@\@topsepadd=\z@\fi + \if@nobreak\else\addvspace\@topsepadd\fi +% \end{macrocode} +% Interline spacing enlarged by |\jot| as in \pkg{amsmath}'s environments like +% \env{align} etc. +% \begin{macrocode} + \openup\jot +% \end{macrocode} +% Check for list depth and settings for first level. +% If it exceeded, the error message pops out. +% \begin{macrocode} + \ifnum\@enumdepth>\thr@@ + \@toodeep + \else + \advance\@enumdepth\@ne + \edef\@enumctr{enum\romannumeral\the\@enumdepth}% + \setcounter{\@enumctr}\z@ + \let\item\tabenumitem\let\noitem\notabenumitem +% \end{macrocode} +% Check for list depth and settings for second level. +% If it exceeded, one level used. +% \begin{macrocode} + \ifnum\@enumdepth>\thr@@ + \PackageWarning{tablists}{tablist has one level}{}% + \let\subitem\tabenumitem\let\nosubitem\notabenumitem% + \else + \let\subitem\subtabenumitem\let\nosubitem\nosubtabenumitem + \advance\@enumdepth\@ne + \edef\@subenumctr{enum\romannumeral\the\@enumdepth}% + \setcounter{\@subenumctr}\z@ + \fi + \fi +% \end{macrocode} +% Checks for first option. If option is absent used default enumerating. +% \begin{macrocode} + \def\tempa{#1}\ifx\tempa\empty\else + \TeXr@enumlabel@{#1}{\@enumctr}\fi +% \end{macrocode} +% Checks for second option. If option is absent used default enumerating. +% \begin{macrocode} + \def\tempa{#2}\ifx\tempa\empty\else + \TeXr@enumlabel@{#2}{\@subenumctr}\fi + \@TeXr@tabenum + } +% \end{macrocode} +% There building macro for item/subitem labels. +% \begin{macrocode} +\newcommand\TeXr@enumlabel@[2]{% + \@tempcnta0 + \TeXr@lab{}\def\TeXr@label{\TeXr@label@{#2}}% + \expandafter\TeXr@loop\@gobble{}#1\@@@ + \ifnum\@tempcnta=1\else + \PackageWarning{tablists}{Incorrect label; no or multiple + counters.\MessageBreak The label is: \@gobble#1}% + \fi + \expandafter\edef\csname label#2\endcsname{\the\TeXr@lab}% + \expandafter\let\csname the#2\endcsname\TeXr@the% +} +% \end{macrocode} +% +% For column alignment is used |\halign| command of plain \TeX. +% In this case \env{tabenum}/\env{rtabenum} environments can run through a few pages. +% \begin{macrocode} +\newcommand{\@TeXr@tabenum}{\begingroup + \let\\\TeXr@arraycr\TeXr@tlist@arrayjot\let\par=\cr + \settowidth\@tempdima{\tabenumindent}% + \settowidth\@tempdimb{\tabenumsep}% + \halign\bgroup + \strut##\hskip\@tempdima + \hskip-\@tempdimb&&\tabenumsep\hfil##\hskip\labelsep&##\hfil\cr} +% \end{macrocode} +% +% Finish of \env{tabenum} environment. +% \begin{macrocode} +\def\endtabenum{\crcr\egroup\endgroup\gdef\tabenumindent{}\par + \addpenalty\@endparpenalty + \advance\@topsepadd\jot + \addvspace\@topsepadd} +% \end{macrocode} +% \end{environment}% +% \end{environment}% +% +% \begin{environment}{subtabenum} +% \begin{environment}{rsubtabenum} +% The tabulated list of second level. This list uses a real \env{tabular} +% environment. In this case it is placed in one page. This list as its +% parent environment use optional argument in the way of \pkg{paralist}'s +% \env{enumerate}. +% \begin{macrocode} +\newcommand\subtabenum[1][]{\TeXr@tlist@arrayjot + \setcounter{\@subenumctr}\z@ + \def\tempa{#1}\ifx\tempa\empty\else + \TeXr@enumlabel@{#1}{\@subenumctr}\fi + \let\item\subtabenumitem\let\noitem\nosubtabenumitem + \let\tabenumitem\subtabenumitem\let\notabenumitem\nosubtabenumitem + \let\subitem\subtabenumitem\let\nosubitem\nosubtabenumitem + \@TeXr@subtabenum + } +\newcommand{\@TeXr@subtabenum}{% + \hbox{\ifnum0=`}\fi + \begin{tabular}[t]{@{\tabenumindent}l@{}*{12}{r@{\hskip\labelsep}l@{\tabenumsep}}@{}}% + } +\def\endsubtabenum{\end{tabular}% + \ifnum0=`{\fi}\gdef\tabenumindent{}} +% \end{macrocode} +% +% Russified environment with |\Asbuk|/|\asbuk| counters instead of +% |\Alph|/|\alph|. +% \begin{macrocode} +\newenvironment{rsubtabenum}{\let\Alph\Asbuk\let\alph\asbuk + \begin{subtabenum}}{\end{subtabenum}} +% \end{macrocode} +% \end{environment}% +% \end{environment}% +% +% \begin{macro}{\arrayjot} +% The redefinition of |\\| command inside tabular to enlarge interline spacing +% by |\jot| value---to create analogous spacing to parent, \env{tabenum}, environment. +% \begin{macrocode} +\@ifdefinable\TeXr@rixarraycr{} +\let\TeXr@rixarraycr\TeXr@xarraycr +\newcommand\TeXr@Xarraycr{\@ifnextchar [ \TeXr@Xargarraycr {\@argarraycr[\jot]}} +\@ifdefinable\TeXr@Xargarraycr{} +\def\TeXr@Xargarraycr[#1]{\@tempdima\jot\advance\@tempdima#1% + \@argarraycr[\@tempdima]} +\@ifdefinable\TeXr@arrayjot{} +\def\TeXr@arrayjot [#1]{\let\@xarraycr\TeXr@Xarraycr\jot#1} +\def\noarrayjot{\let\@xarraycr\TeXr@rixarraycr} +\newcommand\TeXr@tlist@arrayjot {\@ifnextchar[\TeXr@arrayjot{\TeXr@arrayjot[\jot]}} +\AtBeginDocument{\let\arrayjot\TeXr@tlist@arrayjot} +\def\TeXr@arraycr{% + \relax\iffalse{\fi\ifnum 0=`}\fi\@ifstar{\vadjust{\penalty\@M}\@xarraycr}\@xarraycr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\startnumber} +% The variant of |\setcounter{enum..}{..}| sentence. +% This command sets start number of current list (you must put this command +% inside of list or \env{tabenum} environment). +% The |\setcounter{enum..}{..}| sentence needs previous number, +% but |\startnumber| needs a real start number of a list. +% \begin{macrocode} +\newcommand\startnumber[1]{\count@#1\advance\count@-1% + \global\expandafter\csname c@\@enumctr\endcsname\count@} +\newcommand\startsubnumber[1]{\count@#1\advance\count@-1% + \global\expandafter\csname c@\@subenumctr\endcsname\count@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\liststrut} +% For the cases of \env{tablist} appears just after empty +% \env{enumerate} (or analogous) list entry. +% This command inserts negative |\baselineskip| and put start of +% `tabular'ed list on the baseline of list number. +% +% Optional argument allows to align baselines in the case of height +% elements in first line of \env{tablist} +% \begin{macrocode} +\newcommand\liststrut[1][]{\def\tempa{#1}\ifx\tempa\empty + \strut + \@tempdima-1.3\baselineskip + \vspace*{\@tempdima}\par% + \else\settoheight\@tempdima{{$#1$}}\strut + \advance\@tempdima\lineskip + \noindent\vrule\@height\@tempdima\@width\z@\@depth\z@ + \strut\advance\@tempdima.3\baselineskip + \vspace*{-\@tempdima}\par% + \fi + \@nobreaktrue} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\restorelistitem} +% For the cases when standard lists appear inside \env{tablist}. +% \begin{macrocode} +\let\TeXr@orilistitem\item +\newcommand\restorelistitem{\let\item\TeXr@orilistitem} +% \end{macrocode} +% \end{macro} +% +% \Finale +\endinput +%% +%% End of file tablists.dtx
\ No newline at end of file |