diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/tablists |
Initial commit
Diffstat (limited to 'macros/latex/contrib/tablists')
-rw-r--r-- | macros/latex/contrib/tablists/README | 28 | ||||
-rw-r--r-- | macros/latex/contrib/tablists/tablists-rus.pdf | bin | 0 -> 128353 bytes | |||
-rw-r--r-- | macros/latex/contrib/tablists/tablists-rus.tex | 706 | ||||
-rw-r--r-- | macros/latex/contrib/tablists/tablists.dtx | 933 | ||||
-rw-r--r-- | macros/latex/contrib/tablists/tablists.pdf | bin | 0 -> 119207 bytes |
5 files changed, 1667 insertions, 0 deletions
diff --git a/macros/latex/contrib/tablists/README b/macros/latex/contrib/tablists/README new file mode 100644 index 0000000000..13c87e7810 --- /dev/null +++ b/macros/latex/contrib/tablists/README @@ -0,0 +1,28 @@ +tablists 0.0e (beta) +Tabulated list of short items (exersizes in textbooks). + + Package offers environments and commands for one-level and two-level + lists of short items (exersizes in textbooks). The environments follow + support of optional arguments of item numbering as enumerate or paralist + packages. + +Documentation: tablists.pdf, tablist-rus.pdf. + +Installation hints: +The tablists.dtx is self-installation file. +Run LaTeX (pdfLaTeX) with this file, you get: + tablists.dvi (or .pdf) file -- documentation, + tablists.sty file -- the package file, + and other LaTeX files. + +Copy tablists.sty file in the folder (directory) with other packages: +(the way to LaTeX package looks like + %texmf folder%/tex/latex/tablists/tablists.sty) +Then you need to refresh your databases -- see documentation +of your local TeX distribution (MikTeX, TeXlive etc.) + +Also to get help for installation please visit: +http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages +http://www.tex.ac.uk/cgi-bin/texfaq2html?label=miktexinst +http://www.tex.ac.uk/cgi-bin/texfaq2html?label=privinst + diff --git a/macros/latex/contrib/tablists/tablists-rus.pdf b/macros/latex/contrib/tablists/tablists-rus.pdf Binary files differnew file mode 100644 index 0000000000..65fff17900 --- /dev/null +++ b/macros/latex/contrib/tablists/tablists-rus.pdf diff --git a/macros/latex/contrib/tablists/tablists-rus.tex b/macros/latex/contrib/tablists/tablists-rus.tex new file mode 100644 index 0000000000..a2b5a70abe --- /dev/null +++ b/macros/latex/contrib/tablists/tablists-rus.tex @@ -0,0 +1,706 @@ +% \iffalse +% +% tablists-rus.dtx - tabulated list of short items. +% Russian documentation. +% (c) 2007, 2008 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-rus.tex} +\documentclass{ltxdoc} + +\usepackage{mathtext} +\usepackage[T2A]{fontenc} +\usepackage[cp1251]{inputenc} +\usepackage[english,russian]{babel} + +\usepackage{ifpdf} +\ifpdf + \usepackage{mathptm} + \IfFileExists{t2apxtt.fd}{\def\ttdefault{pxtt}}{} + \IfFileExists{t2aftm.fd}{\def\rmdefault{ftm}}{} + \IfFileExists{t2aftx.fd}{\def\sfdefault{ftx}}{} +\fi + +\usepackage{paralist} +\usepackage{makecell} +\usepackage{amsthm} +\newtheorem{theorem}{Theorem} +\usepackage{tablists} +\IfFileExists{hyperref.sty}{\usepackage[unicode]{hyperref}}{} +\IfFileExists{listpen.sty}{\usepackage{listpen}}{} +\providecommand\RestoreSpaces{\medskip} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\makeatletter +\@beginparpenalty10000 +\widowpenalty10000 +\clubpenalty10000 +\makeatother +\providecommand*{\file}[1]{\texttt{#1}} +\providecommand*{\package}[1]{\textsf{#1}} +\providecommand*{\cls}[1]{\textsf{#1}} +\providecommand*{\env}[1]{\texttt{#1}} + +%\OnlyDescription +\begin{document} + \DocInput{tablists-rus.tex} + \PrintChanges +\end{document} +%</driver> +% \fi +% +% \CheckSum{0} +% +% \GetFileInfo{tablists-rus.tex} +% +% \DoNotIndex{\newcommand,\newenvironment} +% +% +% \title{Пакет \textsf{tablists}} +% \author{% +% Ольга Лапко\\ +% {\tt Lapko.O@g23.relcom.ru} } +% \date{2008/01/14} +% \maketitle +% \begin{abstract} +%^^A% This package gives variant of environment for creating of list of short +%^^A% items in the way of tabular alignment. That could be useful for list of +%^^A% exercises in math educational literature. It allows to build one-level +%^^A% and two-level tabulated lists. +% Данный пакет даёт вариант окружения для создания перечня коротких пунктов +% выровненных по колонкам. Это может быть полезно для разделов упражнений +% в~математических учебниках. Можно создать одноуровневые и~двухуровневые +% перечни. +% \end{abstract} +% +% \tableofcontents +% +%\newpage +%^^A% \section{Building Commands} +% \section{Основные команды} +% +% \DescribeMacro{tabenum} +% \DescribeMacro{\tabenumitem} +% \DescribeMacro{\item} +%^^A% The \env{tabenum} list creates list of short items aligned in columns. +% Окружение \env{tabenum} размещает короткие пункты в~виде таблицы. +% +%^^A% Each item starts with |\tabenumitem| command. +%^^A% First example of \env{tabenum} list---please note that you may set optional +%^^A% argument in the same way as in \package{paralist} +%^^A% environments: +% Каждый пункт начинается с~команды |\tabenumitem|. +% Первый вариант окружения \env{tabenum}---обратите внимание что можно задать +% опцию так же как и~в~окружениях пакетов \package{enumerate} или \package{paralist}: +%\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 +%\tabenumitem +%$u=\sqrt{x^2+y^2+z^2}$; +%\tabenumitem +%$v=gt+\displaystyle\frac{g}{4}t$;\\[1ex] +%\tabenumitem +%$u=2^{5x-3y+z}$; +%\tabenumitem +%$w=(v+7)^2+(u-3)^2$; +% +% +%\tabenumitem +%$5^x=\displaystyle\frac{4}{3} ;$ +%\tabenumitem +%$z=(x+1)^2+y^2$;\\* +%\tabenumitem +%$2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$ +%\tabenumitem +%$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 +% \tabenumitem +% $u=\sqrt{x^2+y^2+z^2}$; +% \tabenumitem +% $v=gt+\displaystyle\frac{g}{4}t$;\\[1ex] +% \tabenumitem +% $u=2^{5x-3y+z}$; +% \tabenumitem +% $w=(v+7)^2+(u-3)^2$; +% +% +% \tabenumitem +% $5^x=\displaystyle\frac{4}{3} ;$ +% \tabenumitem +% $z=(x+1)^2+y^2$;\\* +% \tabenumitem +% $2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$ +% \tabenumitem +% $t=5u^2+8v^2$; +% \end{tabenum} +% +%^^A% You may see that empty line (or |\par| command), |\\| command and |\cr| +%^^A% do the same: start a new row. The |\\| command works like in array environment +%^^A% and allows optional argument with vertical correction. +%^^A% (Also the |\\*| command suppresses breaking between pages, see next example.) +% Из примера видно что пустая строка (или команда |\par|), команды +% |\\| и~|\cr| +% все начинают новый ряд. Команда |\\| позволяет в~опции задать вертикальную +% корректирующую отбивку. +% (Кроме этого действует и~команда |\\*|, запрещающая переход на новую страницу.) +% +%^^A% Please note that two or more |\par|'s +%^^A% |\cr|'s or |\\|'s (and also any combination of these three commands) +%^^A% create additional empty lines. +% Обратите в~примере внимание, что две и~более команд |\par| +% |\cr| или |\\| (а~также их любая комбинация) создают дополнительные пустые строки. +% +% +%^^A% You may use the |\item| +%^^A% macro instead of |\tabenumitem| in this \env{tabenum} environments (see next examples). +% Внутри окружения \env{tabenum} вместо команды |\tabenumitem| можно использовать и~|\item| +% (см.~примеры ниже). +% +% \DescribeMacro{\notabenumitem} +% \DescribeMacro{\noitem} +% \DescribeMacro{\skipitem} +%^^A% On the next step you can wish to do the list like before more compact. The +%^^A% |\multicolumn| does not work here correctly\footnote{ +%^^A% Also the plain \TeX's commands like \cs{omit} and \cs{span}/\cs{multispan} commands, +%^^A% I think, need too complex code.}. At first you may use plain \TeX's +%^^A% command |\hidewidth| to hide width of widest column entry; then you may use +%^^A% other variant of |\tabenumitem|(|\item|) command---|\notabenumitem|(|\noitem|)---%^^A +%^^A% this command increases list entry, but does not create a new column; +%^^A% third command |\skipitem| allows you to skip +%^^A% one \env{tabenum} column\footnote{The \env{tabenum} column includes two columns: +%^^A% it works like \texttt{rl} columns in \env{tabular} environment. Thus, \cs{skipitem} +%^^A% equals to \texttt{\&\&} combination.}. +%^^A% Next example show usage of these three commands: +% Глядя на этот пример, вы захотите сделать такой список более компактным. Команда +% |\multicolumn| не будет работать здесь корректно\footnote{ +% Я~думаю, что и~команды plain \TeX'а \cs{omit} и~\cs{span}/\cs{multispan}, +% тоже потребуют сложной записи.}. Во"=первых можно воспользоваться командой +% plain \TeX'а +% |\hidewidth| чтобы «скрыть» ширину самого широкого пункта; во"=вторых можно +% использовать вариант команды |\tabenumitem|~(|\item|) +% \cdash--- |\notabenumitem|~(|\noitem|) \cdash--- +% в~этом случае создаётся нумерация пункта, но не создаётся новая колонка; +% третья команда, |\skipitem|, позволяет пропустить +% одну колонку пунктов \env{tabenum}\footnote{Колонка пунктов \env{tabenum} +% состоит из двух колонок: +% это ничто иное как две колонки \texttt{rl} окружения \env{tabular}. +% Отсюда, вместо \cs{skipitem} +% можно записать комбинацию двух знаков табуляции:~\texttt{\&\&}.}. +% Следующий пример демонстрирует использование этих трёх команд: +%\par\begin{small} +%\begin{verbatim} +%\begin{tabenum}[\bfseries1)]% +%\item +%$z=\displaystyle\frac xy$; +%\noitem +%$2^x=9;$ +%\item +%$3^{2x+3}=4 $. +%\item +%$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)]% +% \item\label{tabenum:I:1} +% $z=\displaystyle\frac xy$; +% \noitem\label{tabenum:I:2} +% $2^x=9;$ +% \item +% $3^{2x+3}=4 $. +% \item +% $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\label{tabenum:I:11} +% $2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$\hidewidth\skipitem +% \item +% $t=5u^2+8v^2$; +% \end{tabenum} +%^^A% The items \ref{tabenum:I:1} and \ref{tabenum:I:2} were joined in one column: the item \ref{tabenum:I:2} +%^^A% used |\noitem| (|\notabenumitem|) command. The item \ref{tabenum:I:11} occupies two columns, +%^^A% so it uses |\hidewidth| and |\skipitem| commands. +% Пункты \ref{tabenum:I:1} и~\ref{tabenum:I:2} «объединены» в~одну колонку: пункт \ref{tabenum:I:2} +% использует команду |\noitem| (|\notabenumitem|). Пункт \ref{tabenum:I:11} занял две колонки, +% поэтому в~нём использовались команды |\hidewidth| (спрятать его ширину) и~|\skipitem| (пропустить колонку). +% +% +%^^A% \subsection{Spacing} +% \subsection{Отбивки} +% +%^^A% Vertical spaces around tabulated list are equal to the list ones |\topsep+\partopsep|. +% Вертикальные отбивки вокруг перечня равны отбивкам вокруг обычного перечня: +% |\topsep+\partopsep|. +% +%^^A% Space between rows depends on the |\jot| value, like in \package{amsmath} environments +%^^A% like \env{align}, \package{gather} etc. +% Отбивки между рядами зависят от величины |\jot|, как и~в~окружениях многострочных +% формул в~окружениях пакета \package{amsmath}: +% \env{align}, \package{gather} и~т.\,д. +% +% \DescribeMacro{\tabenumsep} +%^^A% The horizontal spacing between items of list. It defined like: +% Определяет горизонтальные отбивки между пунктами. Задаётся следующим образом: +% \begin{quote} +% |\renewcommand\tabenumsep{\hskip1em}| +% \end{quote} +%^^A% The |\labelsep| parameter is used after item number. +% Отбивка |\labelsep| задаётся после номера. +% +% \DescribeMacro{\tabenumindent} +%^^A% The |\tabenumindent| command sets left margin of \env{tabenum} environment. +%^^A% It can be defined like horizontal space/skip or text, +%^^A% for example: +% Команда |\tabenumindent| определяет левое поле \env{tabenum}. +% Она может быть определена как отбивка или текст (или всё вместе). +% Например: +% \begin{quote} +% |\renewcommand\tabenumindent{\hskip\parindent}| +% \end{quote} +% или +% \begin{quote} +% |\renewcommand\tabenumindent{Word }| +% \end{quote} +%^^A% That could be useful also +%^^A% inside, e.g., a proper list environments like \env{enumerate} or \env{itemise} +%^^A% for corrections of left margins. +% Это может быть также полезно внутри настоящего перечня, типа +% \env{enumerate} или \env{itemise} для выравнивании левого поля. +% +%^^A% \subsection{The \env{tabenum} environment inside a proper list} +% \subsection{Окружение \env{tabenum} внутри настоящего перечня} +% +% +%^^A% The version 0.0e of \package{tablists} package enlarges left margin +%^^A% of \env{tabenum}, when environment appears inside proper list, +%^^A% by the value of left margin of this list. Sometimes left edges +%^^A% of \env{tabenum} labels and list labels of the same level are not aligned +%^^A% correctly (it happens when |\labelwidth| value is not equal to the natural +%^^A% width of labels). In these cases you may define the correction skip +%^^A% with the |\tabenumindent| command. +% Версия 0.0e пакета \package{tablists} увеличивает левое поле окружения +% \env{tabenum}, если последнее оказывается внутри окружения обычного перечня, +% на величину левого поля этого перечня. Иногда левый край меток в~окружении +% \env{tabenum} и~меток в~перечне того же уровня не выравниваются корректно +% (из-за того, что значение ширины поля для меток |\labelwidth| не равно натуральной +% ширине меток). В~этих случаях вы можете корректирующую отбивку с~помощью +% команды |\tabenumindent|. +% +%^^A% Also the version 0.0e loads labels of empty items of upper/outer list +%^^A% at the left side of the first item of \env{tabenum} automatically. It follows +%^^A% mechanism similar to building of empty items in list environment. +%^^A% (Empty items of \LaTeX\ list are consecutively stored to special box register +%^^A% and printed out at the beginning when the list text appears; +%^^A% the same happens at the beginning of \env{tabenum} environment: +%^^A% this box, if not empty, is printed at the left of first \env{tabenum} item.) +% Кроме этого, версия 0.0e помещает номера пустых пунктов старшего перечня +% слева, перед номером первого пункта окружения \env{tabenum} автоматически. +% Здесь используется результат работы механизма для построения/""накопления +% пустых меток в~окружении перечней. +% (Пустые номера"=метки, которые не сопровождаются текстом, в~\LaTeX'овском окружении +% перечней последовательно записываются в~специальный регистр бокса, +% который выводится вначале при появлении текста перечня; также происходит +% и~в~начале окружения \env{tabenum}: этот бокс, если не пустой, печатается +% слева от номера первого пункта.) +%\par\begin{small} +%\begin{verbatim} +%\begin{enumerate}[\bfseries1)]% +%\item +%\begin{rtabenum}[a)]% +%... +%\end{verbatim}% +%\end{small} +% \begin{enumerate}[\bfseries1)]% +% \item +% \begin{rtabenum}[a)]% +% \item +% {$z=\displaystyle\frac xy$}; +% \noitem +% {$2^x=9;$} +% \item +% {$3^{2x+3}=4 $}. +% \item +% {$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{rtabenum} +% \end{enumerate}% +%\par\kern-\baselineskip +% Обратите внимание на использование окружения \env{rtabenum} и~нумерацию русскими буквами. +% +%^^A% \emph{Please note} that for the case of \env{tabenum} environment inside list, +%^^A% there is not compatibility between version 0.0e and earlier +%^^A% versions---left margin of \env{tabenum} is changed (mechanism +%^^A% of placing empty list items on one baseline using compensating vertical +%^^A% spaces could work but its calculation was changed). +% \emph{Обратите также внимание}, что в~случае появления окружения +% \env{tabenum} внутри окружения перечня, нет совместимости между версией 0.0e +% и~более ранними \cdash--- левое поле окружения \env{tabenum} изменено (макрокоманда +% помещения пустых меток старшего перечня путём компенсирующих вертикальных отбивок +% может работать, но механизм подсчёта также отличается в~версии 0.0e от предыдущих, +% см.~также следующий абзац).\smallskip +% +% \begin{small}% +% \DescribeMacro{\liststrut} +%^^A% \emph{Note}: In versions until 0.0d there was offered the |\liststrut| command in the +%^^A% cases when needed to put empty list item on the same line with first item of +%^^A% \env{tabenum}. The command raises first line of next text block at the baseline of +%^^A% previous. (Without any option it puts negative +%^^A% baselineskip. If there is a high element (any math sentence) in the first +%^^A% line of next text, it must be written in option without |$|'s, +%^^A% the height of this argument is used for compensating skips argument.) +%^^A% Since this command must take into account various vertical skips, which +%^^A% appear at the start of new item and also height of printing text, +%^^A% the adjusting of baselines does not always work correctly.\par +% В~версиях вплоть до 0.0d, +% в~случаях если окружение \env{tabenum} шло сразу после пустого номера старшего перечня, +% предлагалась команда |\liststrut|. +% Команда поднимает первую строку следующего за пунктом блока текста +% на базовую линию предыдущего. (Команда без опции даёт отбивку равную отрицательному +% интерлиньяжу (|\baselineskip|). Если в~первой строке следующего блока текста встретился +% высокий элемент (предполагается, что это математическое выражение) +% его повторяют в~опции команды |\liststrut| без знаков |$| и~по его высоте +% рассчитываются компенсирующие отбивки.) +% Поскольку при подсчёте компенсирующей отбивки должно быть принято значение нескольких +% вертикальных отбивок, а~также высота элементов в~тексте, выравнивание базовых линий +% не всегда получается корректным.\par +% \end{small}% +% +%\RestoreSpaces +%^^A% \subsection{The \env{subtabenum} environment: second level, variant I} +% \subsection{Окружение \env{subtabenum}: второй уровень, вариант I} +% +% \DescribeMacro{subtabenum} +%^^A% The second level of equations/exersizes list \env{subtabenum} based on \env{tabular} +%^^A% environment. +% Второй уровень уравнений, окружение \env{subtabenum}, основывается на окружении +% \env{tabular}. +% +%\begin{small} +%\begin{verbatim} +%\begin{tabenum}[\bfseries 1)]% +%\item +%\begin{rsubtabenum}[a)]% +%\item +%$z=\displaystyle\frac xy$; +%\noitem +%$2^x=9;$ +%\item +%$3^{2x+3}=4 $. +%\item +%$z=2x^2+4y^2$; +%\end{rsubtabenum} +% +%\item +%\begin{rsubtabenum}[a)]% +%\item +%$u=\sqrt{x^2+y^2+z^2}$; +%\item +%... +%\end{rsubtabenum} +%\end{tabenum} +%\end{verbatim}% +%\end{small}% +% \begin{tabenum}[\bfseries 1)]% +% \item +% \begin{rsubtabenum}[a)]% +% \item +% $z=\displaystyle\frac xy$; +% \noitem +% $2^x=9;$ +% \item +% $3^{2x+3}=4 $. +% \item +% $z=2x^2+4y^2$; +% \end{rsubtabenum}\nopagebreak +% +% \item +% \begin{rsubtabenum}[a)] +% \item +% $u=\sqrt{x^2+y^2+z^2}$; +% \item +% $v=gt+\gape[b]{\displaystyle\frac{g}{4}}t$, +% \item +% $u=2^{5x-3y+z}$.\\ +% \item +% $w=(v+7)^2+(u-3)^2$; +% \item +% $5^x=\gape[b]{\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{rsubtabenum} +% \end{tabenum} +%^^A% Please note that |\hidewidth| skip is followed by the |\strut| command inside +%^^A% \env{subtabenum} environment: +%^^A% the skips at the ``edges'' of \env{tabular} columns doesn't work. +% Обратите внимание, что внутри окружения \env{subtabenum} после команды +% отбивки |\hidewidth| должна обязательно идти команда |\strut|: +% отбивки по «краям» окружения \env{tabular} не работают. +% +%^^A% \subsection{The \cs{subtabenumitem}/\cs{subitem} macros: second level, variant II} +% \subsection{Команды \cs{subtabenumitem}/\cs{subitem}: второй уровень, вариант II} +% +%^^A% The previous example shows that columns were destroyed from one +%^^A% \env{subtabenum} environment to another. Also the rows of sublist cannot break between pages. +% Предыдущий пример показал, что выравнивание колонок от одного окружения +% \env{subtabenum} к~другому пропадает. Кроме того это окружение нельзя разбить между страницами. +% +%^^A% There is another variant for two-level tabulated list. If you use second option +%^^A% in \env{tabenum} environment, you may use |\subtabenumitem|/|\subitem| commands +%^^A% for the second level. +% Далее идёт ещё один вариант двухуровневого перечня. Если вы зададите вторую опцию +% в~окружении \env{tabenum}, вы можете использовать команды +% |\subtabenumitem|/\allowbreak|\subitem| +% для второго уровня\footnote{Если вторая опция не задана, эти команды работают как +% команды \cs{tabenumitem}/\cs{item}.}. +% +% \DescribeMacro{\subtabenumitem} +% \DescribeMacro{\subitem} +%^^A% If you put |\subitem| after |\item|, you get extra space between +%^^A% two numbers, created by |\tabenumsep| skip. The |\negtabenumsep| command +%^^A% cancels this skip. +% Если задать команду |\subitem| сразу после |\item|, то получится лишний +% пробел между нумерацией, созданный отбивкой |\tabenumsep|. Команда |\negtabenumsep| +% отменяет эту отбивку: в~версии 0.0с она задана уже внутри команды |\tabenumitem|. +%\par\begin{small}\openup-1pt\enlargethispage{2\baselineskip} +%\begin{verbatim} +%\def\tabenumsep{\qquad} +%\begin{rtabenum}[\bfseries 1)][a)]% +%\item +%\subitem +%$z=\displaystyle\frac xy$; +%\nosubitem +%$2^x=9;$ +%\subitem +%$3^{2x+3}=4 $. +%\subitem +%$z=2x^2+4y^2$;\\ +%\startnumber{4} +%\item +%\subitem +%$u=\sqrt{x^2+y^2+z^2}$; +%\subitem +%$v=gt+\displaystyle\frac{g}{4}t$, +%\subitem +%$u=2^{5x-3y+z}$.\\ +%\startsubnumber{7}\subtabrow +%\subitem +%$w=(v+7)^2+(u-3)^2$; +%\subitem +%$5^x=\displaystyle\frac{4}{3} ;$ +%\subitem +%$z=(x+1)^2+y^2$;\\ +%\subtabrow +%\subitem +%$2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$\hidewidth\skipitem +%\subitem +%$t=5u^2+8v^2$; +%\end{rtabenum} +%\end{verbatim}% +%\end{small}% +% \begin{rtabenum}[\bfseries 1)][a)]% +% \item +% \subitem +% $z=\displaystyle\frac xy$; +% \nosubitem +% $2^x=9;$ +% \subitem +% $3^{2x+3}=4 $. +% \subitem +% $z=2x^2+4y^2$;\\ +% \startnumber{4}\relax +% \item +% \subitem +% $u=\sqrt{x^2+y^2+z^2}$; +% \subitem +% $v=gt+\displaystyle\frac{g}{4}t$, +% \subitem +% $u=2^{5x-3y+z}$.\\ \startsubnumber{7}\subtabrow +% \subitem +% $w=(v+7)^2+(u-3)^2$; +% \subitem +% $5^x=\displaystyle\frac{4}{3} ;$ +% \subitem +% $z=(x+1)^2+y^2$;\\ \subtabrow +% \subitem +% $2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$\hidewidth\skipitem +% \subitem +% $t=5u^2+8v^2$; +% \end{rtabenum} +%^^A% There were used two commands |\startnumber| and |\startsubnumber| which set +%^^A% next start numbers for items of each of two levels\footnote{The \cs{startnumber} +%^^A% command can be used inside any list +%^^A% environment.}. The |\startnumber| +%^^A% allows you to divide \env{tabenum} environment and restart with necessary counter. +%^^A% You may still use the traditional |\setcounter{enum..}{..}| combination, +%^^A% if you know the level of your list and \env{tabenum}/\allowbreak\env{subtabenum} environments. +%^^A% For start of the new row from subitem, you need to use~\nobreak\quad1)\nobreak\enskip +%^^A% command |\skipitem| to skip +%^^A% column, occupied by the ``parent'' label and~\nobreak\quad2)\nobreak\enskip +%^^A% command |\negtabenumsep| to undo column separation. +%^^A% These two commands abbreviated by |\subtabrow| command. +% В~примере используются команды |\startnumber| и~|\startsubnumber|, +% задающие начало нумерации для каждого из двух уровней\footnote{Команда \cs{startnumber} может быть использована для любого +% окружения перечня.}. Команда |\startnumber| +% позволяет вам разделить окружение \env{tabenum} и~начать нумерацию с~нужного номера. +% Можно использовать и~традиционную комбинацию |\setcounter{enum..}{..}|, +% если вы знаете уровень ваших окружений перечней +% и~\env{tabenum}/\allowbreak\env{subtabenum}. Для начала следующего ряда с~подпункта +% вам нужны:~\nobreak\quad1)\nobreak\enskip команда |\skipitem|, чтобы пропустить колонку +% со старшим пунктом и~\nobreak\quad2)\nobreak\enskip команда |\negtabenumsep| для отмены +% межколонника. Эти две команды заменяет команда |\subtabrow|. +% +%^^A% \subsection{Placing the QED sign at the end of \env{tabenum} environment} +% \subsection{Размещение знака конца доказательства в~конце \env{tabenum}} +% +%^^A% When the \env{tabenum} environment is used inside \env{proof} environment (the +%^^A% \texttt{amsthm} package), +%^^A% the better way is to put QED at the end of last \env{tabenum} line. You may use +%^^A% the |\tabqedhere| command: +% При использовании окружения \env{tabenum} в~конце окружения \env{proof} (пакет +% \texttt{amsthm}), знак конца доказательства лучше поместить +% в~конце последней строки \env{tabenum}. Для этого можно использовать команду +% |\tabqedhere| (или |\qedhere|): +% +% \begin{theorem}% +%^^A% You may put the QED sign inside the \env{tabenum} environment. +% Знак конца доказательства можно поместить в~конце \env{tabenum}. +% \end{theorem}% +% \begin{proof}% +% Поместим знакомое нам окружение \env{tabenum} внутри окружения \env{proof}, +% и~в~конце первого поместим команду |\tabqedhere| (|\qedhere|): +%\begin{verbatim} +%\begin{theorem} +% ... +%\end{theorem} +%\begin{proof} +% ... +%\begin{rtabenum}[\bfseries 1)][a)]% +%... +%\subitem +%$t=5u^2+8v^2$;\qedhere +%\end{tabenum} +%\end{proof} +%\end{verbatim}% +% \begin{rtabenum}[\bfseries 1)][a)]% +% \item +% \subitem +% $z=\displaystyle\frac xy$; +% \nosubitem +% $2^x=9;$ +% \subitem +% $3^{2x+3}=4 $. +% \subitem +% $z=2x^2+4y^2$;\\ +% \startnumber{4}\relax +% \item +% \subitem +% $u=\sqrt{x^2+y^2+z^2}$; +% \subitem +% $v=gt+\displaystyle\frac{g}{4}t$, +% \subitem +% $u=2^{5x-3y+z}$.\\ \subtabrow +% \subitem +% $w=(v+7)^2+(u-3)^2$; +% \subitem +% $5^x=\displaystyle\frac{4}{3} ;$ +% \subitem +% $z=(x+1)^2+y^2$;\\ \subtabrow +% \subitem +% $2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$\hidewidth\skipitem +% \subitem +% $t=5u^2+8v^2$;\qedhere +% \end{rtabenum} +% \end{proof}% +% +%^^A% \subsection{Restoring of \cs{item} as command from list environments} +% \subsection{Восстановление оригинальной команды \cs{item} для перечней} +% +%^^A% \DescribeMacro{\restorelistitem} +%^^A% For the cases when standard lists appear inside \env{tablist}, you may +%^^A% restore original |\item| meaning. +% \DescribeMacro{\restorelistitem} +% Если внутри окружения \env{tablist} появится окружение обычного перечня, вы можете +% восстановить оригинальную команду |\item|. +% +% \Finale +\endinput +%% +%% End of file tablists-rus.tex
\ No newline at end of file diff --git a/macros/latex/contrib/tablists/tablists.dtx b/macros/latex/contrib/tablists/tablists.dtx new file mode 100644 index 0000000000..df558fa4f9 --- /dev/null +++ b/macros/latex/contrib/tablists/tablists.dtx @@ -0,0 +1,933 @@ +% \iffalse +% +% tablists.dtx - tabulated list of short items. +% (c) 2007, 2008 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> + [2009/08/04 v0.0e (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{ifpdf} +\ifpdf + \usepackage{mathptmx,courier} + \usepackage[scaled=0.90]{helvet} + \addtolength\marginparwidth{15pt} +\fi + +\usepackage{paralist} +\usepackage{makecell} +\usepackage{amsthm} +\newtheorem{theorem}{Theorem} +\usepackage{tablists} +\IfFileExists{hyperref.sty}{\usepackage{hyperref}}{} +\IfFileExists{listpen.sty}{\usepackage{listpen}}{} +\providecommand\RestoreSpaces{\bigskip} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\makeatletter +\@beginparpenalty10000 +\widowpenalty10000 +\clubpenalty10000 +\makeatother +\providecommand*{\file}[1]{\texttt{#1}} +\providecommand*{\package}[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{493} +% +% \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. +% First example of \env{tabenum} list---please note that you may set optional +% argument in the same way as in modified environments from \package{enumerate} +% or \package{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 +%\tabenumitem +%$u=\sqrt{x^2+y^2+z^2}$; +%\tabenumitem +%$v=gt+\displaystyle\frac{g}{4}t$;\\[1ex] +%\tabenumitem +%$u=2^{5x-3y+z}$; +%\tabenumitem +%$w=(v+7)^2+(u-3)^2$; +% +% +%\tabenumitem +%$5^x=\displaystyle\frac{4}{3} ;$ +%\tabenumitem +%$z=(x+1)^2+y^2$;\\* +%\tabenumitem +%$2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$ +%\tabenumitem +%$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 +% \tabenumitem +% $u=\sqrt{x^2+y^2+z^2}$; +% \tabenumitem +% $v=gt+\displaystyle\frac{g}{4}t$;\\[1ex] +% \tabenumitem +% $u=2^{5x-3y+z}$; +% \tabenumitem +% $w=(v+7)^2+(u-3)^2$; +% +% +% \tabenumitem +% $5^x=\displaystyle\frac{4}{3} ;$ +% \tabenumitem +% $z=(x+1)^2+y^2$;\\* +% \tabenumitem +% $2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$ +% \tabenumitem +% $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. +% +% You may use the |\item| +% macro instead of |\tabenumitem| in this \env{tabenum} environments (see next examples). +% +% \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)]% +%\item +%$z=\displaystyle\frac xy$; +%\noitem +%$2^x=9;$ +%\item +%$3^{2x+3}=4 $. +%\item +%$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)]% +% \item\label{tabenum:I:1} +% $z=\displaystyle\frac xy$; +% \noitem\label{tabenum:I:2} +% $2^x=9;$ +% \item +% $3^{2x+3}=4 $. +% \item +% $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\label{tabenum:I:11} +% $2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$\hidewidth\skipitem +% \item +% $t=5u^2+8v^2$; +% \end{tabenum} +% The items \ref{tabenum:I:1} and \ref{tabenum:I:2} were joined in one column: the item \ref{tabenum:I:2} +% used |\noitem| (|\notabenumitem|) command. The item \ref{tabenum:I:11} occupies two columns, +% so it uses the |\hidewidth| (hides item width) and |\skipitem| (skips column of next item) commands. +% +% +% \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 \package{amsmath} environments +% like \env{align}, \package{gather} etc. +% +% \DescribeMacro{\tabenumsep} +% The horizontal spacing between items of list. It defined like: +% \begin{quote} +% |\renewcommand\tabenumsep{\hskip1em}| +% \end{quote} +% The |\labelsep| parameter is used after item number. +% +% \DescribeMacro{\tabenumindent} +% The |\tabenumindent| command sets left margin of \env{tabenum} environment. +% 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} +% That could be useful also +% inside, e.g., a proper list environments like \env{enumerate} or \env{itemise} +% for corrections of left margins. +% +% \subsection{The \env{tabenum} environment inside a proper list} +% +% The version 0.0e of \package{tablists} package enlarges left margin +% of \env{tabenum}, when environment appears inside proper list, +% by the value of left margin of this list. Sometimes left edges +% of \env{tabenum} labels and list labels of the same level are not aligned +% correctly (it happens when |\labelwidth| value is not equal to the natural +% width of labels). In these cases you may define the correction skip +% with the |\tabenumindent| command. +% +% Also the version 0.0e loads labels of empty items of upper/outer list +% at the left side of the first item of \env{tabenum} automatically. It follows +% mechanism similar to building of empty items in list environment. +% (Empty items of \LaTeX\ list are consecutively stored to special box register +% and printed out at the beginning when the list text appears; +% the same happens at the beginning of \env{tabenum} environment: +% this box, if not empty, is printed at the left of first \env{tabenum} item.) +%\par\begin{small}% +%\begin{verbatim} +%\begin{enumerate}[\bfseries1)]% +%\item +%\begin{tabenum}[a)]% +%... +%\end{verbatim}% +%\end{small}% +% \begin{enumerate}[\bfseries1)]% +% \item +% \begin{tabenum}[a)]% +% \item +% {$z=\displaystyle\frac xy$}; +% \noitem +% {$2^x=9;$} +% \item +% {$3^{2x+3}=4 $}. +% \item +% {$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}% +%\par\kern-\baselineskip +% \emph{Please note} that for the case of \env{tabenum} environment inside list, +% there is not compatibility between version 0.0e and earlier +% versions---left margin of \env{tabenum} is changed (mechanism +% of placing empty list items on one baseline using compensating vertical +% spaces could work but its calculation was changed, see also next paragraph).\smallskip +% +% \begin{small}% +% \DescribeMacro{\liststrut} +% In versions until 0.0d there was offered the |\liststrut| command in the +% cases when needed to put empty list item on the same line with first item of +% \env{tabenum}. 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 without |$|'s, +% the height of this argument is used for compensating skips argument.) +% Since this command must take into account various vertical skips, which +% appear at the start of new item and also height of printing text, +% the adjusting of baselines does not always work correctly.\par +% \end{small}% +% \RestoreSpaces +% \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)]% +%\item +%$z=\displaystyle\frac xy$; +%\noitem +%$2^x=9;$ +%\item +%$3^{2x+3}=4 $. +%\item +%$z=2x^2+4y^2$; +%\end{subtabenum} +% +%\item +%\begin{subtabenum}[a)]% +%\item +%$u=\sqrt{x^2+y^2+z^2}$; +%\item +%... +%\end{subtabenum} +%\end{tabenum} +%\end{verbatim}% +%\end{small}% +% \begin{tabenum}[\bfseries 1)]% +% \item +% \begin{subtabenum}[a)]% +% \item +% $z=\displaystyle\frac xy$; +% \noitem +% $2^x=9;$ +% \item +% $3^{2x+3}=4 $. +% \item +% $z=2x^2+4y^2$; +% \end{subtabenum}\nopagebreak +% +% \item +% \begin{subtabenum}[a)] +% \item +% $u=\sqrt{x^2+y^2+z^2}$; +% \item +% $v=gt+\gape[b]{\displaystyle\frac{g}{4}}t$, +% \item +% $u=2^{5x-3y+z}$.\\ +% \item +% $w=(v+7)^2+(u-3)^2$; +% \item +% $5^x=\gape[b]{\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 or before |\\| command 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. Also the rows of sublist cannot break between pages. +% +% \DescribeMacro{\subtabenumitem} +% \DescribeMacro{\subitem} +% 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\footnote{If there are not second optional argument, these commands +% work like \cs{tabenumitem}/\cs{item}.}. +% +% If you put |\subtabenumitem| (|\subitem|) after |\tabenumitem| (|\item|), you get extra space between +% two numbers, created by |\tabenumsep| skip. The |\negtabenumsep| command +% cancels this skip: the version 0.0c included this command inside the |\tabenumitem| definition. +%\par\begin{small}\openup-1pt\enlargethispage{2\baselineskip} +%\begin{verbatim} +%\def\tabenumsep{\qquad} +%\begin{tabenum}[\bfseries 1)][a)]% +%\item +%\subitem +%$z=\displaystyle\frac xy$; +%\nosubitem +%$2^x=9;$ +%\subitem +%$3^{2x+3}=4 $. +%\subitem +%$z=2x^2+4y^2$;\\ +%\startnumber{4} +%\item +%\subitem +%$u=\sqrt{x^2+y^2+z^2}$; +%\subitem +%$v=gt+\displaystyle\frac{g}{4}t$, +%\subitem +%$u=2^{5x-3y+z}$.\\ +%\startsubnumber{7}\subtabrow +%\subitem +%$w=(v+7)^2+(u-3)^2$; +%\subitem +%$5^x=\displaystyle\frac{4}{3} ;$ +%\subitem +%$z=(x+1)^2+y^2$;\\ +%\subtabrow +%\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)]% +% \item +% \subitem +% $z=\displaystyle\frac xy$; +% \nosubitem +% $2^x=9;$ +% \subitem +% $3^{2x+3}=4 $. +% \subitem +% $z=2x^2+4y^2$;\\ +% \startnumber{4}\relax +% \item +% \subitem +% $u=\sqrt{x^2+y^2+z^2}$; +% \subitem +% $v=gt+\displaystyle\frac{g}{4}t$, +% \subitem +% $u=2^{5x-3y+z}$.\\ +%\startsubnumber{7}\subtabrow +% \subitem +% $w=(v+7)^2+(u-3)^2$; +% \subitem +% $5^x=\displaystyle\frac{4}{3} ;$ +% \subitem +% $z=(x+1)^2+y^2$;\\ +%\subtabrow +% \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\footnote{The \cs{startnumber} +% command can be used inside any list +% environment.}. The |\startnumber| +% 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. +% For start of the new row from subitem, you need to use~\nobreak\quad1)\nobreak\enskip +% the |\skipitem| command to skip +% column, occupied by the ``parent'' label (|\tabenumitem|) and~\nobreak\quad2)\nobreak\enskip +% the |\negtabenumsep| command to undo column separation. +% These two commands abbreviated by |\subtabrow| command. +% +% \subsection{Placing the QED sign at the end of \env{tabenum} environment} +% +% When the \env{tabenum} environment is used inside \env{proof} environment (the +% \texttt{amsthm} package), +% the better way is to put QED at the end of last \env{tabenum} line. You may use +% the |\tabqedhere| command: +% +% \begin{theorem}% +% You may put the QED sign inside the \env{tabenum} environment. +% \end{theorem}% +% \begin{proof}% +% Let's put our favorite \env{tabenum} environment inside the \env{proof} one, +% and at the end of it write the |\tabqedhere| (or |\qedhere|) command: +%\begin{verbatim} +%\begin{theorem} +% You may put the QED sign inside the \env{tabenum} environment. +%\end{theorem} +%\begin{proof} +% Let's put... +%\begin{tabenum}[\bfseries 1)][a)]% +%... +%\subitem +%$t=5u^2+8v^2$;\qedhere +%\end{tabenum} +%\end{proof} +%\end{verbatim}% +% \begin{tabenum}[\bfseries 1)][a)]% +% \item +% \subitem +% $z=\displaystyle\frac xy$; +% \nosubitem +% $2^x=9;$ +% \subitem +% $3^{2x+3}=4 $. +% \subitem +% $z=2x^2+4y^2$;\\ +% \startnumber{4}\relax +% \item +% \subitem +% $u=\sqrt{x^2+y^2+z^2}$; +% \subitem +% $v=gt+\displaystyle\frac{g}{4}t$, +% \subitem +% $u=2^{5x-3y+z}$.\\ \subtabrow +% \subitem +% $w=(v+7)^2+(u-3)^2$; +% \subitem +% $5^x=\displaystyle\frac{4}{3} ;$ +% \subitem +% $z=(x+1)^2+y^2$;\\ \subtabrow +% \subitem +% $2+5+8+ \ldots +(3n+2)=155$, $n\in \mathrm{N};$\hidewidth\skipitem +% \subitem +% $t=5u^2+8v^2$;\qedhere +% \end{tabenum} +% \end{proof}% +% +% \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 \package{makecell} package. +% \begin{macrocode} +\RequirePackage{makecell} +\@ifpackagelater{makecell}{2007/05/24 V0.1d}{}{\PackageError + {tablists}{For a successful cooperation we need at least\MessageBreak + version `2007/05/24 V0.1d' of package makecell,\MessageBreak + but only version\MessageBreak + `\csname ver@makecell.\@pkgextension\endcsname'\MessageBreak + is available}\@eha\endinput} +% \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{\ifvoid\@labels\else\llap{\box\@labels\hspace{-\@totalleftmargin}}\fi + &\@ifnextchar[% + {\TeXr@@tabenumitem{&}}% + {\TeXr@tabenumitem{&}{\@enumctr}\setcounter{\@subenumctr}\z@}} +% \end{macrocode} +% The macro for second level of tabulated items. +% \begin{macrocode} +\newcommand\subtabenumitem{\ifnum\value{\@subenumctr}=\z@\negtabenumsep + \let\negtabenumsep\relax\fi& + \@ifnextchar[%] + {\TeXr@@tabenumitem{&}}% + {\TeXr@tabenumitem{&}{\@subenumctr}}} +% \end{macrocode} +% The macros for list and optional numeration. For a successful usage of |\label|--|\ref| mechanism +% the |\refstepcounter| contains were divided in two parts: the |\stepcounter| command was placed in the +% first column, before printing of label, on the second column was placed mechanism of creation +% labels. +% \changes{0.0b}{2007/09/07}{The \cmd{\refstepcounter} command divided into two parts to allow +% labels for tabular items.} +% \begin{macrocode} +\newcommand\TeXr@tabenumitem[2]{% + \stepcounter{#2}{\@nameuse{label#2}}#1 + \protected@edef + \@currentlabel{\csname p@#2\endcsname\csname the#2\endcsname}} +\@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}{\subtabrow} +% Command allows to skip column of items in tabulated list. +% One item column occupies two tabular ones and needs |&&| for skipping +% \begin{macrocode} +\newcommand\subtabrow{\skipitem\negtabenumsep} +% \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 \package{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 + \tabenum}{\endtabenum} +% \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\vspace{-\jot}\else\addvspace\@topsepadd\fi +% \end{macrocode} +% Interline spacing enlarged by |\jot| as in \package{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}\gdef\tabenumindent{}% + \settowidth\@tempdimb{\tabenumsep}% + \ifnum\@listdepth>\z@\advance\@tempdima\@totalleftmargin\fi + \let\qedhere\tabqedhere + \halign\bgroup + \strut##\hskip\@tempdima + \hskip-\@tempdimb&&\hskip\@tempdimb\hfil##\hskip\labelsep + &##\hfil\cr} +% \end{macrocode} +% +% Finish of \env{tabenum} environment. +% \begin{macrocode} +\def\endtabenum{\crcr\egroup\endgroup\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 \package{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}{\let\negtabenumsep\relax + \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% + \subtabenum}{\endsubtabenum} +% \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 high +% elements in first line of \env{tablist}. In the version 0.0e the calculation +% of compensating space was changed. +% \begin{macrocode} +\newcommand\liststrut[1][]{\def\tempa{#1}\ifx\tempa\empty + \strut\@tempskipa\z@ + \else\settoheight\@tempdima{{$#1$}}\vrule height\@tempdima depth\dp\strutbox width\z@ + \advance\@tempdima-\ht\strutbox + \ifdim\@tempdima>\lineskip\advance\@tempdima\lineskip\fi + \@tempskipa\@tempdima + \fi + \advance\@tempskipa\baselineskip +% \advance\@tempskipa-\@outerparskip + \par\nobreak\vskip-\parskip +% \advance\@tempskipa\lastskip + \nobreak\kern-\@tempskipa\@nobreaktrue} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabqedhere} +% Places the QED sign at the end of \env{tabenum} line inside the \env{proof} environment. +% \begin{macrocode} +\newcommand\tabqedhere{\cr + \noalign{\@par\@tempdima\prevdepth + \kern-\@tempdima\kern-\baselineskip\kern\lineskip + {\strut\popQED}\@par\kern\@tempdima}} +% \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 diff --git a/macros/latex/contrib/tablists/tablists.pdf b/macros/latex/contrib/tablists/tablists.pdf Binary files differnew file mode 100644 index 0000000000..e64f4b909a --- /dev/null +++ b/macros/latex/contrib/tablists/tablists.pdf |