blob: 986c93769078bcb1519cdec6145011baa06a7143 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
%%
%% This is file `tablists.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% tablists.dtx (with options: `package')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from tablists.sty.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file tablists.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{tablists}
[2009/08/04 v0.0e (beta) Tabulated list of short items]
\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}
\newcommand\tabenumsep{\hskip1em}
\newcommand\negtabenumsep{%
\settowidth\@tempdima{\tabenumsep}\hspace*{-\@tempdima}}
\newcommand\tabenumitem{\ifvoid\@labels\else\llap{\box\@labels\hspace{-\@totalleftmargin}}\fi
&\@ifnextchar[%
{\TeXr@@tabenumitem{&}}%
{\TeXr@tabenumitem{&}{\@enumctr}\setcounter{\@subenumctr}\z@}}
\newcommand\subtabenumitem{\ifnum\value{\@subenumctr}=\z@\negtabenumsep
\let\negtabenumsep\relax\fi&
\@ifnextchar[%]
{\TeXr@@tabenumitem{&}}%
{\TeXr@tabenumitem{&}{\@subenumctr}}}
\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}
\newcommand\notabenumitem{\@ifstar
{\TeXr@notabenumitem{\@enumctr}}%
{\tabenumsep\TeXr@notabenumitem{\@enumctr}}}
\newcommand\nosubtabenumitem{\@ifstar
{\TeXr@notabenumitem{\@subenumctr}}%
{\tabenumsep\TeXr@notabenumitem{\@subenumctr}}}
\newcommand\TeXr@notabenumitem[1]{\@ifnextchar[%]
{\TeXr@@tabenumitem{\hskip\labelsep}}%
{\TeXr@tabenumitem{\hskip\labelsep}{#1}}}
\newcommand\skipitem[1][1]{\count@=#1\multiply\count@2\advance\count@\@ne
\eline{\count@}}
\newcommand\subtabrow{\skipitem\negtabenumsep}
\newcommand\tabenumindent{}
\newenvironment{rtabenum}{\let\Alph\Asbuk\let\alph\asbuk
\tabenum}{\endtabenum}
\newcommand\tabenum{\@ifnextchar[{\TeXr@tabenum@}{\TeXr@tabenum@[]}}
\@ifdefinable\TeXr@tabenum@{}
\def\TeXr@tabenum@[#1]{\@ifnextchar[%]
{\TeXr@tabenum@@[#1]}{\TeXr@tabenum@@[#1][]}}
\@ifdefinable\TeXr@tabenum@@{}
\long\def\TeXr@tabenum@@[#1][#2]{\par
\addpenalty\@beginparpenalty
\@topsepadd\topsep\advance\@topsepadd\partopsep
\advance\@topsepadd-\jot
\ifdim\@topsepadd<\z@\@topsepadd=\z@\fi
\if@nobreak\vspace{-\jot}\else\addvspace\@topsepadd\fi
\openup\jot
\ifnum\@enumdepth>\thr@@
\@toodeep
\else
\advance\@enumdepth\@ne
\edef\@enumctr{enum\romannumeral\the\@enumdepth}%
\setcounter{\@enumctr}\z@
\let\item\tabenumitem\let\noitem\notabenumitem
\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
\def\tempa{#1}\ifx\tempa\empty\else
\TeXr@enumlabel@{#1}{\@enumctr}\fi
\def\tempa{#2}\ifx\tempa\empty\else
\TeXr@enumlabel@{#2}{\@subenumctr}\fi
\@TeXr@tabenum
}
\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%
}
\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}
\def\endtabenum{\crcr\egroup\endgroup\par
\addpenalty\@endparpenalty
\advance\@topsepadd\jot
\addvspace\@topsepadd}
\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{}}
\newenvironment{rsubtabenum}{\let\Alph\Asbuk\let\alph\asbuk%
\subtabenum}{\endsubtabenum}
\@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}
\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@}
\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
\par\nobreak\vskip-\parskip
\nobreak\kern-\@tempskipa\@nobreaktrue}
\newcommand\tabqedhere{\cr
\noalign{\@par\@tempdima\prevdepth
\kern-\@tempdima\kern-\baselineskip\kern\lineskip
{\strut\popQED}\@par\kern\@tempdima}}
\let\TeXr@orilistitem\item
\newcommand\restorelistitem{\let\item\TeXr@orilistitem}
\endinput
%%
%% End of file `tablists.sty'.
|