| 1 |
% \iffalse |
| 2 |
%% Style file `arydshln' |
| 3 |
%% Copyright (C) 1993,1998-2018 |
| 4 |
%% Hiroshi Nakashima <h.nakasima'AT'media'DOT'kyoto-u'DOT'ac'DOT'jp> |
| 5 |
%% (Kyoto Univ.) |
| 6 |
%% This program can be redistributed and/or modified under the terms |
| 7 |
%% of the LaTeX Project Public License Distributed from CTAN |
| 8 |
%% archives in directory macros/latex/base/lppl.txt; either |
| 9 |
%% version 1 of the License, or any later version. |
| 10 |
% \fi |
| 11 |
% |
| 12 |
%\CheckSum{3697} |
| 13 |
%% \CharacterTable |
| 14 |
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
| 15 |
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
| 16 |
%% Digits \0\1\2\3\4\5\6\7\8\9 |
| 17 |
%% Exclamation \! Double quote \" Hash (number) \# |
| 18 |
%% Dollar \$ Percent \% Ampersand \& |
| 19 |
%% Acute accent \' Left paren \( Right paren \) |
| 20 |
%% Asterisk \* Plus \+ Comma \, |
| 21 |
%% Minus \- Point \. Solidus \/ |
| 22 |
%% Colon \: Semicolon \; Less than \< |
| 23 |
%% Equals \= Greater than \> Question mark \? |
| 24 |
%% Commercial at \@ Left bracket \[ Backslash \\ |
| 25 |
%% Right bracket \] Circumflex \^ Underscore \_ |
| 26 |
%% Grave accent \` Left brace \{ Vertical bar \| |
| 27 |
%% Right brace \} Tilde \~} |
| 28 |
%% |
| 29 |
% \iffalse |
| 30 |
%% |
| 31 |
%<*dtx> |
| 32 |
\ProvidesFile{arydshln.dtx} |
| 33 |
%</dtx> |
| 34 |
%<package>\def\next{LaTeX2e} |
| 35 |
%<package>\ifx\fmtname\next\def\next{ |
| 36 |
%<package>\NeedsTeXFormat{LaTeX2e}[1994/12/01] |
| 37 |
%<package>\ProvidesPackage{arydshln}} |
| 38 |
%<package>\else\def\next[#1]{}\fi\next |
| 39 |
%<driver>\ProvidesFile{arydshln-man.tex} |
| 40 |
% \fi |
| 41 |
% \ProvidesFile{arydshln.dtx} |
| 42 |
[2019/02/21 v1.76 ] |
| 43 |
% |
| 44 |
% \iffalse |
| 45 |
%<*driver> |
| 46 |
\documentclass{ltxdoc} |
| 47 |
\usepackage{arydshln} |
| 48 |
\DisableCrossrefs |
| 49 |
\PageIndex |
| 50 |
\CodelineNumbered |
| 51 |
\RecordChanges |
| 52 |
%</driver> |
| 53 |
%<driver>\OnlyDescription |
| 54 |
%<driver>\def\ONLYDESCRIPTION{} |
| 55 |
%<*driver> |
| 56 |
\advance\textwidth4em |
| 57 |
\begin{document} |
| 58 |
\DocInput{arydshln.dtx} |
| 59 |
\end{document} |
| 60 |
%</driver> |
| 61 |
% \fi |
| 62 |
% \MakeShortVerb{\|} |
| 63 |
% \GetFileInfo{arydshln.dtx} |
| 64 |
% \IndexPrologue{\section*{Index}} |
| 65 |
% \setcounter{IndexColumns}{2} |
| 66 |
% \def\th{^{\it th}} |
| 67 |
% \def\LOR{{\ {\lor}\ }} |
| 68 |
% \def\LAND{{\ {\land}\ }} |
| 69 |
% \let\togets\leftrightarrow |
| 70 |
% \let\epsilon\varepsilon |
| 71 |
% \def\cs#1{\hbox{\tt\char\escapechar#1}} |
| 72 |
% |
| 73 |
% \makeatletter |
| 74 |
% \def\Meta#1{\penalty\@highpenalty \hbox{{\tt\char`\{}\meta{#1}{\tt\char`\}}}} |
| 75 |
% |
| 76 |
% \def\eqnarray{\stepcounter{equation}\let\@currentlabel=\theequation |
| 77 |
% \global\@eqnswtrue |
| 78 |
% \global\@eqcnt\z@\tabskip\@centering\let\\=\@eqncr |
| 79 |
% $$\halign to \displaywidth\bgroup\hskip\@centering |
| 80 |
% $\displaystyle\tabskip\z@{##}$\@eqnsel&\global\@eqcnt\@ne |
| 81 |
% \hfil$\;{##}\;$\hfil |
| 82 |
% &\global\@eqcnt\tw@ $\displaystyle\tabskip\z@{##}$\hfil |
| 83 |
% \tabskip\@centering&\llap{##}\tabskip\z@\cr} |
| 84 |
% |
| 85 |
% \let\latex@addmarginpar\@addmarginpar |
| 86 |
% \let\latex@latex@warning@no@line\@latex@warning@no@line |
| 87 |
% \def\@addmarginpar{\let\@latex@warning@no@line\@gobble |
| 88 |
% \latex@addmarginpar |
| 89 |
% \let\@latex@warning@no@line\latex@latex@warning@no@line} |
| 90 |
% \let\@font@warning\@gobble |
| 91 |
% |
| 92 |
% \long\def\m@cro@#1#2{\endgroup \topsep\MacroTopsep \trivlist |
| 93 |
% \edef\saved@macroname{\string#2} |
| 94 |
% \def\makelabel##1{\llap{##1\hskip\@totalleftmargin}} |
| 95 |
% \if@inlabel |
| 96 |
% \let\@tempa\@empty \count@\macro@cnt |
| 97 |
% \loop \ifnum\count@>\z@ |
| 98 |
% \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m@ne \repeat |
| 99 |
% \edef\makelabel##1{\llap{\vtop to\baselineskip |
| 100 |
% {\@tempa\hbox{##1}\vss} |
| 101 |
% \hskip\@totalleftmargin}} |
| 102 |
% \advance \macro@cnt \@ne |
| 103 |
% \else \macro@cnt\@ne \fi |
| 104 |
% \edef\@tempa{\noexpand\item[ |
| 105 |
% #1 |
| 106 |
% \noexpand\PrintMacroName |
| 107 |
% \else |
| 108 |
% \noexpand\PrintEnvName |
| 109 |
% \fi |
| 110 |
% {\string#2}]} |
| 111 |
% \@tempa |
| 112 |
% \global\advance\c@CodelineNo\@ne |
| 113 |
% #1 |
| 114 |
% \SpecialMainIndex{#2}\nobreak |
| 115 |
% \DoNotIndex{#2} |
| 116 |
% \else |
| 117 |
% \SpecialMainEnvIndex{#2}\nobreak |
| 118 |
% \fi |
| 119 |
% \global\advance\c@CodelineNo\m@ne |
| 120 |
% \ignorespaces} |
| 121 |
% |
| 122 |
% \def\DescribeOpt{\leavevmode\@bsphack\begingroup\MakePrivateLetters |
| 123 |
% \Describe@Opt} |
| 124 |
% \def\Describe@Opt#1{\endgroup \Describe@pt{#1}} |
| 125 |
% \def\Describe@pt#1#2{ |
| 126 |
% \marginpar{\raggedleft\PrintDescribeMacro{#1}} |
| 127 |
% \SpecialOptUsageIndex{#1}{#2}} |
| 128 |
% \def\SpecialOptUsageIndex#1#2{ |
| 129 |
% \index{#1\actualchar{\protect\ttfamily#1} (#2)\encapchar usage} |
| 130 |
% \index{#2s:\levelchar{\protect\ttfamily#1}\encapchar usage} |
| 131 |
% \@esphack\ignorespaces} |
| 132 |
% \def\SpecialOptMainIndex#1#2{ |
| 133 |
% \index{#1\actualchar{\protect\ttfamily#1} (#2)\encapchar main} |
| 134 |
% \index{#2s:\levelchar{\protect\ttfamily#1}\encapchar main} |
| 135 |
% \@esphack\ignorespaces} |
| 136 |
% \def\SpecialOptIndex#1#2{ |
| 137 |
% \index{#1\actualchar{\protect\ttfamily#1} (#2)} |
| 138 |
% \index{#2s:\levelchar{\protect\ttfamily#1}} |
| 139 |
% \@esphack\ignorespaces} |
| 140 |
% \def\SpecialOptIndexS#1#2{ |
| 141 |
% \index{#1\actualchar{\protect\ttfamily#1} (#2)} |
| 142 |
% \index{#2es:\levelchar{\protect\ttfamily#1}} |
| 143 |
% \@esphack\ignorespaces} |
| 144 |
% |
| 145 |
% \def\SpecialMainIndex#1{\@bsphack |
| 146 |
% \RemoveAtFromCS{#1} |
| 147 |
% \protected@edef\@tempa{\noexpand\special@index{\RAFCtempa |
| 148 |
% \actualchar \string\verb |
| 149 |
% \quotechar*\verbatimchar\string#1\verbatimchar |
| 150 |
% \encapchar main}}\@tempa |
| 151 |
% \@esphack} |
| 152 |
% |
| 153 |
% \def\SpecialIndex#1{\@bsphack |
| 154 |
% \RemoveAtFromCS{#1} |
| 155 |
% \protected@edef\@tempa{\noexpand\special@index{\RAFCtempa |
| 156 |
% \actualchar \string\verb |
| 157 |
% \quotechar*\verbatimchar\string#1\verbatimchar}}\@tempa |
| 158 |
% \@esphack} |
| 159 |
% |
| 160 |
% \def\Macro{\begingroup \@sanitize \iMacro} |
| 161 |
% \def\iMacro#1{\endgroup |
| 162 |
% \def\SpecialMainIndex##1{\SWiIndex{##1}{\encapchar main}} |
| 163 |
% \macro{#1}} |
| 164 |
% \let\endMacro\endmacro |
| 165 |
% |
| 166 |
% \def\SpecialWeirdIndex{\@bsphack \begingroup \@sanitize \SWIndex{}} |
| 167 |
% \def\SWIndex#1#2{\endgroup \SWiIndex{#2}{#1}} |
| 168 |
% \def\SWiIndex#1#2{% |
| 169 |
% \protected@edef\@tempa{\noexpand\special@index{ |
| 170 |
% #1\actualchar \string\verb |
| 171 |
% \quotechar*\verbatimchar#1\verbatimchar#2}}\@tempa |
| 172 |
% \@esphack} |
| 173 |
% |
| 174 |
% \let\RAFCempty\@empty |
| 175 |
% \let\RAFCgobble\@gobble |
| 176 |
% \makeatother |
| 177 |
% \def\RemoveAtFromCS#1{\edef\RAFCtempa{\expandafter\RAFCgobble\string#1} |
| 178 |
% \edef\RAFCtempa{\expandafter\string\csname\RAFCtempa\endcsname} |
| 179 |
% \expandafter\iRemoveAtFromCS\RAFCtempa@\NIL} |
| 180 |
% \def\iRemoveAtFromCS#1#2@#3\NIL{\def\RAFCtempb{#3} |
| 181 |
% \ifx\RAFCtempb\RAFCempty \def\RAFCtempa{#2}\let\next\relax |
| 182 |
% \else \def\RAFCtempa{#2@}\def\next{\iiRemoveAtFromCS#3\NIL} |
| 183 |
% \def\RAFCtempb{#2} |
| 184 |
% \ifx\RAFCtempb\RAFCempty |
| 185 |
% \else\ifx\RAFCtempb\CommonCSPrefix |
| 186 |
% \else\ifx\RAFCtempb\CommonIfPrefix |
| 187 |
% \else \def\RAFCtempa{}\def\next{\xRemoveAtFromCS#2@#3\NIL}\fi\fi\fi\fi |
| 188 |
% \next} |
| 189 |
% \def\iiRemoveAtFromCS#1{\ifx#1@\edef\RAFCtempa{\RAFCtempa@} |
| 190 |
% \let\next\iiRemoveAtFromCS |
| 191 |
% \else \def\next{\xRemoveAtFromCS#1}\fi |
| 192 |
% \next} |
| 193 |
% \def\xRemoveAtFromCS#1@\NIL{\edef\RAFCtempa{#1\RAFCtempa}} |
| 194 |
% \makeatletter |
| 195 |
% |
| 196 |
% \begingroup |
| 197 |
% \gdef\@sverbcat{\catcode`\@\active\catcode`\#\active} |
| 198 |
% \catcode`\@\active \gdef@{\char`\@\penalty\exhyphenpenalty} |
| 199 |
% \catcode`\#\active \gdef#{\penalty\exhyphenpenalty} |
| 200 |
% \endgroup |
| 201 |
% \let\latex@sverb\@sverb |
| 202 |
% \def\@sverb{\@sverbcat\latex@sverb} |
| 203 |
% |
| 204 |
% \newcount\ChangesCounter \ChangesCounter10000 |
| 205 |
% \def\changes@#1#2#3{\global\advance\ChangesCounter\@ne |
| 206 |
% \protected@edef\@tempa{\noexpand\glossary{#1\levelchar |
| 207 |
% x\number\ChangesCounter |
| 208 |
% \ifx\saved@macroname\@empty |
| 209 |
% \actualchar\generalname |
| 210 |
% \else |
| 211 |
% \expandafter\@gobble\saved@macroname |
| 212 |
% \actualchar \string\verb |
| 213 |
% \quotechar*\verbatimchar \saved@macroname |
| 214 |
% \verbatimchar |
| 215 |
% \fi |
| 216 |
% :\levelchar #3}}\@tempa\endgroup\@esphack} |
| 217 |
% \def\theglossary{\onecolumn \glossary@prologue |
| 218 |
% \GlossaryParms \let\item\@idxitem \ignorespaces} |
| 219 |
% \def\endtheglossary{\relax} |
| 220 |
% |
| 221 |
% \let\EQ\relax \let\GT\relax \let\BAR\relax \let\NEQ\relax |
| 222 |
% |
| 223 |
% \makeatother |
| 224 |
% \errorcontextlines1000 |
| 225 |
% |
| 226 |
% |
| 227 |
% |
| 228 |
% \changes{v1.0}{1993/04/01} |
| 229 |
% {The style was born on a good day \ldots\ (1993/04/01)} |
| 230 |
% \changes{v1.05}{1993/06/18} |
| 231 |
% {Cope with \texttt{\char`\\\char`\\} with negative optional |
| 232 |
% vertical space. (1993/06/18)} |
| 233 |
% \changes{v1.1}{1993/06/24} |
| 234 |
% {Save and restore the \texttt{\char`\\catcode} for |
| 235 |
% `\texttt{@}'. (1993/06/24)} |
| 236 |
% |
| 237 |
% \changes{v1.2}{1998/07/16} |
| 238 |
% {Various changes shown below. (1998/07/16)} |
| 239 |
% \changes{v1.2-1}{1998/07/16} |
| 240 |
% {Add this document.} |
| 241 |
% \changes{v1.2-2}{1998/07/16} |
| 242 |
% {Cope with \protect\LaTeXe.} |
| 243 |
% \changes{v1.2-3}{1998/07/16} |
| 244 |
% {Allow mixture of vertical solid- and dash-lines.} |
| 245 |
% \changes{v1.2-4}{1998/07/16} |
| 246 |
% {Add the feature of explicit dash/gap specification.} |
| 247 |
% \changes{v1.2-5}{1998/07/16} |
| 248 |
% {Fix some bugs and change codes.} |
| 249 |
% |
| 250 |
% \changes{v1.3}{1998/10/08} |
| 251 |
% {Fix one bug shown below. (1998/10/08)} |
| 252 |
% |
| 253 |
% \changes{v1.4}{1999/06/25} |
| 254 |
% {Make compatible with array package and add new features. (1999/06/25)} |
| 255 |
% |
| 256 |
% \changes{v1.4-1}{1999/06/25} |
| 257 |
% {The following are changes of this document.} |
| 258 |
% |
| 259 |
% \changes{v1.4-2-1}{1999/06/25} |
| 260 |
% {The following are for the general compatibility with \textsf{array}.} |
| 261 |
% \changes{v1.4-2-2}{1999/06/25} |
| 262 |
% {The following are to control the effective width of vertical lines.} |
| 263 |
% \changes{v1.4-2-3}{1999/06/25} |
| 264 |
% {The following are for inactivation of dash-line functions.} |
| 265 |
% \changes{v1.4-2-4}{1999/06/25} |
| 266 |
% {The following are for drawing mode to cope with the bug of |
| 267 |
% \cs{xlearders}.} |
| 268 |
% \changes{v1.4-2-5}{1999/06/25} |
| 269 |
% {The following are to implement dashed version of \cs{firsthline} |
| 270 |
% and \cs{lasthline} of \textsf{array}.} |
| 271 |
% \changes{v1.4-2-6}{1999/06/25} |
| 272 |
% {The following are to fix the bug by which the depth of |
| 273 |
% \texttt{array}\slash\texttt{tabular} was always zero.} |
| 274 |
% \changes{v1.4-2-7}{1999/06/25} |
| 275 |
% {The following are to rename macros for \cs{cdashline}.} |
| 276 |
% \changes{v1.4-2-8}{1999/06/25} |
| 277 |
% {The following are to cope with very narrow or negative wide columns.} |
| 278 |
% \changes{v1.4-3}{2000/07/04} |
| 279 |
% {Released to CTAN on 2000/07/04.} |
| 280 |
% |
| 281 |
% \changes{v1.5}{2000/07/12} |
| 282 |
% {Make compatible with \textsf{colortab}, and fix bugs. (2000/07/12)} |
| 283 |
% \changes{v1.5-1}{2000/07/12} |
| 284 |
% {The following are for the compatibility with \textsf{colortab}.} |
| 285 |
% \changes{v1.5-2}{2002/06/26} |
| 286 |
% {The following are for bug fix of \cs{adl@putlrc}.} |
| 287 |
% \changes{v1.5-3}{2003/07/11} |
| 288 |
% {The following are for bug fix of \cs{adl@inactivate}.} |
| 289 |
% |
| 290 |
% \changes{v1.54}{2003/08/25} |
| 291 |
% {Bug fixes. (2003/08/25)} |
| 292 |
% \changes{v1.54-1}{2003/08/25} |
| 293 |
% {The following are for bug fix of \cs{adl@@vl}.} |
| 294 |
% \changes{v1.54-2}{2003/08/25} |
| 295 |
% {The following are for bug fix of activation.} |
| 296 |
% \changes{v1.54-3}{2003/08/25} |
| 297 |
% {The following are miscellaneous modifications.} |
| 298 |
% |
| 299 |
% \changes{v1.6}{2003/08/25} |
| 300 |
% {The following are for the compatibility with |
| 301 |
% \textsf{longtable}. (2003/08/25)} |
| 302 |
% |
| 303 |
% \changes{v1.7}{2004/05/21} |
| 304 |
% {The following are for the compatibility with |
| 305 |
% \textsf{colortbl}. (2004/05/21)} |
| 306 |
% \changes{v1.7-1}{2004/5/21} |
| 307 |
% {The following are for null-wide horizontal lines.} |
| 308 |
% \changes{v1.7-2}{2004/5/21} |
| 309 |
% {The following are to fix the bug of \cs{arrayrulecolor} etc. in |
| 310 |
% \textsf{colortbl}.} |
| 311 |
% \changes{v1.7-3}{2004/5/21} |
| 312 |
% {The following are for vertical line coloring.} |
| 313 |
% |
| 314 |
% \changes{v1.71}{2004/7/31} |
| 315 |
% {The following are for bug fix for \textsf{array}'s |
| 316 |
% \texttt{m}-columns. (2004/7/31)} |
| 317 |
% |
| 318 |
% \changes{v1.72}{2016/03/19} |
| 319 |
% {Bug fix and revision of \S2.4. (2016/03/19)} |
| 320 |
% \changes{v1.72-1}{2016/03/19} |
| 321 |
% {The following are for bug fix for footnotes in \textsf{longtable}'s |
| 322 |
% \texttt{m}-columns.} |
| 323 |
% |
| 324 |
% \changes{v1.73}{2016/04/28} |
| 325 |
% {Bug fix. (2016/04/28)} |
| 326 |
% \changes{v1.73-1}{2016/04/28} |
| 327 |
% {The following are to fix the problem that the top edge a vertical |
| 328 |
% (dash-)line is at the bottom of a horizontal line rather than it |
| 329 |
% top.} |
| 330 |
% \changes{v1.73-2}{2016/04/28} |
| 331 |
% {The following are to fix the bug that \cs{hdashline} |
| 332 |
% is not properly processed in a \texttt{array}\slash |
| 333 |
% \texttt{tabular} environment if \textsf{longtable} is loaded.} |
| 334 |
% \changes{v1.74}{2018/09/26} |
| 335 |
% {The following are to fix the bug in the \textsf{array}-compatible |
| 336 |
% mechanism by which \textsf{delarray} did not work well.} |
| 337 |
% \changes{v1.75}{2018/12/26} |
| 338 |
% {The following are to cope with the change in \textsf{array} v2.4i |
| 339 |
% or later in which \cs{@startpbox} and \cs{@endpbox} have |
| 340 |
% \cs{color@begingroup} and \cs{color@endgroup}, respectively.} |
| 341 |
% \changes{v1.76}{2019/02/21} |
| 342 |
% {The following are to cope with the change in \textsf{longtable} |
| 343 |
% bundled in \textsf{latex-tools} 2019-01-05 or later in which |
| 344 |
% \cs{LT@startpbox} and \cs{LT@endpbox} have |
| 345 |
% \cs{color@begingroup} and \cs{color@endgroup}, respectively.} |
| 346 |
% |
| 347 |
% |
| 348 |
% |
| 349 |
% \def\EXCLAMATION{\texttt{!}} |
| 350 |
% \def\VERTBAR{\texttt{\char`\|}} |
| 351 |
% \edef\CommonCSPrefix{\expandafter\RAFCgobble\string\adl} |
| 352 |
% \edef\CommonIfPrefix{\expandafter\RAFCgobble\string\ifadl} |
| 353 |
% |
| 354 |
% \title{The \textsf{arydshln} package\thanks{ |
| 355 |
% This file has version number \fileversion, last revised \filedate.}} |
| 356 |
% \author{Hiroshi Nakashima\\(Kyoto University)} |
| 357 |
% \date{\filedate} |
| 358 |
% \maketitle |
| 359 |
% |
| 360 |
% \begin{abstract} |
| 361 |
% This file gives \LaTeX's |array| and |tabular| environments the capability |
| 362 |
% to draw horizontal\slash vertical dash-lines. |
| 363 |
% \end{abstract} |
| 364 |
% |
| 365 |
% \tableofcontents |
| 366 |
% \newpage |
| 367 |
% |
| 368 |
% |
| 369 |
% |
| 370 |
% \section{Introduction} |
| 371 |
% \label{sec:intro} |
| 372 |
% |
| 373 |
% In January 1993, Weimin Zhang kindly posted a style \textsf{hvdashln} |
| 374 |
% written by the author, which draws horizontal\slash vertical dash-lines in |
| 375 |
% \LaTeX's |array| and |tabular| environments, to the news group |
| 376 |
% \textsf{comp.text.tex}. The style, unfortunately, has a known problem |
| 377 |
% that vertical lines are broken when an array contains tall rows. |
| 378 |
% |
| 379 |
% In March of the year, Monty Hayes complained of this problem encouraging |
| 380 |
% the author to make a new version \textsf{arydshln} to solve the problem. |
| 381 |
% The new style also has new features, such as allowing `|:|' to specify a |
| 382 |
% vertical dash-line in preamble, and |\cdashline| being a counterpart of |
| 383 |
% |\cline|. |
| 384 |
% |
| 385 |
% \changes{v1.4-1}{1999/06/25} |
| 386 |
% {The history on the compatibility with \textsf{array} package.} |
| 387 |
% In March 1999, Sebastian Rahtz kindly invited the style, which had been |
| 388 |
% improved following the bug report from Takahiro Kubota, to be included in |
| 389 |
% \TeX{} CTAN and also in the online catalogue compiled by Graham Williams. |
| 390 |
% This invitation gave the style new users including Peter Ehrbar who wished |
| 391 |
% to use it with \textsf{array} style in Standard \LaTeX{} Tools Bundle and |
| 392 |
% had trouble because these styles were incompatible with each other. |
| 393 |
% Therefore, the style became compatible with \textsf{array} and got |
| 394 |
% additional new features. |
| 395 |
% |
| 396 |
% \changes{v1.5-1}{2000/7/12} |
| 397 |
% {The history on the compatibility with \textsf{colortab} package.} |
| 398 |
% In February 2000, Zsuzsanna Nagy reported that \textsf{arydshln} is not |
| 399 |
% compatible with \textsf{colortab} style to let the author work on the |
| 400 |
% compatibility issue again. |
| 401 |
% |
| 402 |
% \changes{v1.6}{2003/8/25} |
| 403 |
% {The history on the compatibility with \textsf{longtable} package.} |
| 404 |
% In Feburary 2001, Craig Leech reported another compatibility problem with |
| 405 |
% \textsf{longtable}. Although the author promised that the problem would |
| 406 |
% be attacked some day, the issue had left long time\footnote{ |
| 407 |
% |
| 408 |
% Two years and a half! Sorry Craig.} |
| 409 |
% |
| 410 |
% until three other complaints were made. Then the author attacked the |
| 411 |
% problem hoping it is the last compatibility issue\footnote{ |
| 412 |
% |
| 413 |
% But his hope was dashed as described below.}. |
| 414 |
% |
| 415 |
% \changes{v1.7}{2004/5/21} |
| 416 |
% {The history on the compatibility with \textsf{colortbl} package.} |
| 417 |
% In May 2004, Klaus Dalinghaus found another incompatibility with |
| 418 |
% \textsf{colortbl}. Although he was satisfied by a quick hack for cell |
| 419 |
% painting, the author attacked a harder problem for line |
| 420 |
% coloring to solve the problem\footnote{ |
| 421 |
% |
| 422 |
% Without dreaming it is the last compatibility issue.}. |
| 423 |
% |
| 424 |
% |
| 425 |
% |
| 426 |
% \section{Usage} |
| 427 |
% \label{sec:usage} |
| 428 |
% \subsection{Loading Package} |
| 429 |
% \label{sec:usage-load} |
| 430 |
% |
| 431 |
% \changes{v1.4-1}{1999/06/25} |
| 432 |
% {Explanation of package loading is added.} |
| 433 |
% |
| 434 |
% The package is usable to both \LaTeXe{} and \LaTeX-2.09 users with their |
| 435 |
% standard package loading declaration. If you use \LaTeXe, simply do the |
| 436 |
% following. |
| 437 |
% \begin{quote} |
| 438 |
% \SpecialUsageIndex{\usepackage} |
| 439 |
% |\usepackage{arydshln}| |
| 440 |
% \end{quote} |
| 441 |
% If you still love \LaTeX-2.09, the following is what you have to do. |
| 442 |
% \begin{quote} |
| 443 |
% \SpecialUsageIndex{\documentstyle} |
| 444 |
% |\documentstyle[..,arydshln,...]|\Meta{style} |
| 445 |
% \end{quote} |
| 446 |
% |
| 447 |
% \changes{v1.5-1}{2000/7/12} |
| 448 |
% {Caution about loading order of \textsf{colortab} is added.} |
| 449 |
% \changes{v1.6}{2003/8/25} |
| 450 |
% {Caution about loading order of \textsf{longtable} is added.} |
| 451 |
% \changes{v1.7}{2004/5/21} |
| 452 |
% {Caution about loading order of \textsf{colortbl} is added.} |
| 453 |
% \SpecialOptIndex{array}{package} |
| 454 |
% \SpecialOptIndex{colortab}{package} |
| 455 |
% \SpecialOptIndex{longtable}{package} |
| 456 |
% \SpecialOptIndex{colortbl}{package} |
| 457 |
% |
| 458 |
% Only one caution given to users of \textsf{array} (v2.3m or later) and |
| 459 |
% \textsf{longtable} (v4.10 or later) packages, included in Standard \LaTeX{} |
| 460 |
% Tools Bundle, and \textsf{colortab} and \textsf{colortbl} package is that |
| 461 |
% \textsf{arydshln} has to be loaded {\em after} \textsf{array}, |
| 462 |
% \textsf{longtable}, \textsf{colortab} and/or \textsf{colortbl} done. That |
| 463 |
% is, the following is correct but reversing the order of |\usepackage| will |
| 464 |
% cause some mysterious error. |
| 465 |
% |
| 466 |
% \begin{quote} |
| 467 |
% |\usepackage{array} % and/or|\\ |
| 468 |
% |\usepackage{longtable} % and/or|\\ |
| 469 |
% |\usepackage{colortab} % or|\\ |
| 470 |
% |\usepackage{colortbl}|\\ |
| 471 |
% |\usepackage{arydshln}| |
| 472 |
% \end{quote} |
| 473 |
% |
| 474 |
% |
| 475 |
% |
| 476 |
% \subsection{Basic Usage} |
| 477 |
% \label{sec:usage-basic} |
| 478 |
% |
| 479 |
% \DescribeEnv{array}\DescribeEnv{tabular} |
| 480 |
% \SpecialIndex{\hline} |
| 481 |
% \SpecialIndex{\cline} |
| 482 |
% \SpecialIndex{\multicolumn} |
| 483 |
% You can simply use |array| or |tabular(*)| environments with standard |
| 484 |
% preamble, such as \verb!{r|c|ll}!, and standard commands |\\|, |\hline|, |
| 485 |
% |\cline| and |\multicolumn|. |
| 486 |
% |
| 487 |
% \leavevmode\marginpar{\raggedleft\PrintDescribeMacro{:}} |
| 488 |
% \index{:={\protect\ttfamily:}|usage} |
| 489 |
% Drawing a vertical dash-line is quite simple. Use `|:|' in the preamble |
| 490 |
% as the separator of columns separated by the dash-line, just like using |
| 491 |
% `\verb!|!' to draw a vertical solid-line. The {\em preamble} means not |
| 492 |
% only that of the environment, but also the first argument of |
| 493 |
% |\multicolumn|. |
| 494 |
% |
| 495 |
% \DescribeMacro{\hdashline}\DescribeMacro{\cdashline} |
| 496 |
% \changes{v1.4-1}{1999/06/25} |
| 497 |
% {Description of \cs{first}\slash\texttt{lasthdashline} is added.} |
| 498 |
% It is also simple to draw a horizontal dash-line. Use |\hdashline| and |
| 499 |
% |\cdashline| as the counterparts of |\hline| and |\cline|. |
| 500 |
% |
| 501 |
% For example; |
| 502 |
% |
| 503 |
%\begin{quote} |
| 504 |
%\begin{verbatim} |
| 505 |
%\begin{tabular}{|l::c:r|}\hline |
| 506 |
%A&B&C\\\hdashline |
| 507 |
%AAA&BBB&CCC\\\cdashline{1-2} |
| 508 |
%\multicolumn{2}{|l:}{AB}&C\\\hdashline\hdashline |
| 509 |
%\end{tabular} |
| 510 |
%\end{verbatim} |
| 511 |
%\end{quote} |
| 512 |
% |
| 513 |
% will produce the following result. |
| 514 |
% |
| 515 |
%\begin{quote} |
| 516 |
%\catcode`\|12 |
| 517 |
%\begin{tabular}{|l::c:r|}\hline |
| 518 |
%A&B&C\\\hdashline |
| 519 |
%AAA&BBB&CCC\\\cdashline{1-2} |
| 520 |
%\multicolumn{2}{|l:}{AB}&C\\\hdashline\hdashline |
| 521 |
%\end{tabular} |
| 522 |
%\end{quote} |
| 523 |
% |
| 524 |
% \changes{v1.73-1}{2016/04/28} |
| 525 |
% {Add a paragraph describing the perfect contacts of vertical and |
| 526 |
% horizontal lines.} |
| 527 |
% |
| 528 |
% Note that the intersections of leftmost/rightmost vertical lines and |
| 529 |
% horizontal dash-lines are little bit different from those produced by |
| 530 |
% ordinary |array|\slash|tabular|. That is, with very careful examination |
| 531 |
% you will find that vertical lines of ordinary ones are {\em broken\/} with |
| 532 |
% small white specks at intersections, while in the example above they have |
| 533 |
% no specks. In addition, the four corners of outermost rectangular also |
| 534 |
% have specks in ordinary ones, while those in the example above have |
| 535 |
% perfect contacts of L-shape\footnote{ |
| 536 |
% |
| 537 |
% The top-left/right corners had specks before v1.73, the fix in which made |
| 538 |
% the topmost dash segment of a vertical dash-line a little bit shorter.}. |
| 539 |
% |
| 540 |
% \DescribeMacro{\firsthdashline}\DescribeMacro{\lasthdashline} |
| 541 |
% If you use \textsf{array}, the dashed version of |\firsthline| and |
| 542 |
% |\lasthline| named |\first#hdash#line| and |\lasthdashline| are available. |
| 543 |
% |
| 544 |
% |
| 545 |
% |
| 546 |
% \subsection{Style Parameters} |
| 547 |
% \label{sec:usage-par} |
| 548 |
% |
| 549 |
% \DescribeMacro{\dashlinedash}\DescribeMacro{\dashlinegap} |
| 550 |
% You have two style parameters to control the shape of dash-lines: |
| 551 |
% |\dashlinedash| is for the length of each dash segment in a dash line; |
| 552 |
% |\dashlinegap| controls the amount of each gap between dash segments. |
| 553 |
% Both parameters have a common default value, 4\,pt. |
| 554 |
% |
| 555 |
% |
| 556 |
% |
| 557 |
% \subsection{Fine Tuning} |
| 558 |
% \label{sec:usage-fine} |
| 559 |
% |
| 560 |
% \leavevmode\marginpar{\raggedleft\PrintDescribeMacro{;}} |
| 561 |
% \index{;={\protect\ttfamily;}|usage} |
| 562 |
% Although you can control the shape of dash-lines in an |
| 563 |
% |array|\slash|tabular| environment as described in \S\ref{sec:usage-par}, |
| 564 |
% you might want to draw a dash-line of a shape different from others. To |
| 565 |
% specify the shape of a vertical dash-line explicitly, you may use; |
| 566 |
% |
| 567 |
% \begin{quote} |
| 568 |
% |;{|\meta{dash}|/|\meta{gap}|}| |
| 569 |
% \end{quote} |
| 570 |
% |
| 571 |
% instead of ordinary `|:|' and will have a dash-line with dash segments of |
| 572 |
% \meta{dash} long separated by spaces of \meta{gap}. |
| 573 |
% |
| 574 |
% \DescribeMacro{\hdashline}\DescribeMacro{\cdashline} |
| 575 |
% As for horizontal dash-lines, explicit shape specifications may be given |
| 576 |
% through optional arguments of |\hdashline| and |\cdashline| as follows. |
| 577 |
% |
| 578 |
% \begin{quote} |
| 579 |
% |\hdashline[|\meta{dash}|/|\meta{gap}|]|\\ |
| 580 |
% |\cdashline{|\meta{col1}|-|\meta{col2}|}[|\meta{dash}|/|\meta{gap}|]| |
| 581 |
% \end{quote} |
| 582 |
% |
| 583 |
% |
| 584 |
% For example; |
| 585 |
% |
| 586 |
%\begin{quote} |
| 587 |
%\begin{verbatim} |
| 588 |
%\begin{tabular}{|l::c;{2pt/2pt}r|}\hline |
| 589 |
%A&B&C\\\hdashline[1pt/1pt] |
| 590 |
%AAA&BBB&CCC\\\cdashline{1-2}[.4pt/1pt] |
| 591 |
%\multicolumn{2}{|l;{2pt/2pt}}{AB}&C\\\hdashline\hdashline |
| 592 |
%\end{tabular} |
| 593 |
%\end{verbatim} |
| 594 |
%\end{quote} |
| 595 |
% |
| 596 |
% will produce the following result. |
| 597 |
% |
| 598 |
%\begin{quote} |
| 599 |
%\catcode`\|12 |
| 600 |
%\begin{tabular}{|l::c;{2pt/2pt}r|}\hline |
| 601 |
%A&B&C\\\hdashline[1pt/1pt] |
| 602 |
%AAA&BBB&CCC\\\cdashline{1-2}[.4pt/1pt] |
| 603 |
%\multicolumn{2}{|l;{2pt/2pt}}{AB}&C\\\hdashline\hdashline |
| 604 |
%\end{tabular} |
| 605 |
%\end{quote} |
| 606 |
% |
| 607 |
% \changes{v1.4-1}{1999/06/25} |
| 608 |
% {Description of the real width of vertical lines is added.} |
| 609 |
% |
| 610 |
% \DescribeMacro{\ADLnullwide} |
| 611 |
% \DescribeMacro{\ADLsomewide} |
| 612 |
% \SpecialIndex{\arrayrulewidth} |
| 613 |
% |
| 614 |
% The vertical solid and dashed lines are drawn as if their width is zero, as |
| 615 |
% standard \LaTeX's |array| and |tabular| do, if you don't use |
| 616 |
% \textsf{array} package. Otherwise, they have {\em real} width of |
| 617 |
% |\arrayrulewidth| as the authors of \textsf{array} prefers. However, you |
| 618 |
% may explicitly tell \textsf{arydshln} to follow your own preference by |
| 619 |
% |\ADLnullwide| if you love \LaTeX{} standard, or |\ADLsomewide| if |
| 620 |
% you second the preference of \textsf{array} authors. |
| 621 |
% |
| 622 |
% |
| 623 |
% |
| 624 |
% \subsection{Finer Tuning} |
| 625 |
% \label{sec:usage-finer} |
| 626 |
% |
| 627 |
% \changes{v1.4-1}{1999/06/25} |
| 628 |
% {Description of drawing mode is added.} |
| 629 |
% \changes{v1.72-2}{1999/06/25} |
| 630 |
% {Revise \S2.4 reflecting the fix of \cs{xleaders}.} |
| 631 |
% |
| 632 |
% To draw dash-lines, we use a powerful primitive of \TeX{} called |\xleaders|. |
| 633 |
% It replicates a segment that consist of a dash and gap so that a dash-line |
| 634 |
% has as many segments as possible and distributes {\it remainder} space to |
| 635 |
% make the spaces between adjacent dash segments (almost) equal to each |
| 636 |
% other. Therefore, you will have dash-lines with consistent steps of gaps |
| 637 |
% and spaces the lines in Figure~\ref{fig:mode}(1) are. |
| 638 |
% |
| 639 |
% \begin{figure} |
| 640 |
% \catcode`\|12 |
| 641 |
% \tabcolsep0pt \setbox\strutbox\hbox{\vrule height14pt depth6pt width0pt} |
| 642 |
% \def\mb{\makebox[20pt]} |
| 643 |
% \dashlinedash3.01pt \dashlinegap3.01pt |
| 644 |
% \def\example#1{\begin{tabular}[b]{|c:c;{2pt/2pt}c|} |
| 645 |
% \hline |
| 646 |
% \mb{A}&\mb{A}&\mb{A}\\[-\arrayrulewidth]\hdashline |
| 647 |
% \mb{B}&\mb{B}&\mb{B}\\[-\arrayrulewidth]\hdashline[2pt/2pt] |
| 648 |
% \mb{C}&\mb{C}&\mb{C}\\[-\arrayrulewidth]\hline |
| 649 |
% \multicolumn3c{(#1)} |
| 650 |
% \end{tabular}} |
| 651 |
% |
| 652 |
% \centerline{\example1\qquad |
| 653 |
% \ADLdrawingmode{2}\example2\qquad |
| 654 |
% \ADLdrawingmode{3}\example3} |
| 655 |
% \caption{Drawing mode controlled by \cs{ADLdrawingmode}} |
| 656 |
% \label{fig:mode} |
| 657 |
% \end{figure} |
| 658 |
% |
| 659 |
% However, because of a bug (or buggy feature) of |\xleaders|, there {\em |
| 660 |
% had been} a small possibility that a dash segment near the right\slash |
| 661 |
% bottom end drops, until it was fixed in the version of 3.141592\footnote{ |
| 662 |
% |
| 663 |
% By pointing out this problem, the author got a check of \$327.68 plus a |
| 664 |
% significantly large amount of interest from DEK\@. Wow!!}. |
| 665 |
% |
| 666 |
% Though the fix ultimately made any effort to cope with the problem |
| 667 |
% unnecessary, the pacakge still gives you alternative {\em drawing modes} |
| 668 |
% which you may specify by |\ADLdrawingmode|\Meta{$m$} as follows. |
| 669 |
% |
| 670 |
% \begin{itemize} |
| 671 |
% \item $m=1$ |
| 672 |
% \DescribeMacro{\ADLdrawingmode}\\ |
| 673 |
% As shown in Figure~\ref{fig:mode}(1), it gives most beautiful result by |
| 674 |
% |\xleaders|\footnote{ |
| 675 |
% |
| 676 |
% Until the fix of \cs{xleaders}, the second bottom\slash rightmost segments |
| 677 |
% of right\slash lower lines were dropped.}. |
| 678 |
% |
| 679 |
% This is default. |
| 680 |
% |
| 681 |
% \item $m=2$\\ |
| 682 |
% As shown in (2) of the figure, beautiful if dash-lines are not so sparse |
| 683 |
% as right/lower lines, but dash segments near the both ends may be a little |
| 684 |
% bit too long as left/upper lines, because in this mode the second |
| 685 |
% first\slash last segments are drawn by a special mechanism. |
| 686 |
% |
| 687 |
% \item $m=3$\\ |
| 688 |
% As shown in (3) of the figure, beautiful if dash-lines are not so sparse |
| 689 |
% as right/lower lines, but gaps near the both ends may be considerably too |
| 690 |
% large as left/upper lines, because in this mode the lines are drawn by |
| 691 |
% |\cleaders|. |
| 692 |
% \end{itemize} |
| 693 |
% |
| 694 |
% It is strongly recommended to use default mode 1 unless you want to have |
| 695 |
% some special effect. |
| 696 |
% |
| 697 |
% |
| 698 |
% |
| 699 |
% \subsection{Performance Tuning} |
| 700 |
% \label{sec:usage-performance} |
| 701 |
% |
| 702 |
% \changes{v1.4-1}{1999/06/25} |
| 703 |
% {Description of (in)activation is added.} |
| 704 |
% |
| 705 |
% Since drawing dash-lines is a hard job, you have to be patient with the |
| 706 |
% fact that the performance of typesetting |array|\slash|tabular| with |
| 707 |
% dash-lines is poorer than that of ordinary ones. In fact, according to |
| 708 |
% author's small performance evaluation with a |tabular| having nine |
| 709 |
% vertical and ten horizontal dash-lines, typesetting the |tabular| is |
| 710 |
% approximately ten times as slow as its ordinary counterpart with solid |
| 711 |
% lines. |
| 712 |
% |
| 713 |
% However, this is not a really bad news, unfortunately. The real one is |
| 714 |
% that loading \textsf{arydshln} makes typesetting |array|\slash|tabular| |
| 715 |
% slower even if they only have solid lines which the package treats as |
| 716 |
% special ones of dash-lines. The evaluation result shows the degradation |
| 717 |
% factor is about nine. Therefore, if your document has many |
| 718 |
% |array|\slash|tabular| with solid lines, \LaTeX{} will run slowly even |
| 719 |
% with quite few (or no) |array|\slash|tabular| with dash-lines, |
| 720 |
% |
| 721 |
% \DescribeMacro{\ADLinactivate} |
| 722 |
% To cope with this problem, you may inactivate dash-line functions by the |
| 723 |
% command |\ADLinactivate| that replaces dash-lines with solid |
| 724 |
% lines drawn by a faster (i.e. ordinary) mechanism. Although the |
| 725 |
% inactivation does not completely solve the performance problem, the |
| 726 |
% degradation factor will become much smaller and acceptable, approximately |
| 727 |
% 1.5 in the author's evaluation. For example, the draft version of your |
| 728 |
% document will have the command in its preamble, which you will remove from |
| 729 |
% your final version. |
| 730 |
% |
| 731 |
% \DescribeMacro{\ADLactivate} |
| 732 |
% Alternatively, you may do |\ADLinactivate| in the preamble, switch on by |
| 733 |
% |\ADLactivate| before you really need dash-lines, and switch off again |
| 734 |
% afterword. A wiser way could be surrounding |array|\slash|tabular| by |
| 735 |
% |\begin{ADLactivate}| and |\end{ADLactivate}|. |
| 736 |
% |
| 737 |
% \DescribeEnv{Array} |
| 738 |
% \DescribeEnv{Tabular} |
| 739 |
% If you feel it tiresome to type the long command\slash environment name for |
| 740 |
% the activation, you may use |Array| and |Tabular(*)| environment in which |
| 741 |
% dash-line functions are always active. Note that, however, since these |
| 742 |
% environment names are too natural to keep them from being used by authors |
| 743 |
% of other packages or yourself, name conflict could occur. If |Array| |
| 744 |
% and/or |Tabular| have already been defined when \textsf{arydshln} is |
| 745 |
% loaded, you will get a warning to show you have to define new |
| 746 |
% environments, say |dlarray| and |dltabular|, as follows. |
| 747 |
% |
| 748 |
% \begin{itemize}\item[] |
| 749 |
% |\newenvironment{dlarray}{\ADLactivate\begin{array}}%|\\ |
| 750 |
% | {\end{array}}|\\ |
| 751 |
% |\newenvironment{dltabular}{\ADLactivate\begin{tabular}}%|\\ |
| 752 |
% | {\end{tabular}}|\\ |
| 753 |
% |\newenvironment{dltabular*}{\ADLactivate\begin{tabular*}}%|\\ |
| 754 |
% | {\end{tabular*}}| |
| 755 |
% \end{itemize} |
| 756 |
% |
| 757 |
% \begingroup |
| 758 |
% \let\PDM\PrintDescribeMacro |
| 759 |
% \def\PrintDescribeMacro#1{\leavevmode\llap{\PDM{#1}}} |
| 760 |
% \DescribeMacro{\ADLnoshorthanded} |
| 761 |
% On the other hand, if they are defined after \textsf{arydshln} is loaded, |
| 762 |
% their definitions are silently replaced or \LaTeX{} complains of multiple |
| 763 |
% definitions. The error in the latter case will be avoided by putting |
| 764 |
% |\ADLnoshorthanded| just after |\usepackage{arydshln}|. |
| 765 |
% \par |
| 766 |
% \endgroup |
| 767 |
% |
| 768 |
% |
| 769 |
% |
| 770 |
% \subsection{Compatibility with Other Packages} |
| 771 |
% \label{sec:usage-compat} |
| 772 |
% |
| 773 |
% \changes{v1.5-1}{2000/07/12} |
| 774 |
% {Section 2.7 is added.} |
| 775 |
% \changes{v1.4-1}{1999/06/25} |
| 776 |
% {Description of characters and commands of \textsf{array} package is |
| 777 |
% added.} |
| 778 |
% \SpecialOptIndex{array}{package} |
| 779 |
% \SpecialIndex{\extrarowheight} |
| 780 |
% \SpecialIndex{\firsthline} |
| 781 |
% \SpecialIndex{\lasthline} |
| 782 |
% \SpecialIndex{\newcolumntype} |
| 783 |
% |
| 784 |
% Users of \textsf{array} package may use all of newly introduced |
| 785 |
% preamble characters, such as `|>|', `|<|', `|m|', `|b|', and all the |
| 786 |
% commands such as |\extrarowheight|, |\firsthilne| and |\lasthline|. The |
| 787 |
% preamble characters given by \textsf{arydshln} may be included in the |
| 788 |
% second argument of |\newcolumntype|. |
| 789 |
% |
| 790 |
% \changes{v1.5-1}{2000/07/12} |
| 791 |
% {Description of \textsf{colortab} commands is added.} |
| 792 |
% \SpecialOptIndex{colortab}{package} |
| 793 |
% \SpecialIndex{\LCC} |
| 794 |
% \SpecialIndex{\NAC} |
| 795 |
% \SpecialIndex{\ENAC} |
| 796 |
% \SpecialIndex{\AC} |
| 797 |
% \SpecialIndex{\EAC} |
| 798 |
% |
| 799 |
% Also users of \textsf{colortab} package may use |\LCC|\slash |\ECC| |
| 800 |
% construct to color columns. A horizontal solid\slash dash line may be |
| 801 |
% colored by, e.g.\ |\NAC\hdashline\ENAC|\@. The pair of |\AC| and |\EAC| may |
| 802 |
% be used to color everything between them {\em but}, unfortunately, |
| 803 |
% vertical lines are not. There are no ways to color vertical lines in a |
| 804 |
% table having dash lines. You may color vertical lines of a ordinary table |
| 805 |
% inactivating dash line functions by |\ADLinactivate|. |
| 806 |
% |
| 807 |
% \changes{v1.7}{2004/5/21} |
| 808 |
% {Description of \textsf{colortbl} and related commands is added.} |
| 809 |
% \SpecialOptIndex{colortbl}{package} |
| 810 |
% \SpecialIndex{\rowcolor} |
| 811 |
% \SpecialIndex{\columncolor} |
| 812 |
% \SpecialIndex{\cellcolor} |
| 813 |
% \SpecialIndex{\arrayrulecolor} |
| 814 |
% \SpecialIndex{\doublerulesepcolor} |
| 815 |
% |
| 816 |
% Another (and more convenient) table coloring tool \textsf{colortbl} may be |
| 817 |
% also used simply by loading it before \textsf{arydshln}. Not only the |
| 818 |
% painting commands |\rowcolor|, |\columncolor| and |\cellcolor| work well, |
| 819 |
% but both solid and dash lines are also colored by the command |
| 820 |
% |\arrayrulecolor| of \textsf{colortbl}\footnote{ |
| 821 |
% |
| 822 |
% The \textsf{colortbl} manual says \cs{arrayrulecolor} and |
| 823 |
% \cs{doublerulesepcolor} may be in \texttt{>\char`\{\ldots\char`\}} |
| 824 |
% in a preamble but they cause an error with the original implementation. |
| 825 |
% This bug is fixed in \textsf{arydshln} and they are now usable to specify |
| 826 |
% the color of the vertical (dash) lines whose specifications occur after |
| 827 |
% the commands.}. |
| 828 |
% |
| 829 |
% One caution is that |\arrayrulecolor| defines the color of the dash-part |
| 830 |
% of dash lines and thus gap-part has no color (i.e. color of the paper on |
| 831 |
% which the line drawn). Therefore, if you have a \textsf{tabular} like; |
| 832 |
% |
| 833 |
%\begin{quote} |
| 834 |
%\begin{verbatim} |
| 835 |
%\begin{tabular}{|>{\columncolor{red}}l:>{\colomncolor{green}}r|} |
| 836 |
%... |
| 837 |
%\end{tabular} |
| 838 |
%\end{verbatim} |
| 839 |
%\end{quote} |
| 840 |
% |
| 841 |
% you will find the vertical dash line is a sequence of black (or the color of |
| 842 |
% |\arrayrulecolor|) and white segments. This problem is partly solved by |
| 843 |
% declaring |\ADLnullwide|\footnote{ |
| 844 |
% |
| 845 |
% Since \textsf{colortbl} automatically loads \textsf{array}, the default is |
| 846 |
% \cs{ADLsomewide}} |
| 847 |
% |
| 848 |
% to conjunct the red and blue columns and to draw the dash line on their |
| 849 |
% border. |
| 850 |
% |
| 851 |
% \DescribeMacro{\ADLnullwidehline} |
| 852 |
% \DescribeMacro{\ADLsomewidehline} |
| 853 |
% Unfortunately, however, |\ADLnullwide| does not affect the real |
| 854 |
% width of horizontal (dash) lines and thus you will still see white gaps |
| 855 |
% in |\hdashline| and |\cdashline|. A solution is to put |
| 856 |
% |\ADLnullwidehline| before you start a |
| 857 |
% \texttt{array}\slash\texttt{tabular}\footnote{ |
| 858 |
% |
| 859 |
% This command also makes \cs{cline} and \cs{cdashline} visisble even if the |
| 860 |
% row below is painted.}. |
| 861 |
% |
| 862 |
% With this command, a horizontal (dash) line is drawn adjusting its bottom |
| 863 |
% edge to that of the row above. The command |\ADLsomewidehline| turns the |
| 864 |
% switch to default and the top edge of a horizontal (dash) line will be |
| 865 |
% adjusted to the bottom edge of the row above. |
| 866 |
% |
| 867 |
% \DescribeMacro{\dashgapcolor} |
| 868 |
% \DescribeMacro{\nodashgapcolor} |
| 869 |
% \SpecialIndex{\color} |
| 870 |
% Another method to avoid white gaps is to give a color to gaps by |
| 871 |
% |\dashgapcolor| with arguments same as |\color|. For example; |
| 872 |
% |
| 873 |
% \begin{quote} |
| 874 |
% |\arrayrulecolor{green}\dashgapcolor[rgb]{1,1,0}| |
| 875 |
% \end{quote} |
| 876 |
% |
| 877 |
% makes colorful dash lines with green dashes and yellow gaps. The command |
| 878 |
% can be placed outside of \texttt{array}\slash\texttt{tabular} for dash |
| 879 |
% lines in the environment, in the argument of preamble character |>| |
| 880 |
% for vertical dash lines following them, or at the beginning of a row for |
| 881 |
% horizontal dash lines following the command. The commmand |
| 882 |
% |\nodashgapcolor| (no arguments) nullifies the effect of |\dashgapcolor|. |
| 883 |
% Note that |\nodashgapcolor| is different from |\dashgapcolor{white}| |
| 884 |
% because the former makes gaps {\it transparent} while the later whiten them. |
| 885 |
% |
| 886 |
% \DescribeEnv{longtable} |
| 887 |
% \DescribeEnv{Longtable} |
| 888 |
% \changes{v1.6}{2003/8/25} |
| 889 |
% {Description of \textsf{longtable} is added.} |
| 890 |
% \SpecialOptIndex{longtable}{package} |
| 891 |
% Usage of \textsf{longtable} with \textsf{arydshln} is quite simple. Just |
| 892 |
% loading \textsf{arydshln} after \textsf{longtable} is enough to make the |
| 893 |
% |longtable| environment able to draw dash-lines. A shorthand activation |
| 894 |
% of dash-line functions is also available by |Longtable| environment. One |
| 895 |
% caution to \textsf{longtable} users is that the temporary results before |
| 896 |
% the {\em convergence} of the column widths may be different from those |
| 897 |
% without \textsf{arydshln}. For example, the following is the first pass |
| 898 |
% result of the example shown in Table~3 of the \textsf{longtable} manual. |
| 899 |
% |
| 900 |
% \begin{quote} |
| 901 |
% \catcode`\|12 |
| 902 |
% \leavevmode\vtop{\offinterlineskip |
| 903 |
% \hbox{\begin{tabular}{|c|c|c|}\hline 1&2&3\end{tabular}} |
| 904 |
% \hbox{\begin{tabular}{|c|}wide multicolumn spanning 1--3\end{tabular}} |
| 905 |
% \hbox{\begin{tabular}{|c|c|}\omit& |
| 906 |
% \omit\vrule height0pt width116.66695pt\cr |
| 907 |
% multicolumn 1--2&3\end{tabular}} |
| 908 |
% \hbox{\begin{tabular}{|c|c|c|}\omit& |
| 909 |
% \omit\vrule height0pt width68.05573pt& |
| 910 |
% \omit\vrule height0pt width116.66695pt\cr |
| 911 |
% wide 1&2&3\\\hline\end{tabular}}} |
| 912 |
% \end{quote} |
| 913 |
% |
| 914 |
% \SpecialOptIndex{LTchunksize}{counter} |
| 915 |
% Since |LTchunksize| is one in the example, columns of each row has their own |
| 916 |
% widths and thus has vertical lines drawn at the edges of the columns. On |
| 917 |
% the other hand, you will have the following as the first pass result with |
| 918 |
% \textsf{arydshln}. |
| 919 |
% |
| 920 |
% \begin{quote} |
| 921 |
% \catcode`\|12 |
| 922 |
% \settowidth\unitlength{\begin{tabular}{|c|c|c|}\hline 1&2&3\end{tabular}} |
| 923 |
% \begin{tabular}[t]{|l|c|c|} |
| 924 |
% \multispan3\relax |
| 925 |
% \leaders\hrule height\arrayrulewidth\hskip\unitlength\cr |
| 926 |
% \hbox to0pt{1\hskip2\tabcolsep 2\hskip2\tabcolsep 3\hss}&&\\ |
| 927 |
% \multicolumn3{|l|}{wide multicolumn spanning 1--3}\\ |
| 928 |
% \multicolumn2{|l|}{\hbox to0pt{multicolumn 1--2\hskip\tabcolsep |
| 929 |
% \hbox to116.66695pt{\hss3\hss}\hss}}&\\ |
| 930 |
% wide 1&2&3\\\hline |
| 931 |
% \omit& |
| 932 |
% \omit\vrule height0pt width68.05573pt& |
| 933 |
% \omit\vrule height0pt width116.66695pt\cr |
| 934 |
% \end{tabular} |
| 935 |
% \end{quote} |
| 936 |
% |
| 937 |
% As you see, the vertical lines are drawn at the column edges of the last |
| 938 |
% row\footnote{ |
| 939 |
% |
| 940 |
% More precisely, drawn according to the column widths established by all |
| 941 |
% the chunks preceding page output.} |
| 942 |
% |
| 943 |
% because \textsf{arydshln} draws them when it see the last row. Anyway, |
| 944 |
% you may ignore temporary results and will have a compatible result when |
| 945 |
% the column widths are converged like the following. |
| 946 |
% |
| 947 |
% \begin{quote} |
| 948 |
% \catcode`\|12 |
| 949 |
% \begin{tabular}[t]{|c|c|c|}\hline |
| 950 |
% 1&2&3\\ |
| 951 |
% \multicolumn{3}{|c|}{wide multicolumn spanning 1--3}\\ |
| 952 |
% \multicolumn{2}{|c|}{multicolumn 1--2}&3\\ |
| 953 |
% wide 1&2&3\\\hline |
| 954 |
% \end{tabular} |
| 955 |
% \end{quote} |
| 956 |
% |
| 957 |
% |
| 958 |
% |
| 959 |
% \section{Known Problems} |
| 960 |
% \label{sec:prob} |
| 961 |
% |
| 962 |
% There are following known problems. |
| 963 |
% |
| 964 |
% \begin{enumerate} |
| 965 |
% \item |
| 966 |
% The new preamble specifiers `|:|' and `|;{|\meta{dash}|/|\meta{gap}|}|' |
| 967 |
% cannot be followed or preceded by `|@{|\meta{text}|}|', or you will have |
| 968 |
% an ugly result. More specifically, a specifier to draw a dash-line at the |
| 969 |
% left edge of a column cannot be preceded by `|@{|\meta{text}|}|', while |
| 970 |
% that to draw at the right edge cannot be followed by `|@{|\meta{text}|}|'. |
| 971 |
% |
| 972 |
% \item\leavevmode |
| 973 |
% \changes{v1.4-1}{1999/06/25} |
| 974 |
% {Description about `\protect\EXCLAMATION' of array package is added.} |
| 975 |
% |
| 976 |
% If you use \textsf{array} package, the restriction of `|@|' shown above is |
| 977 |
% also applied to `|!|'. |
| 978 |
% |
| 979 |
% \item |
| 980 |
% In order to make it sure that a dash-line always {\em touches} its both |
| 981 |
% end, i.e. a dash-line always begins and ends with a dash segment, the |
| 982 |
% amount of a gap will slightly vary depending on the dash-line length. |
| 983 |
% |
| 984 |
% \changes{v1.4-1}{1999/06/25} |
| 985 |
% {Reference to the section for drawing mode is added.} |
| 986 |
% \changes{v1.72-2}{1999/06/25} |
| 987 |
% {Remove the caution about the dash segment dropping.} |
| 988 |
% |
| 989 |
% \item |
| 990 |
% \changes{v1.4-1}{1999/06/25} |
| 991 |
% {Description on minimum length is added.} |
| 992 |
% |
| 993 |
% If a dash-line is too short, you will have an ugly result without overfull |
| 994 |
% message. More specifically, in mode 1 or 3, a line will look to protrude |
| 995 |
% beyond its column\slash row borders if it is shorter than a half of |
| 996 |
% |\dashlinedash|. In mode 2, the minimum length to avoid the protrusion is |
| 997 |
% $1.5\times|\dashlinedash|+ |\dashlinegap|$. |
| 998 |
% |
| 999 |
% \item |
| 1000 |
% \changes{v1.4-1}{1999/06/25} |
| 1001 |
% {Reference to the performance tuning section is added.} |
| 1002 |
% |
| 1003 |
% As described in \S\ref{sec:usage-performance}, |
| 1004 |
% the processing speed for |array| and |tabular| environment will become |
| 1005 |
% slower even if dash-lines are not included. |
| 1006 |
% |
| 1007 |
% \item |
| 1008 |
% \changes{v1.5-1}{2000/07/12} |
| 1009 |
% {Caution about \cs{AC}/\cs{EAC} pair for vertical line coloring is |
| 1010 |
% added.} |
| 1011 |
% \changes{v1.7}{2004/5/21} |
| 1012 |
% {Comment on vertical line coloring with \textsf{colortbl} is added.} |
| 1013 |
% |
| 1014 |
% As described in \S\ref{sec:usage-compat}, |\AC| and |\EAC| pair of |
| 1015 |
% \textsf{colortab} such as |\AC&\EAC| cannot color the vertical line at |
| 1016 |
% |&|. Use |\ADLinactivate| if you want to have a ordinary table with |
| 1017 |
% colored vertical lines. Note that you may color vertical lines with |
| 1018 |
% \textsf{colortbl} package. |
| 1019 |
% |
| 1020 |
% \item |
| 1021 |
% \changes{v1.74}{2018/09/26} |
| 1022 |
% {Comment on \texttt{plextarydshln} is added.} |
| 1023 |
% There should be a number of packages whose own |array|/|tabular| |
| 1024 |
% implementations are not compatible with \textsf{arydshln}, though the |
| 1025 |
% author has made efforts at the compatibility. One of them is |
| 1026 |
% \textsf{plext} package for Japanese typesetting but it has a style file |
| 1027 |
% named |plextarydshln.sty| to solve the compatibility issue. So if you use |
| 1028 |
% the functionality of \textsf{arydshln} with \textsf{plext}, do |
| 1029 |
% |\usepackage{plextarydshln}| instead of |\usepackage{arydshln}|. |
| 1030 |
% \end{enumerate} |
| 1031 |
% |
| 1032 |
% |
| 1033 |
% |
| 1034 |
% \IndexPrologue{\newpage\section*{Index} |
| 1035 |
% Italicized number refers to the page where the specification of |
| 1036 |
% corresponding entry are described.} |
| 1037 |
% \StopEventually{ |
| 1038 |
% \section*{Acknowledgments} |
| 1039 |
% |
| 1040 |
% \changes{v1.4-1}{1999/06/25} |
| 1041 |
% {Thank to more people.} |
| 1042 |
% \changes{v1.5-3}{2003/07/11} |
| 1043 |
% {Thank to Yaxin Liu.} |
| 1044 |
% \changes{v1.6}{2003/08/25} |
| 1045 |
% {Thank to people for \textsf{longtable}.} |
| 1046 |
% \changes{v1.7}{2004/5/21} |
| 1047 |
% {Thank to Klaus Dalinghaus and refer orignal \textsf{colortbl}.} |
| 1048 |
% \changes{v1.71}{2004/8/31} |
| 1049 |
% {Thank to Morten H\o gholm.} |
| 1050 |
% \changes{v1.72-1}{2016/03/19} |
| 1051 |
% {Thank to Ma\"ieul Rouquette.} |
| 1052 |
% \changes{v1.73}{2016/03/19} |
| 1053 |
% {Thank to Ma\"ieul Rouquette again.} |
| 1054 |
% \changes{v1.74}{2018/09/26} |
| 1055 |
% {Thank to Hironobu Yamashita.} |
| 1056 |
% \changes{v1.74}{2018/09/26} |
| 1057 |
% {Thank to Hironobu Yamashita for coloring problem.} |
| 1058 |
% |
| 1059 |
% The author thanks to Monty Hayes who gave the author the opportunity to |
| 1060 |
% make this style, and Weimin Zhang and Takahiro Kubota who pointed out bugs |
| 1061 |
% in early versions. He also thanks to the following people; Sebastian |
| 1062 |
% Rahtz and Graham Williams who kindly invited the style to \TeX{} CTAN and |
| 1063 |
% online catalogue compiled by Graham; Peter Ehrbar who showed the style was |
| 1064 |
% incompatible with \textsf{array} and kindly accepted the offer to be an |
| 1065 |
% alpha-user of v1.4 alone; Zsuzsanna Nagy who reported another |
| 1066 |
% incompatibility problem with \textsf{colortab}; Ralf Heydenreich who |
| 1067 |
% reported the bug causing that glues in a column have no effect; Yaxin |
| 1068 |
% Liu who reported the incompatibility bug of \textsf{array} and |
| 1069 |
% \cs{ADLinactivate}; Craig Leech who reported the incompatibility |
| 1070 |
% problem with \textsf{longtable}, which was also reported by Uwe Jehmlich, |
| 1071 |
% Torge Thielemann and Florian Weig, and had waited for two years and a |
| 1072 |
% half (!)\ for the solution; Klaus Dalinghaus who reported yet another |
| 1073 |
% incompatibility with \textsf{colortbl}; Morten H\o gholm who reported the |
| 1074 |
% bug of |m|-type columns of \textsf{array} which had not manifested in five |
| 1075 |
% (!!)\ years since the author realesed the first \textsf{array}-compatible |
| 1076 |
% version; Ma\"ieul Rouquette who reported another bug of |m|-type |
| 1077 |
% columns of \textsf{longtable} with \textsf{array} which had peacefully |
| 1078 |
% hidden in the package for eleven years and a half (!!!)\ since the author |
| 1079 |
% made the bug fix shown above carelessly, yet another bug related to |
| 1080 |
% \textsf{longtable}, and most surprisingly a problem on intersections of |
| 1081 |
% horizontal and vertical (dash-)lines which has hidden for 23 years (!!!!) |
| 1082 |
% since the very first version of the package; and Hironobu Yamashita who |
| 1083 |
% pointed out bugs hidden for 19 years (!!!!!) by which \textsf{delarray} |
| 1084 |
% did not work, and compatibility problems with \textsf{array} v2.4i and |
| 1085 |
% \textsf{longtable} in \textsf{latex-tools} 2019-01-05. |
| 1086 |
% |
| 1087 |
% The base implementation of \texttt{array} and \texttt{tabular} |
| 1088 |
% environments, part of which the author gives new definitions referring |
| 1089 |
% original ones, are written by Leslie Lamport as a part of \LaTeX-2.09 and |
| 1090 |
% \LaTeXe{} (1997/12/01) to which Johannes Braams and other authors also |
| 1091 |
% contributed. The author also refers \textsf{array} package (v2.4j) |
| 1092 |
% written by Frank Mittelbach and David Carlisle; \textsf{colortab} package |
| 1093 |
% (v0.9) written by Timothy van Zandt; and \textsf{longtable} (v4.11) and |
| 1094 |
% \textsf{colortbl} (v0.1j) packages |
| 1095 |
% written by David Carlisle; to make the style compatible with those |
| 1096 |
% packages. |
| 1097 |
% |
| 1098 |
% \PrintIndex} |
| 1099 |
% |
| 1100 |
% |
| 1101 |
% |
| 1102 |
% \newpage |
| 1103 |
% \section{Implementation} |
| 1104 |
% \label{sec:imp} |
| 1105 |
% \subsection{Problems and Solutions} |
| 1106 |
% \label{sec:imp-ps1} |
| 1107 |
% |
| 1108 |
% \changes{v1.4-1}{1999/06/25} |
| 1109 |
% {The title of section 4.1 is changed.} |
| 1110 |
% \changes{v1.4-1}{1999/06/25} |
| 1111 |
% {\cs{hfil} is replaced with \cs{hss} taking the possibility of |
| 1112 |
% negative wide columns into account.} |
| 1113 |
% \changes{v1.7}{2004/5/21} |
| 1114 |
% {Add notes for dash line coloring.} |
| 1115 |
% |
| 1116 |
% We have two different problems to solve; how to draw horizontal dash-lines |
| 1117 |
% and how to draw vertical dash-lines. The former problem is relatively |
| 1118 |
% easy because the technique for drawing |\cline|-s can be used. That is, if |
| 1119 |
% we know the number of columns, we can draw a dash-line across the |
| 1120 |
% |\multispan|-ed columns by |\xleaders| of dash. Modifying a preamble of |
| 1121 |
% |array|\slash|tabular| to count the number of columns is not hard. Since |
| 1122 |
% |\cdashline| is given beginning and ending columns, its implementation is |
| 1123 |
% also easy. |
| 1124 |
% |
| 1125 |
% \SpecialIndex{\@arstrutbox} |
| 1126 |
% |
| 1127 |
% The latter problem, however, is much harder. Remember that |
| 1128 |
% |array|\slash|tabular| draws vertical solid lines by |\vrule|-s in each row |
| 1129 |
% without height\slash depth specification exploiting \TeX's sophisticated |
| 1130 |
% mechanism of the rule extension in the surrounding box. Since \TeX{} does |
| 1131 |
% not have such a mechanism for |\xleaders| unfortunately, we at least have |
| 1132 |
% to know the height and depth of a row which includes vertical dash-lines. |
| 1133 |
% Although the height and depth are often same as those of |\@arstrutbox|, we |
| 1134 |
% will have an exceptionally tall and/or deep row that makes dash-lines {\em |
| 1135 |
% broken} if we assume every row has the standard height and depth. |
| 1136 |
% |
| 1137 |
% Moreover, even if we can measure the height\slash depth of each row (in |
| 1138 |
% fact we will do as described later), drawing dash-lines in each row will |
| 1139 |
% not produce a good result. Look at the following two examples closely. |
| 1140 |
% |
| 1141 |
%\begin{quote} |
| 1142 |
%\makeatletter |
| 1143 |
%\begin{tabular}{c:c}\hline |
| 1144 |
%A&B\\\hline |
| 1145 |
%\noalign{\xdef\adl@rowsL{\adl@rowsL(\relax/0);} |
| 1146 |
% \xdef\adl@rowsR{\adl@rowsR(\relax/0);}} |
| 1147 |
%{\vrule height2\ht\strutbox depth2\dp\strutbox width\z@\LARGE A}&B\\\hline |
| 1148 |
%\end{tabular}\qquad |
| 1149 |
%\begin{tabular}{c:c}\hline |
| 1150 |
%A&B\\\hline |
| 1151 |
%{\vrule height2\ht\strutbox depth2\dp\strutbox width\z@\LARGE A}&B\\\hline |
| 1152 |
%\end{tabular} |
| 1153 |
%\end{quote} |
| 1154 |
% |
| 1155 |
% In the left example, two dash-lines are individually drawn in two rows. |
| 1156 |
% Since the first row is not so tall and deep (8.4\,pt\slash |
| 1157 |
% 3.6\,pt) as to contain enough number of default dash segments (4\,pt dash and |
| 1158 |
% 4\,pt gap) to keep |\xleaders| from inserting a large space, the dash-line |
| 1159 |
% in the first row is {\em sparse}. On the other hand, the second row is |
| 1160 |
% enough tall and deep (16.8\,pt\slash 7.2\,pt) and thus the dash-line in the |
| 1161 |
% row looks better. Thus the resulting dash-line is awful because it does |
| 1162 |
% not have a continuous dash/gap sequence. |
| 1163 |
% |
| 1164 |
% The right example, which we wish to produce, is much better than the left. |
| 1165 |
% In this example, the dash line is drawn across two rows keeping continuous |
| 1166 |
% steps of dashes and gaps. In order to have this result, we have to draw |
| 1167 |
% the dash-line {\em after} two rows are built because it is necessary to |
| 1168 |
% know the total height and depth of two rows. In general, if we know the |
| 1169 |
% total height and depth of rows and whether a column has a dash-line, we can |
| 1170 |
% draw dash-lines by adding an extra row containing dash-lines. For |
| 1171 |
% example, the result shown above is obtained by the following row. |
| 1172 |
% |
| 1173 |
% \begin{quote} |
| 1174 |
% |\omit\hss|\meta{dash-line of 36\,pt high}|&\omit\cr| |
| 1175 |
% \end{quote} |
| 1176 |
% |
| 1177 |
% Note that \meta{dash-line of 36\,pt high} have to be |\smash|-ed. |
| 1178 |
% |
| 1179 |
% In addition to this basic scheme, we have to take the following points |
| 1180 |
% into account. |
| 1181 |
% |
| 1182 |
% \begin{itemize} |
| 1183 |
% \item |
| 1184 |
% A dash-line drawn by the preamble character `|;|' will have non-default |
| 1185 |
% dash\slash gap specification. |
| 1186 |
% |
| 1187 |
% \item |
| 1188 |
% A column may have two or more dash-lines separated by spaces of |
| 1189 |
% |\doublerulesep|. Mixed sequence of solid- and dash-lines also have to be |
| 1190 |
% allowed. |
| 1191 |
% |
| 1192 |
% \item |
| 1193 |
% The first column may have dash-lines at both ends, while those of others |
| 1194 |
% will appear at right ends only. An exception of this rule is brought by |
| 1195 |
% |\multicolumn| that may have leading sequence of solid- and/or dash-line |
| 1196 |
% specifiers in its preamble. |
| 1197 |
% |
| 1198 |
% \item |
| 1199 |
% A |\multicolumn| may break or add a dash-line, or may change the |
| 1200 |
% dash\slash gap specification of a dash-line. A sequence of |
| 1201 |
% |\h(dash)line|-s also break dash-lines. |
| 1202 |
% |
| 1203 |
% \item |
| 1204 |
% If \textsf{colortbl} is in use, coloring dash\slash gap by |
| 1205 |
% |\arrayrulecolor| and |\dashgapcolor| gives another possibility of the |
| 1206 |
% variation of dash\slash gap specification. |
| 1207 |
% \end{itemize} |
| 1208 |
% |
| 1209 |
% In order to cope with them, the following data structure is constructed |
| 1210 |
% during rows are built. |
| 1211 |
% |
| 1212 |
% \begin{enumerate} |
| 1213 |
% \item |
| 1214 |
% The list of row information $R=\langle r_1,r_2,\ldots,r_N\rangle$. |
| 1215 |
% |
| 1216 |
% \item |
| 1217 |
% The $i\th$ element of $R$, $r_i$, is one of the following\footnote{ |
| 1218 |
% |
| 1219 |
% In the real implementation, the structure of $r_i$ is slightly different.}. |
| 1220 |
% |
| 1221 |
% \begin{enumerate} |
| 1222 |
% \item |
| 1223 |
% A triple $\langle C^L_i,C^R_i,h_i\rangle$, where $C^L_i$ and $C^R_i$ are |
| 1224 |
% the lists of solid- or dash-line segments drawn at the left and right edge |
| 1225 |
% of columns respectively, and $h_i$ is the height plus depth of the $i\th$ |
| 1226 |
% row. |
| 1227 |
% |
| 1228 |
% \item |
| 1229 |
% ${\it connect}(h_i)$ for a |\h(dash)line| of $h_i$ wide meaning that $r_i$ |
| 1230 |
% is an empty pseudo row of $h_i$ high and dash-lines are not broken at the |
| 1231 |
% row. |
| 1232 |
% |
| 1233 |
% \item |
| 1234 |
% \changes{v1.6}{2003/8/25} |
| 1235 |
% {Description of \textit{discard} is added.} |
| 1236 |
% In |longtable| environment, ${\it discard}(h_i)$ for a negative vertical |
| 1237 |
% space inserted by |\\[|\meta{$h_i$}|]| or |\h(dash)line| meaning $r_i$ |
| 1238 |
% is an empty pseudo row of $h_i$ high and dash-lines are not broken but may |
| 1239 |
% be discarded by the page break at the row. |
| 1240 |
% |
| 1241 |
% \item |
| 1242 |
% ${\it disconnect}(h_i)$ for a vertical gap generated by a sequence of |
| 1243 |
% |\h(dash)line| meaning that $r_i$ is an empty pseudo row of $h_i$ high and |
| 1244 |
% dash-lines are broken at the row. |
| 1245 |
% \end{enumerate} |
| 1246 |
% |
| 1247 |
% \item |
| 1248 |
% $C^L_i=\langle e^i_1,e^i_2,\ldots,e^i_m\rangle$ where $e^i_j$ corresponds |
| 1249 |
% to the $j\th$ (leftmost is first) solid- or dash-line segment. $C^R_i$ is |
| 1250 |
% similar but its elements are ordered in reverse, i.e. the rightmost segment |
| 1251 |
% is the first element. |
| 1252 |
% |
| 1253 |
% \item |
| 1254 |
% \changes{v1.7}{2004/5/21} |
| 1255 |
% {A dash/gap specification $d^i_j/g^i_j$ now has color.} |
| 1256 |
% The $j\th$ element of $C^L_i$ or $C^R_i$, $e^i_j$, is a triple $\langle |
| 1257 |
% c^i_j,d^i_j,g^i_j\rangle$ where $c^i_j$ is the column number in which the |
| 1258 |
% segment appears, and $d^i_j$ and $g^i_j$ are dash\slash gap specification, |
| 1259 |
% length and color, of the segment. For a solid line segment, the length |
| 1260 |
% attributes of both $d^i_j$ and $g^i_j$ are 0. |
| 1261 |
% \end{enumerate} |
| 1262 |
% |
| 1263 |
% Then this data structure is processed to draw solid- and dash-lines at the |
| 1264 |
% end of the |array|\slash|tabular| as follows. Let $e^i_j=\langle c^i_j, |
| 1265 |
% d^i_j, g^i_j\rangle$ be the $j\th$ element of $C^L_i$ of $r_i$. The {\em |
| 1266 |
% position} $p^i_j$ of $e^i_j$ in the column $c^i_j$ is defined as follows. |
| 1267 |
%$$ |
| 1268 |
% p^i_j = \cases{1& if $j=1 \LOR c^i_j\neq c^i_{j-1}$\cr |
| 1269 |
% p^i_{j-1}+1& otherwise}. |
| 1270 |
%$$ |
| 1271 |
% The following defines whether two elements $e^i_j$ and $e^{i'}_{j'}$ are |
| 1272 |
% {\em connected}, or $e^i_j\sim e^{i'}_{j'}$. |
| 1273 |
% |
| 1274 |
% \begin{eqnarray*} |
| 1275 |
% e^i_j\sim e^{i'}_{j'}& |
| 1276 |
% \togets&i<i'\LAND\\ |
| 1277 |
% && c^i_j=c^{i'}_{j'}\LAND d^i_j=d^{i'}_{j'}\LAND g^i_j=g^{i'}_{j'}\LAND |
| 1278 |
% p^i_j=p^{i'}_{j'}\LAND\\ |
| 1279 |
% && ^\forall k(i<k<i'\to r_k\in |
| 1280 |
% \{\mathit{connect}(h_k),\mathit{discard}(h_k)\}). |
| 1281 |
% \end{eqnarray*} |
| 1282 |
% |
| 1283 |
% With these definitions, we can classify all $e^i_j$ into ordered sets |
| 1284 |
% $S_1,S_2,\ldots S_n$ as follows. |
| 1285 |
% |
| 1286 |
% \def\PH{\phantom{^\forall e^i_j\in S_k,\forall e^{i'}_{j'}\in S_{k'}:{}}} |
| 1287 |
% \begin{eqnarray*} |
| 1288 |
% k\neq k'&\togets& |
| 1289 |
% S_k\cap S_{k'}=\emptyset\\ |
| 1290 |
% e^i_j\sim e^{i'}_{j'}&\togets& |
| 1291 |
% ^\exists k:e^i_j,e^{i'}_{j'}\in S_k\LAND |
| 1292 |
% S_k=\{\ldots,e^i_j,e^{i'}_{j'},\ldots\}\\ |
| 1293 |
% k<k'&\togets& |
| 1294 |
% ^\forall e^i_j\in S_k,\forall e^{i'}_{j'}\in S_{k'}: |
| 1295 |
% (c^i_j<c^{i'}_{j'})\LOR\\ |
| 1296 |
% && \PH (c^i_j=c^{i'}_{j'}\LAND p^i_j<p^{i'}_{j'})\LOR\\ |
| 1297 |
% && \PH (c^i_j=c^{i'}_{j'}\LAND p^i_j=p^{i'}_{j'}\LAND i<i'). |
| 1298 |
% \end{eqnarray*} |
| 1299 |
% |
| 1300 |
% Now we can draw a dash-line $L_k=\langle\gamma_k, \pi_k, \delta_k, \xi_k, |
| 1301 |
% \tau_k, \beta_k\rangle$ corresponding to $S_k=\{e^i_j,\ldots,e^{i'}_{j'}\}$ |
| 1302 |
% as follows. |
| 1303 |
% |
| 1304 |
% \begin{itemize} |
| 1305 |
% \item |
| 1306 |
% $L_k$ is $\pi_k\th$ line in the $\gamma_k\th$ column where $\gamma_k= |
| 1307 |
% c^i_j=\ldots=c^{i'}_{j'}$ and $\pi_k=p^i_j=\ldots=p^{i'}_{j'}$. |
| 1308 |
% |
| 1309 |
% \item |
| 1310 |
% $L_k$ has the dash specification (size and color) |
| 1311 |
% $\delta_k=d^i_j=\ldots=d^{i'}_{j'}$ and gap specification |
| 1312 |
% $\xi_k=g^i_j=\ldots=g^{i'}_{j'}$. |
| 1313 |
% |
| 1314 |
% \item |
| 1315 |
% \changes{v1.73-1}{2016/04/28} |
| 1316 |
% {Add the definition of $\eta_l$ and addition\slash subtraction of it |
| 1317 |
% for $\tau_k$ and $\beta_k$.} |
| 1318 |
% |
| 1319 |
% The top and bottom ends of $L_k$ are at $\tau_k$ and $\beta_k$ above the |
| 1320 |
% bottom of the |array|\slash|tabular|, where; |
| 1321 |
%$$ |
| 1322 |
% \eta_l=\cases{h_l&$r_l=\mathit{connect(h_l)}$\cr |
| 1323 |
% 0&otherwise},\quad |
| 1324 |
% \tau_k=\eta_{i-1}+\sum_{l=i}^N h_l,\quad |
| 1325 |
% \beta_k=-\eta_{i'+1}+\sum_{l=i'+1}^N h_l. |
| 1326 |
%$$ |
| 1327 |
% Note that $\eta_{i-1}$ and $\eta_{i'+1}$ are added\slash subtracted so that |
| 1328 |
% the top\slash bottom of $L_k$ is at the top\slash bottom edge of the |
| 1329 |
% horizontal lines above\slash below the set $S_k$. |
| 1330 |
% \end{itemize} |
| 1331 |
% |
| 1332 |
% The row to draw $L_1,\ldots,L_n$ is; |
| 1333 |
%$$ |
| 1334 |
% \sigma_1 L_1 \sigma_2 L_2 \ldots L_{n-1}\sigma_n L_n\sigma_{n+1}|\cr| |
| 1335 |
%$$ |
| 1336 |
% where; |
| 1337 |
% |
| 1338 |
% \def\amp{\hbox{\tt\&}} |
| 1339 |
% \begin{eqnarray*} |
| 1340 |
% \sigma_1&=& |
| 1341 |
% \cs{omit}[\cs{hss}\amp\cs{omit}]^{\gamma_1-1}\\[1ex] |
| 1342 |
% \sigma_{1<k\leq n}&=& |
| 1343 |
% \cases{ \cs{null}& |
| 1344 |
% if $\gamma_{k-1}=\gamma_k\LAND \pi_{k-1}=\pi_k$\cr |
| 1345 |
% \cs{hskip}\cs{doublerulesep}& |
| 1346 |
% if $\gamma_{k-1}=\gamma_k\LAND \pi_{k-1}\neq\pi_k$\cr |
| 1347 |
% [\cs{hss}\amp\cs{omit}]^{\gamma_k-\gamma_{k-1}}& |
| 1348 |
% if $\gamma_{k-1}\neq\gamma_k$\cr}\\[1ex] |
| 1349 |
% \sigma_{n+1}&=& |
| 1350 |
% [\cs{hss}\amp\cs{omit}]^{{\mit\Gamma}-\gamma_n-1}\cs{hss}. |
| 1351 |
% \end{eqnarray*} |
| 1352 |
% |
| 1353 |
% Note that $[x]^m$ means $m$-times iteration of $x$, and $\mit\Gamma$ is |
| 1354 |
% the number of columns specified in the preamble. |
| 1355 |
% |
| 1356 |
% Dash-lines at the right edges of columns are similarly drawn by processing |
| 1357 |
% $C^R_i$ with the following modifications. |
| 1358 |
% |
| 1359 |
% \begin{eqnarray*} |
| 1360 |
% k<k'&\togets& |
| 1361 |
% ^\forall e^i_j\in S_k,\forall e^{i'}_{j'}\in S_{k'}: |
| 1362 |
% (c^i_j<c^{i'}_{j'})\LOR\\ |
| 1363 |
% && \PH (c^i_j=c^{i'}_{j'}\LAND p^i_j>p^{i'}_{j'})\LOR\\ |
| 1364 |
% && \PH (c^i_j=c^{i'}_{j'}\LAND p^i_j=p^{i'}_{j'}\LAND i<i')\\ |
| 1365 |
% \sigma_1&=& |
| 1366 |
% \cs{omit}\cs{hss}[\amp\cs{omit}\cs{hss}]^{\gamma_1-1}\\[1ex] |
| 1367 |
% \sigma_{k>1}&=& |
| 1368 |
% \cases{ \cs{null}& |
| 1369 |
% if $\gamma_{k-1}=\gamma_k\LAND \pi_{k-1}=\pi_k$\cr |
| 1370 |
% \cs{hskip}\cs{doublerulesep}& |
| 1371 |
% if $\gamma_{k-1}=\gamma_k\LAND \pi_{k-1}\neq\pi_k$\cr |
| 1372 |
% [\amp\cs{omit}\cs{hss}]^{\gamma_k-\gamma_{k-1}}& |
| 1373 |
% if $\gamma_{k-1}\neq\gamma_k$\cr}\\[1ex] |
| 1374 |
% \sigma_{n+1}&=& |
| 1375 |
% [\amp\cs{omit}\cs{hss}]^{{\mit\Gamma}-\gamma_n-1} |
| 1376 |
% \end{eqnarray*} |
| 1377 |
% |
| 1378 |
% |
| 1379 |
% |
| 1380 |
% \subsection{Another Old Problem} |
| 1381 |
% \label{sec:imp-ps2} |
| 1382 |
% |
| 1383 |
% \changes{v1.72-2}{1999/06/25} |
| 1384 |
% {Change the title of \S4.2 and rephrase sentences according to the |
| 1385 |
% fix of \cs{xleader}'s problem.} |
| 1386 |
% |
| 1387 |
% In the default mode 1, we draw a dash line of dash size $d$ and gap size |
| 1388 |
% $g$ as follows. Let $W$ be the length of the line plus 10\,|sp|\footnote{ |
| 1389 |
% |
| 1390 |
% This small amount is added by \cs{xleaders} in order to, according to the |
| 1391 |
% comment in \texttt{tex.web}, compensate floating point rounding error.}, |
| 1392 |
% |
| 1393 |
% which is unknown for us if horizontal but known for \TeX, and assume |
| 1394 |
% $W\geq d/2$ (or the line protrude to the column\slash row boarder.) At |
| 1395 |
% the both ends of the columns, dashes of $d/2$ long are drawn to make the |
| 1396 |
% dash-line {\em touched} to the ends. Then $n=\lfloor(W-d-g)/(d+g)\rfloor$ |
| 1397 |
% dashes are equally distributed in the remaining space. Thus we will have; |
| 1398 |
% $$ |
| 1399 |
% D_0(d/2)G_0(g+\epsilon')D_1(d)G_1(g+\epsilon)\ldots |
| 1400 |
% G_{n-1}(g+\epsilon)D_n(d)G_n(g+\epsilon')D_{n+1}(d/2) |
| 1401 |
% $$ |
| 1402 |
% where $D_i(l)$ and $G_i(l)$ are dash and gap of $l$ long, |
| 1403 |
% $\epsilon=(W-(n+1)(d+g))/(n+1)$ (rounded), and |
| 1404 |
% $\epsilon'=(W-(n+1)(d+g)-(n-1)\epsilon)/2$ to compensate the rounding |
| 1405 |
% error on the calculation of $\epsilon$. For a horizontal line, this |
| 1406 |
% result will be obtained by |\xleaders| as follows where $G^m_i(\epsilon)$ |
| 1407 |
% and $G^m_i(\epsilon')$ are the spaces inserted by |\xleaders|. |
| 1408 |
% |
| 1409 |
% \begin{eqnarray*} |
| 1410 |
% \rlap{$\displaystyle D_0(d/2)G^l_0(g/2) |
| 1411 |
% \hbox{\cs{xleaders}\cs{hbox}{\tt\char`\{}} |
| 1412 |
% G^r(g/2)D(d)G^l(g/2)\hbox{\tt\char`\}\cs{hss}\ } |
| 1413 |
% G^r_n(g)D_{n+1}(d/2)$}\qquad\\ |
| 1414 |
% &=&D_0(d/2)G^l_0(g/2)G^m_0(\epsilon') |
| 1415 |
% \left(G^r_0(g/2)D_1(d)G^l_1(g/2)\right)G^m_1(\epsilon)\\ |
| 1416 |
% && \phantom{D_0(d/2)G^l_0(g/2)G^m_0(\epsilon)} |
| 1417 |
% \left(G^r_1(g/2)D_2(d)G^l_2(g/2)\right)G^m_2(\epsilon)\\ |
| 1418 |
% && \phantom{D_0(d/2)G^l_0(g/2)G^m_0(\epsilon)}\ldots\\ |
| 1419 |
% && \phantom{D_0(d/2)G^l_0(g/2)G^m_0(\epsilon)} |
| 1420 |
% \llap{$\displaystyle G^m_{n-1}(\epsilon)$} |
| 1421 |
% \left(G^r_{n-1}(g/2)D_n(d)G^l_n(g/2)\right) |
| 1422 |
% G^m_n(\epsilon')G^r_n(g/2)D_{n+1}(d/2)\\ |
| 1423 |
% &=&D_0(d/2)G_0(g+\epsilon')D_1(d)G_1(g+\epsilon)\ldots |
| 1424 |
% G_{n-1}(g+\epsilon)D_n(d)G_n(g+\epsilon')D_{n+1}(d/2) |
| 1425 |
% \end{eqnarray*} |
| 1426 |
% |
| 1427 |
% The problem is that $\epsilon'$ could be negative and old \TeX{} mistakingly |
| 1428 |
% ignored this possibility. That is, since the \TeX{} older than 3.141592 |
| 1429 |
% did not put |\hbox| beyond the right edge of |\xleaders|, the rightmost |
| 1430 |
% |\hbox| was omitted if $\epsilon'$ is negative. |
| 1431 |
% |
| 1432 |
% Since it is (almost) impossible to know the length of a horizontal line, |
| 1433 |
% we could not cope with this problem by adding or subtracting its length. |
| 1434 |
% Thus we introduced {\em drawing mode} to have imperfect solutions. In the |
| 1435 |
% mode 2, we draw a line by the following sequence. |
| 1436 |
% |
| 1437 |
% \begin{eqnarray*} |
| 1438 |
% \rlap{$\displaystyle D_0(d/2)G^l_0(g/2)G^r_{0'}(g/2)D_{1'}(d)G^l_{1'}(g/2) |
| 1439 |
% G(-d-g)$}\qquad\\ |
| 1440 |
% && \hbox{\cs{xleaders}\cs{hbox}{\tt\char`\{}} |
| 1441 |
% G^r(g/2)D(d)G^l(g/2)\hbox{\tt\char`\}\cs{hss}\ }\\ |
| 1442 |
% && G(-d-g)G^r_{n'}(g/2)D_{n'}(d)G^l_{n'}(g/2)G^r_n(g)D_{n+1}(d/2) |
| 1443 |
% \end{eqnarray*} |
| 1444 |
% |
| 1445 |
% That is, $n\th$ |\hbox| that could be disappeared is put twice and the |
| 1446 |
% first one is also overlaid for symmetrization. Therefore the length of the |
| 1447 |
% first and $n\th$ dashes is $d+\vert\epsilon'\vert$ and thus could be a |
| 1448 |
% little bit longer than others. |
| 1449 |
% |
| 1450 |
% On the other hand, we replace |\xleaders| of mode 1 with |\cleaders| for |
| 1451 |
% the drawing in mode 3. The result will be; |
| 1452 |
% $$ |
| 1453 |
% D_0(d/2)G_0(g+R)D_1(d)G_1(g)\ldots |
| 1454 |
% G_{n-1}(g)D_n(d)G_n(g+R)D_{n+1}(d/2) |
| 1455 |
% $$ |
| 1456 |
% where $R=(W-(n+1)(d+g))/2$ to make the first and last gaps considerably wider |
| 1457 |
% than others. |
| 1458 |
% |
| 1459 |
% |
| 1460 |
% |
| 1461 |
% \iffalse |
| 1462 |
%<*package> |
| 1463 |
% \fi |
| 1464 |
% |
| 1465 |
% \subsection{Register Declaration} |
| 1466 |
% \label{sec:imp-decl} |
| 1467 |
% |
| 1468 |
% Here registers and switches are declared. |
| 1469 |
% |
| 1470 |
% \begin{macro}{\dashlinedash} |
| 1471 |
% \begin{macro}{\dashlinegap} |
| 1472 |
% \begin{macro}{\hdashlinewidth} |
| 1473 |
% \begin{macro}{\hdashlinegap} |
| 1474 |
% First of all, two |\dimen| registers |\dashlinedash| and |\dashlinegap| |
| 1475 |
% to control the shape of dash-lines are declared, and their default values, |
| 1476 |
% 4\,pt for both, are assigned to them. They have aliases, |
| 1477 |
% |\hdashlinewidth| and |\hdashlinegap| respectively, for the backward |
| 1478 |
% compatibility. |
| 1479 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 1480 |
% |
| 1481 |
% \begin{macrocode} |
| 1482 |
%% Register Declaration |
| 1483 |
|
| 1484 |
\newdimen\dashlinedash \dashlinedash4pt % |
| 1485 |
\newdimen\dashlinegap \dashlinegap4pt % |
| 1486 |
\let\hdashlinewidth\dashlinedash |
| 1487 |
\let\hdashlinegap\dashlinegap |
| 1488 |
|
| 1489 |
% \end{macrocode} |
| 1490 |
% |
| 1491 |
% Next, the following six switches are declared. |
| 1492 |
% \begin{itemize} |
| 1493 |
% \item |
| 1494 |
% \begin{macro}{\ifadl@leftrule} |
| 1495 |
% |\ifadl@leftrule| is used in the preamble analysis macro |\@mkpream| and |
| 1496 |
% is true during it processes leading characters for solid- and dash-lines, |
| 1497 |
% i.e.\ `\verb!|!', `|:|', and `|;|'. |
| 1498 |
% \end{macro} |
| 1499 |
% |
| 1500 |
% \item |
| 1501 |
% \begin{macro}{\ifadl@connected} |
| 1502 |
% |\ifadl@connected| is used to indicate the {\em connection} $e^i_j\sim |
| 1503 |
% e^{i'}_{j'}$. When we process $e^{i'}_{j'}$, the switch is true iff |
| 1504 |
% $^\exists e^i_j(e^i_j\sim e^{i'}_{j'})$. |
| 1505 |
% \end{macro} |
| 1506 |
% |
| 1507 |
% \item |
| 1508 |
% \begin{macro}{\ifadl@doublerule} |
| 1509 |
% |\ifadl@doublerule| is used to make $\sigma_k$. When we are to make |
| 1510 |
% $\sigma_k L_k$, it is true iff $\gamma_{k-1}=\gamma_k\LAND\pi_{k-1}\neq |
| 1511 |
% \pi_k$. |
| 1512 |
% \end{macro} |
| 1513 |
% |
| 1514 |
% \item |
| 1515 |
% \begin{macro}{\ifadl@zwvrule} |
| 1516 |
% \changes{v1.4-2-2}{1999/06/25} |
| 1517 |
% {Introduced to indicate vertical lines have null width.} |
| 1518 |
% |\ifadl@zwvrule| controls the {\em real} width of vertical lines. If it |
| 1519 |
% is true, lines are drawn as if their width is zero following \LaTeX's |
| 1520 |
% standard. Otherwise, their width |\arrayrulewidth| contribute to the |
| 1521 |
% width of columns as \textsf{array} does. |
| 1522 |
% \end{macro} |
| 1523 |
% |
| 1524 |
% \item |
| 1525 |
% \begin{macro}{\ifadl@zwhrule} |
| 1526 |
% \changes{v1.7-1}{2004/5/21} |
| 1527 |
% {Introduced to indicate horizontal lines have null width.} |
| 1528 |
% |\ifadl@zwhrule| controls the {\em real} width of horizontal lines. If it |
| 1529 |
% is true, a line is drawn as if its width is zero and its bottom edge is |
| 1530 |
% adjusted to that of the row above by inserting |\vskip-\arrayulewidth| |
| 1531 |
% before the drawing. Thus a horizontal dash line is included in the row |
| 1532 |
% above and its gaps look colored properly if the row is painted. If it is |
| 1533 |
% false, the width |\arrayrulewidth| contribute to the height of |
| 1534 |
% \texttt{array}\slash\texttt{tabular} as usual. |
| 1535 |
% \end{macro} |
| 1536 |
% |
| 1537 |
% \item |
| 1538 |
% \begin{macro}{\ifadl@usingarypkg} |
| 1539 |
% \changes{v1.4-2-1}{1999/06/25} |
| 1540 |
% {Introduced to know if \textsf{array} is loaded.} |
| 1541 |
% |\ifadl@usingarypkg| is true iff \textsf{array} has been loaded prior to |
| 1542 |
% \textsf{arydshln}. This switch shows us which definitions, by \LaTeX{} or |
| 1543 |
% \textsf{array}, we have to modify. Its value is set by examining if |
| 1544 |
% |\extrarowheight|, which is introduced by \textsf{array}, is defined. |
| 1545 |
% \end{macro} |
| 1546 |
% |
| 1547 |
% \item |
| 1548 |
% \begin{macro}{\ifadl@inactive} |
| 1549 |
% \changes{v1.4-2-3}{1999/06/25} |
| 1550 |
% {Introduced to indicate dash-line functions are inactive.} |
| 1551 |
% |\ifadl@inactive| inactivates dash-line functions if it is true. Its |
| 1552 |
% default value is false. |
| 1553 |
% \end{macro} |
| 1554 |
% \end{itemize} |
| 1555 |
% |
| 1556 |
% \SpecialIndex{\@tempswa} |
| 1557 |
% We also use a working switch |\@tempswa|. |
| 1558 |
% |
| 1559 |
% \begin{macrocode} |
| 1560 |
\newif\ifadl@leftrule |
| 1561 |
\newif\ifadl@connected |
| 1562 |
\newif\ifadl@doublerule |
| 1563 |
\newif\ifadl@zwvrule |
| 1564 |
\newif\ifadl@zwhrule |
| 1565 |
\newif\ifadl@usingarypkg |
| 1566 |
\ifx\extrarowheight\undefined \adl@usingarypkgfalse |
| 1567 |
\else \adl@usingarypkgtrue \fi |
| 1568 |
\newif\ifadl@inactive \adl@inactivefalse |
| 1569 |
|
| 1570 |
% \end{macrocode} |
| 1571 |
% |
| 1572 |
% \begin{macro}{\ADLnullwide} |
| 1573 |
% \changes{v1.7-1}{2004/5/21} |
| 1574 |
% {Introduced to make horizontal lines null wide.} |
| 1575 |
% \begin{macro}{\ADLsomewide} |
| 1576 |
% \changes{v1.7-1}{2004/5/21} |
| 1577 |
% {Introduced to make horizontal lines \cs{arraydashline} wide.} |
| 1578 |
% The switch |\ifadl@hwvrule| is turned on/off by user interface macros |
| 1579 |
% |\ADLnullwide| and |\ADLsomewide|. Its initial value is the complement of |
| 1580 |
% |\adl@usingarypkg|. |
| 1581 |
% \end{macro}\end{macro} |
| 1582 |
% |
| 1583 |
% \begin{macro}{\ADLnullwidehline} |
| 1584 |
% \changes{v1.4-2-2}{1999/06/25} |
| 1585 |
% {Introduced to make vertical lines null wide.} |
| 1586 |
% \begin{macro}{\ADLsomewidehline} |
| 1587 |
% \changes{v1.4-2-2}{1999/06/25} |
| 1588 |
% {Introduced to make vertical lines \cs{arraydashline} wide.} |
| 1589 |
% The switch |\ifadl@zwvrule| is turned on/off by user interface macros |
| 1590 |
% |\ADLnullwidehline| and |\ADLsomewidehline|. Its initial value is false. |
| 1591 |
% \end{macro}\end{macro} |
| 1592 |
% |
| 1593 |
% \begin{macro}{\ADLactivate} |
| 1594 |
% \begin{macro}{\ADLinactivate} |
| 1595 |
% The switch |\ifadl@inactive| is also turned on/off by user interface macros |
| 1596 |
% |\ADL#inactivate| and |\ADLactivate|. |
| 1597 |
% \end{macro}\end{macro} |
| 1598 |
% |
| 1599 |
% \begin{macrocode} |
| 1600 |
\def\ADLnullwide{\adl@zwvruletrue} |
| 1601 |
\def\ADLsomewide{\adl@zwvrulefalse} |
| 1602 |
\ifadl@usingarypkg \ADLsomewide \else \ADLnullwide \fi |
| 1603 |
\def\ADLnullwidehline{\adl@zwhruletrue} |
| 1604 |
\def\ADLsomewidehline{\adl@zwhrulefalse} |
| 1605 |
\ADLsomewidehline |
| 1606 |
|
| 1607 |
\def\ADLactivate{\adl@inactivefalse} |
| 1608 |
\def\ADLinactivate{\adl@inactivetrue} |
| 1609 |
|
| 1610 |
% \end{macrocode} |
| 1611 |
% |
| 1612 |
% The following |\box| register and three |\dimen| registers are used to |
| 1613 |
% measure the height and depth of a row. |
| 1614 |
% |
| 1615 |
% \begin{itemize} |
| 1616 |
% \item |
| 1617 |
% \begin{macro}{\adl@box} |
| 1618 |
% The contents of a column is packed into the |\box| register |\adl@box| to |
| 1619 |
% measure its height and depth. |
| 1620 |
% \end{macro} |
| 1621 |
% |
| 1622 |
% \item |
| 1623 |
% \begin{macro}{\adl@height} |
| 1624 |
% \begin{macro}{\adl@depth} |
| 1625 |
% The |\dimen| registers |\adl@height| and |\adl@depth| contain the |
| 1626 |
% height\slash depth of the tallest\slash deepest column in a row. When a |
| 1627 |
% column is processed, they are compared to the height and depth of |
| 1628 |
% |\adl@box| and are updated if they are less. |
| 1629 |
% \end{macro}\end{macro} |
| 1630 |
% |
| 1631 |
% \vskip-2ex\vskip0pt |
| 1632 |
% \begin{macro}{\adl@heightsave} |
| 1633 |
% \begin{macro}{\adl@depthsave} |
| 1634 |
% Since we have to update these registers |\global|-ly to pass their values |
| 1635 |
% across |&| and we may have a column containing |array|\slash|tabular|, |
| 1636 |
% they are saved into |\adl@heightsave|\slash|\adl@depthsave| at the |
| 1637 |
% beginning of the environment and are restored at its end. |
| 1638 |
% \end{macro}\end{macro} |
| 1639 |
% |
| 1640 |
% \item |
| 1641 |
% \begin{macro}{\adl@finaldepth} |
| 1642 |
% \changes{v1.4-2-6}{1999/06/25} |
| 1643 |
% {Introduced to measure the depth of the last row.} |
| 1644 |
% The other |\dimen| register |\adl@finaldepth| is set to the depth of the |
| 1645 |
% last row, or zero if the last vertical item is a horizontal line. This |
| 1646 |
% value is used to shift |array|\slash|tabular| down because we add extra |
| 1647 |
% two |\smash|-ed rows which make the depth of |array|\slash|tabular| zero. |
| 1648 |
% \end{macro} |
| 1649 |
% \end{itemize} |
| 1650 |
% |
| 1651 |
% \SpecialIndex{\@tempdima} |
| 1652 |
% \SpecialIndex{\@tempdimb} |
| 1653 |
% We also use working |\dimen| registers |\@tempdima| and |\@tempdimb|. |
| 1654 |
% |
| 1655 |
% \begin{macrocode} |
| 1656 |
\newbox\adl@box |
| 1657 |
\newdimen\adl@height \newdimen\adl@heightsave |
| 1658 |
\newdimen\adl@depth \newdimen\adl@depthsave |
| 1659 |
\newdimen\adl@finaldepth |
| 1660 |
% \end{macrocode} |
| 1661 |
% |
| 1662 |
% Then the following |\count| registers are declared. Note that some of |
| 1663 |
% them contain dimensions measured by the unit |sp|. |
| 1664 |
% |
| 1665 |
% \begin{itemize} |
| 1666 |
% \item |
| 1667 |
% \begin{macro}{\adl@columns} |
| 1668 |
% \begin{macro}{\adl@ncol} |
| 1669 |
% \changes{v1.4-2-1}{1999/06/25} |
| 1670 |
% {Introduced for new column counting in preamble construction.} |
| 1671 |
% |\adl@columns| has the number of columns specified in the preamble of the |
| 1672 |
% environment. Because of a complicated reason related to the compatibility |
| 1673 |
% with \textsf{array}, we cannot count up |\adl@columns| directly but |
| 1674 |
% increment |\adl@ncol| when each column of preamble is built and move its |
| 1675 |
% value to |\adl@columns| after the preamble is constructed. |
| 1676 |
% \end{macro}\end{macro} |
| 1677 |
% |
| 1678 |
% \item |
| 1679 |
% \begin{macro}{\adl@currentcolumn} |
| 1680 |
% \begin{macro}{\adl@currentcolumnsave} |
| 1681 |
% To process |\multicolumn|, we have to know the column number where it |
| 1682 |
% appears. Thus we have a column counter |\adl@currentcolumn| which is |
| 1683 |
% |\global|-ly incremented when each column is built. Because of the |
| 1684 |
% |\global| assignment, the counter has to be saved\slash restored |
| 1685 |
% into\slash from |\adl@currentcolumnsave|. |
| 1686 |
% \end{macro}\end{macro} |
| 1687 |
% |
| 1688 |
% \item |
| 1689 |
% \begin{macro}{\adl@totalheight} |
| 1690 |
% In the real implementation, $\tau_k$ and $\beta_k$ are calculated by the |
| 1691 |
% following equations rather than those shown in \S\ref{sec:imp-ps1}. |
| 1692 |
%$$ |
| 1693 |
% H=\sum_{l=1}^N h_l,\quad |
| 1694 |
% \tau_k=H+\eta_{i-1}-\sum_{l=1}^{i-1} h_l,\quad |
| 1695 |
% \beta_k=\tau_k-\eta_{i-1}-\eta_{i'-1}-\sum_{l=i'}^i h_l. |
| 1696 |
%$$ |
| 1697 |
% |\adl@totalheight| contains $\sum_{l=1}^i h_l$ when the $i\th$ row is |
| 1698 |
% built and thus its final value is $H$. Since the data structure $R$ are |
| 1699 |
% represented by a text, we have to pay attention to the precision of its |
| 1700 |
% dimensional elements, such as $h_i$. That is, if we append $h_i$ to $R$ |
| 1701 |
% by expanding |\the\dimen|$n$ which has the height plus depth of $i\th$ |
| 1702 |
% row, $h_i$ will be an approximation of |\dimen|$n$ represented by a |
| 1703 |
% decimal fraction with |pt|. Although the error of the approximation is |
| 1704 |
% quite small and may be negligible, the error must be avoided because it is |
| 1705 |
% avoidable by simply using |\number\dimen|$n$. Therefore, $h_i$ is an |
| 1706 |
% integer and thus |\adl@totalheight| is too. |
| 1707 |
% \end{macro} |
| 1708 |
% |
| 1709 |
% \begin{macro}{\adl@totalheightsave} |
| 1710 |
% Because of the |\global| assignment to |\adl@totalheight| to pass its value |
| 1711 |
% across rows, it has to be saved\slash restored into\slash from |
| 1712 |
% |\adl@totalheightsave|. |
| 1713 |
% \end{macro} |
| 1714 |
% |
| 1715 |
% \item |
| 1716 |
% \begin{macro}{\adl@dash} |
| 1717 |
% \begin{macro}{\adl@gap} |
| 1718 |
% In order to check $e^i_j\sim e^{i'}_{j'}$, the size attributes of $d^i_j$ |
| 1719 |
% and $g^i_j$ are kept in |
| 1720 |
% the registers |\adl@dash| and |\adl@gap| when we process $e^{i'}_{j'}$. |
| 1721 |
% As explained above, $d^i_j$ and $g^i_j$ are integers and thus |\adl@dash| |
| 1722 |
% and |\adl@gap| are |\count| registers. |
| 1723 |
% \end{macro}\end{macro} |
| 1724 |
% |
| 1725 |
% \item |
| 1726 |
% \begin{macro}{\adl@cla} |
| 1727 |
% \begin{macro}{\adl@clb} |
| 1728 |
% \SpecialIndex{\@cla} |
| 1729 |
% \SpecialIndex{\@clb} |
| 1730 |
% The coding of |\cdashline| is similar to that of |\cline| in \LaTeX-2.09 |
| 1731 |
% which uses two global |\count| registers |\@cla| and |\@clb|. These |
| 1732 |
% registers are omitted from \LaTeXe{} because its |\cline| is completely |
| 1733 |
% recoded. We could adopt new coding but it requires some other macro |
| 1734 |
% definitions that \LaTeX-2.09 does not have. Thus we simply introduce new |
| 1735 |
% global counters |\adl@cla| and |\adl@clb| for |\cdashline| in order to |
| 1736 |
% make |\cdashline| work in both \LaTeX-2.09 and \LaTeXe. |
| 1737 |
% \end{macro}\end{macro} |
| 1738 |
% \end{itemize} |
| 1739 |
% |
| 1740 |
% \SpecialIndex{\@tempcnta} |
| 1741 |
% \SpecialIndex{\@tempcntb} |
| 1742 |
% We also use working |\count| registers |\@tempcnta| and |\@tempcntb|. |
| 1743 |
% |
| 1744 |
% \begin{macrocode} |
| 1745 |
\newcount\adl@columns \newcount\adl@ncol |
| 1746 |
\newcount\adl@currentcolumn \newcount\adl@currentcolumnsave |
| 1747 |
\newcount\adl@totalheight \newcount\adl@totalheightsave |
| 1748 |
\newcount\adl@dash \newcount\adl@gap |
| 1749 |
\newcount\adl@cla \newcount\adl@clb |
| 1750 |
% \end{macrocode} |
| 1751 |
% |
| 1752 |
% \begin{macro}{\adl@everyvbox} |
| 1753 |
% \changes{v1.4-2-1}{1999/06/25} |
| 1754 |
% {Introduced for a tricky modification of \cs{@array}.} |
| 1755 |
% The last register declaration is for a |\toks| register named |
| 1756 |
% |\adl@everyvbox|. In order to minimize the copy-and-modify of the codes |
| 1757 |
% in \LaTeX{} and \textsf{array}, we need to use |\everyvbox| in our own |
| 1758 |
% definition of |\@array|. The register is used to save the contents of |
| 1759 |
% |\everyvbox|. |
| 1760 |
% \end{macro} |
| 1761 |
% |
| 1762 |
% \begin{macrocode} |
| 1763 |
\newtoks\adl@everyvbox |
| 1764 |
|
| 1765 |
% \end{macrocode} |
| 1766 |
% |
| 1767 |
% \begin{macro}{\adl@org@arrayclassz} |
| 1768 |
% \changes{v1.4-2-3}{1999/06/25} |
| 1769 |
% {Introduced to restore \cs{@arrayclassz}.} |
| 1770 |
% \begin{macro}{\adl@org@tabclassz} |
| 1771 |
% \changes{v1.4-2-3}{1999/06/25} |
| 1772 |
% {Introduced to restore \cs{@tabclassz}.} |
| 1773 |
% \begin{macro}{\adl@org@classz} |
| 1774 |
% \changes{v1.4-2-3}{1999/06/25} |
| 1775 |
% {Introduced to restore \cs{@classz}.} |
| 1776 |
% \begin{macro}{\adl@org@@startpbox} |
| 1777 |
% \changes{v1.4-2-3}{1999/06/25} |
| 1778 |
% {Introduced to restore \cs{@@startpbox}.} |
| 1779 |
% \begin{macro}{\adl@org@@endpbox} |
| 1780 |
% \changes{v1.4-2-3}{1999/06/25} |
| 1781 |
% {Introduced to restore \cs{@@endpbox}.} |
| 1782 |
% \begin{macro}{\adl@org@startpbox} |
| 1783 |
% \changes{v1.75}{2018/12/26} |
| 1784 |
% {Introduced to restore \cs{@startpbox}.} |
| 1785 |
% \begin{macro}{\adl@org@endpbox} |
| 1786 |
% \changes{v1.4-2-3}{1999/06/25} |
| 1787 |
% {Introduced to restore \cs{@endpbox}.} |
| 1788 |
% \begin{macro}{\adl@org@cline} |
| 1789 |
% \changes{v1.4-2-3}{1999/06/25} |
| 1790 |
% {Introduced to restore \cs{cline}.} |
| 1791 |
% \changes{v1.4-2-6}{1999/06/25} |
| 1792 |
% {Introduced to refer original version in modified \cs{cline}.} |
| 1793 |
% The other declarative stuff consists of the sequence of |\let| to capture |
| 1794 |
% the original definitions of macros that we will modify afterword. The |
| 1795 |
% main purpose of them is to nullify the modification when dash-line |
| 1796 |
% functions are inactive, while |\adl@org@cline| is also referred to in its |
| 1797 |
% modified version. |
| 1798 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 1799 |
% \end{macro}\end{macro}\end{macro} |
| 1800 |
% |
| 1801 |
% \begin{macrocode} |
| 1802 |
\let\adl@org@arrayclassz\@arrayclassz |
| 1803 |
\let\adl@org@tabclassz\@tabclassz |
| 1804 |
\let\adl@org@classz\@classz |
| 1805 |
\let\adl@org@@startpbox\@@startpbox |
| 1806 |
\let\adl@org@@endpbox\@@endpbox |
| 1807 |
\let\adl@org@startpbox\@startpbox |
| 1808 |
\let\adl@org@endpbox\@endpbox |
| 1809 |
\let\adl@org@cline\cline |
| 1810 |
|
| 1811 |
%%^L |
| 1812 |
% \end{macrocode} |
| 1813 |
% |
| 1814 |
% |
| 1815 |
% |
| 1816 |
% \subsection{Initialization} |
| 1817 |
% \label{sec:imp-init} |
| 1818 |
% |
| 1819 |
% \begin{macro}{\adl@array} |
| 1820 |
% \changes{v1.4-2-1}{1999/06/25} |
| 1821 |
% {Introduced to save original definition of \cs{@array}.} |
| 1822 |
% \begin{macro}{\@array} |
| 1823 |
% \changes{v1.4-2-1}{1999/06/25} |
| 1824 |
% {Drastically modified to avoid copy-and-modify.} |
| 1825 |
% \begin{macro}{\adl@noalign} |
| 1826 |
% \changes{v1.7-2}{2004/5/21} |
| 1827 |
% {Introduced to fix a bug of \textsf{colortbl}.} |
| 1828 |
% |
| 1829 |
% \LaTeX's macro |\@array| is modified to save and initialize registers and |
| 1830 |
% data structures which are |\global|-ly updated in order to allow nested |
| 1831 |
% |array|\slash|tabular|. This saving and initializing are performed by |
| 1832 |
% |\adl@arrayinit| as explained below. The problem in the modification is |
| 1833 |
% that the code of |\@array| in \textsf{array} is completely different from |
| 1834 |
% that of \LaTeX{} original. |
| 1835 |
% |
| 1836 |
% The main difference is that \LaTeX{} builds |\@preamble| locally, while |
| 1837 |
% \textsf{array} does globally exploiting the fact that the lifetime of |
| 1838 |
% |\@preamble| ends before another |array|\slash|tabular| appears in a |
| 1839 |
% column. The latter implementation will work well unless the building |
| 1840 |
% process in |\@mkpream| produces something referred to after |\@preamble| |
| 1841 |
% is thrown into \TeX's {\em stomach}. In our implementation, |
| 1842 |
% unfortunately, the number of columns has to be counted in |
| 1843 |
% \break|\@mkpream| and will be referred to by |\hdashline| and the vertical |
| 1844 |
% line drawing procedure. |
| 1845 |
% |
| 1846 |
% Thus we have to change the column counting mechanism depending on whether |
| 1847 |
% or not \textsf{array} is in use. The simplest way could be to copy the codes |
| 1848 |
% of \LaTeX{} and \textsf{array} and modify them appropriately examining the |
| 1849 |
% value of |\ifadl@usingarypkg|. However this solution is vulnerable to the |
| 1850 |
% modification of the original version and thus we wish to refuse it as far |
| 1851 |
% as possible. |
| 1852 |
% |
| 1853 |
% \SpecialIndex{\everyvbox} |
| 1854 |
% \SpecialIndex{\adl@everyvbox} |
| 1855 |
% Therefore, we use a trick with |\everyvbox| in which |\adl@arrayinit| is |
| 1856 |
% temporarily included to initialize registers and locally set |
| 1857 |
% |\adl@columns| to the number of columns |\global|-ly counted by |
| 1858 |
% |\adl@ncol|. This trick works well so far because; |
| 1859 |
% |
| 1860 |
% \begin{itemize} |
| 1861 |
% \item |
| 1862 |
% the first |\vbox|, |\vtop| or |\vcenter| made by |\@array| is the vertical |
| 1863 |
% box surrounding |\halign|, and; |
| 1864 |
% |
| 1865 |
% \item |
| 1866 |
% in |\@array| of \textsf{array} the box is opened {\em after} the preamble |
| 1867 |
% is constructed; |
| 1868 |
% \end{itemize} |
| 1869 |
% |
| 1870 |
% and will hopefully work in future. |
| 1871 |
% |
| 1872 |
% \changes{v1.5-3}{2003/07/11} |
| 1873 |
% {Move \cs{adl@inactivate} to \cs{@array} from \cs{adl@arrayinit}.} |
| 1874 |
% \changes{v1.54-2}{2003/08/25} |
| 1875 |
% {Invoke \cs{adl@activate} if not \cs{ifadl@inactive}.} |
| 1876 |
% \changes{v1.7-2}{2004/5/21} |
| 1877 |
% {Make \cs{adl@noalign} \cs{let}-equal to \cs{noalign}.} |
| 1878 |
% \SpecialIndex{\arrayrulecolor} |
| 1879 |
% \SpecialIndex{\doublerulesepcolor} |
| 1880 |
% \SpecialIndex{\dashgapcolor} |
| 1881 |
% Next, if |\ifadl@inactive| is true, |\adl@inactivate| is invoked to |
| 1882 |
% inactivate dash-line functions. Otherwise, |\adl@activate| is invoked to |
| 1883 |
% activate them because an inactivated |array|\slash|tabular| |
| 1884 |
% may have active children in it. Finally, |\adl@noalign| is made |
| 1885 |
% |\let|-equal to |\noalign| so that |\arrayrulecolor|, |
| 1886 |
% |\doublerulesepcolor| and |\dashgapcolor| are expanded with |\noalign| in |
| 1887 |
% the environment. |
| 1888 |
% \end{macro}\end{macro}\end{macro} |
| 1889 |
% |
| 1890 |
% \begin{macro}{\@@array} |
| 1891 |
% \changes{v1.4-2-1}{1999/06/25} |
| 1892 |
% {Introduced because \textsf{array} uses it.} |
| 1893 |
% \changes{v1.74}{2018/09/26} |
| 1894 |
% {Make \cs{@@array} \cs{let}-equal to \cs{@array} only when it is |
| 1895 |
% made so by \textsf{array} and the equality is kept.} |
| 1896 |
% |
| 1897 |
% \SpecialIndex{\@tabarray} |
| 1898 |
% Another stuff for the compatibility with \textsf{array} is to |\let| a |
| 1899 |
% control sequence |\@@array| be equal to |\@array| if it is made so by |
| 1900 |
% \textsf{array} and the equality is kept. That is, with \textsf{array} |
| 1901 |
% |\@@array| is invoked by |\@tabarray| and it is |\let|-equal to |\@array| |
| 1902 |
% by default, while\break |\@@array| can be made different from |\@array| by |
| 1903 |
% some other package, e.g., \textsf{delarray}, to do some special operations |
| 1904 |
% defined in the package. Therefore by the conditional equalization with |
| 1905 |
% |\ifx|, our own |\@array| is directly invoked through |\@@array| if the |
| 1906 |
% default equality is kept, while otherwise the package-dependent definition |
| 1907 |
% of |\@@array| is respected. |
| 1908 |
% \end{macro} |
| 1909 |
% |
| 1910 |
% \begin{macrocode} |
| 1911 |
|
| 1912 |
%% Initialization |
| 1913 |
|
| 1914 |
\let\adl@array\@array |
| 1915 |
\def\@array{\adl@everyvbox\everyvbox |
| 1916 |
\everyvbox{\adl@arrayinit \the\adl@everyvbox \everyvbox\adl@everyvbox}% |
| 1917 |
\ifadl@inactive \adl@inactivate \else \adl@activate \fi |
| 1918 |
\let\adl@noalign\noalign |
| 1919 |
\adl@array} |
| 1920 |
\ifx\@@array\adl@array \let\@@array\@array \fi |
| 1921 |
|
| 1922 |
% \end{macrocode} |
| 1923 |
% |
| 1924 |
% \begin{macro}{\adl@arrayinit} |
| 1925 |
% \changes{v1.4-2-9}{1999/06/25} |
| 1926 |
% {The bug of saving \cs{adl@colsR} is fixed.} |
| 1927 |
% \changes{v1.5-1}{2000/07/12} |
| 1928 |
% {Use new macro \cs{adl@arraysave} to save registers/structures.} |
| 1929 |
% \begin{macro}{\adl@arraysave} |
| 1930 |
% \changes{v1.5-1}{2000/07/12} |
| 1931 |
% {Introduced to use in modified \cs{CC@} of \textsf{colortab}.} |
| 1932 |
% \SpecialIndex{\adl@height} |
| 1933 |
% \SpecialIndex{\adl@depth} |
| 1934 |
% \SpecialIndex{\adl@currentcolumn} |
| 1935 |
% \SpecialIndex{\adl@totalheight} |
| 1936 |
% |
| 1937 |
% As described in \S\ref{sec:imp-decl}, registers updated |\global|-ly, |
| 1938 |
% which are |\adl@height|, |\adl@depth|, |\adl@currentcolumn| and |
| 1939 |
% |\adl@totalheight|, are saved in |\adl@arrayinit| by calling |
| 1940 |
% |\adl@arraysave|, and also given initial values. The macro also saves the |
| 1941 |
% following data structures and initializes them to empty lists. |
| 1942 |
% \end{macro} |
| 1943 |
% |
| 1944 |
% \begin{macro}{\adl@rowsL} |
| 1945 |
% \begin{macro}{\adl@rowsR} |
| 1946 |
% \begin{macro}{\adl@rowsLsave} |
| 1947 |
% \begin{macro}{\adl@rowsRsave} |
| 1948 |
% \begin{macro}{\adl@colsL} |
| 1949 |
% \begin{macro}{\adl@colsR} |
| 1950 |
% \begin{macro}{\adl@colsLsave} |
| 1951 |
% \begin{macro}{\adl@colsRsave} |
| 1952 |
% \begin{itemize} |
| 1953 |
% \item |
| 1954 |
% In the real implementation, the data structure $R$ is split into two |
| 1955 |
% lists; |
| 1956 |
% |
| 1957 |
% \begin{eqnarray*} |
| 1958 |
% \cs{adl@rowsL}&=&R^L=\langle\langle C^L_1,h_1\rangle,\ldots\rangle\\ |
| 1959 |
% \cs{adl@rowsR}&=&R^R=\langle\langle C^R_1,h_1\rangle,\ldots\rangle |
| 1960 |
% \end{eqnarray*} |
| 1961 |
% |
| 1962 |
% and they are saved into |\adl@rowsLsave| and |\adl@rowsRsave|. |
| 1963 |
% |
| 1964 |
% \item |
| 1965 |
% When the $i\th$ row is building, $C^L_i$ and $C^R_i$ are constructed in |
| 1966 |
% the macros |\adl@colsL| and |\adl@colsR|. They are saved |
| 1967 |
% into |\adl@colsLsave| and |\adl@colsRsave|. |
| 1968 |
% \end{itemize} |
| 1969 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 1970 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 1971 |
% |
| 1972 |
% \begin{macro}{\adl@connect} |
| 1973 |
% \begin{macro}{\adl@discard} |
| 1974 |
% \changes{v1.6}{2003/8/25} |
| 1975 |
% {Add initializetion of \cs{adl@discard}.} |
| 1976 |
% \SpecialIndex{\@elt} |
| 1977 |
% \SpecialOptIndex{longtable}{environment} |
| 1978 |
% |
| 1979 |
% In the real implementation, $e^i_j$ is represented by a control sequence |
| 1980 |
% |\@elt|, and ${\it connect}(i)$ by |\adl@connect|. They are made |
| 1981 |
% |\let|-equal to |\relax| to keep them from expansion during $R$ is |
| 1982 |
% constructed. In |longtable| environment, ${\it connect}(i)$ for negative |
| 1983 |
% vertical space inserted by |\\[|\meta{h}|]| or a horizontal line has |
| 1984 |
% another representation |\adl@discard| to indicate it corresponds to a |
| 1985 |
% discardable item of page breaking. Since this representation, however, is |
| 1986 |
% nonsense in usural |array|\slash|tabular| even if they are included in |
| 1987 |
% |\longtable|, we define |\adl@discard| as |\adl@connect| so that it |
| 1988 |
% transforms itself into |\adl@connect| when it is added to |
| 1989 |
% |\adl@rowsL|\slash|R| by |\xdef|. Note that |\adl@discard| is made |
| 1990 |
% |\let|-equal to |\relax| to inhibit the transformation at the beginning of |
| 1991 |
% |longtable| environment. |
| 1992 |
% \end{macro}\end{macro} |
| 1993 |
% |
| 1994 |
% \changes{v1.4-2-1}{1999/06/25} |
| 1995 |
% {Modified for new column counting in preamble construction.} |
| 1996 |
% |
| 1997 |
% Then, we set to |\adl@columns| to the value of |\adl@ncol| {\em locally}. |
| 1998 |
% As explained above, this has an effect with \textsf{array} because |
| 1999 |
% |\adl@arrayinit| is called {\em after} the preamble is generated. Without |
| 2000 |
% \textsf{array}, on the other hand, this assignment has no effect but safe |
| 2001 |
% because it is included in a group of |\vbox| etc. |
| 2002 |
% |
| 2003 |
% \changes{v1.4-2-3}{1999/06/25} |
| 2004 |
% {Modified to call \cs{adl@inactivate}.} |
| 2005 |
% \changes{v1.5-3}{2003/07/11} |
| 2006 |
% {Move \cs{adl@inactivate} from \cs{adl@arrayinit} to \cs{@array}.} |
| 2007 |
% |
| 2008 |
% \end{macro} |
| 2009 |
% \SpecialIndex{\adl@height} |
| 2010 |
% \SpecialIndex{\adl@depth} |
| 2011 |
% \SpecialIndex{\adl@currentcolumn} |
| 2012 |
% \SpecialIndex{\adl@totalheight} |
| 2013 |
% \SpecialIndex{\adl@heightsave} |
| 2014 |
% \SpecialIndex{\adl@depthsave} |
| 2015 |
% \SpecialIndex{\adl@currentcolumnsave} |
| 2016 |
% \SpecialIndex{\adl@totalheightsave} |
| 2017 |
% |
| 2018 |
% \begin{macrocode} |
| 2019 |
\def\adl@arrayinit{% |
| 2020 |
\adl@arraysave |
| 2021 |
\global\adl@height\z@ \global\adl@depth\z@ |
| 2022 |
\global\adl@currentcolumn\@ne \global\adl@totalheight\z@ |
| 2023 |
\gdef\adl@rowsL{}\gdef\adl@rowsR{}\gdef\adl@colsL{}\gdef\adl@colsR{}% |
| 2024 |
\let\@elt\relax \let\adl@connect\relax \def\adl@discard{\adl@connect}% |
| 2025 |
\adl@columns\adl@ncol} |
| 2026 |
\def\adl@arraysave{% |
| 2027 |
\adl@heightsave\adl@height |
| 2028 |
\adl@depthsave\adl@depth |
| 2029 |
\adl@currentcolumnsave\adl@currentcolumn |
| 2030 |
\adl@totalheightsave\adl@totalheight |
| 2031 |
\let\adl@rowsLsave\adl@rowsL |
| 2032 |
\let\adl@rowsRsave\adl@rowsR |
| 2033 |
\let\adl@colsLsave\adl@colsL |
| 2034 |
\let\adl@colsRsave\adl@colsR} |
| 2035 |
|
| 2036 |
% \end{macrocode} |
| 2037 |
% |
| 2038 |
% \begin{macro}{\adl@inactivate} |
| 2039 |
% \changes{v1.4-2-3}{1999/06/25} |
| 2040 |
% {Introduced to inactivate \cs{@arrayclassz} etc.} |
| 2041 |
% \changes{v1.5-3}{2003/07/11} |
| 2042 |
% {Change \cs{adl@inactivate} caller to \cs{@array}.} |
| 2043 |
% \changes{v1.7-1}{2004/5/21} |
| 2044 |
% {Remove \cs{cline} because our own version is needed for null-wide.} |
| 2045 |
% If |\ADLinactivate| has effect and thus |\ifadl@inactive| is true, the |
| 2046 |
% macro |\adl@inactivate| is called from |\@array|\footnote{ |
| 2047 |
% |
| 2048 |
% Before v1.53, \cs{adl@inactivate} was called from \cs{adl@arrayinit} and |
| 2049 |
% thus invokded {\em after} the preamble of \textsf{array} is built. This |
| 2050 |
% was incorrect of course and made inactive version of \texttt{p}, |
| 2051 |
% \texttt{m} and \texttt{b} produce nothing.}. |
| 2052 |
% |
| 2053 |
% This |\let|-s the following control sequences be equal to their |
| 2054 |
% counterparts in \LaTeX{} and/or \textsf{array} package. |
| 2055 |
% |
| 2056 |
% \changes{v1.54-2}{2003/08/25} |
| 2057 |
% {Add \cs{adl@argcr} to inactivation.} |
| 2058 |
% \changes{v1.75}{2018/12/26} |
| 2059 |
% {Add \cs{@startpbox} to inactivation.} |
| 2060 |
% |
| 2061 |
% \begin{itemize}\item[] |
| 2062 |
% \SpecialIndex{\@arrayclassz} |
| 2063 |
% \SpecialIndex{\@tabclassz} |
| 2064 |
% \SpecialIndex{\@classz} |
| 2065 |
% \SpecialIndex{\@@startpbox} |
| 2066 |
% \SpecialIndex{\@@endpbox} |
| 2067 |
% \SpecialIndex{\@startpbox} |
| 2068 |
% \SpecialIndex{\@endpbox} |
| 2069 |
% \SpecialIndex{\adl@cr} |
| 2070 |
% \SpecialIndex{\adl@argcr} |
| 2071 |
% \SpecialIndex{\adl@endarray} |
| 2072 |
% |\@arrayclassz|\quad |
| 2073 |
% |\@tabclassz|\quad |
| 2074 |
% |\@classz|\quad |
| 2075 |
% |\@@startpbox|\quad |
| 2076 |
% |\@@endpbox|\\ |
| 2077 |
% |\@startpbox|\quad |
| 2078 |
% |\@endpbox|\quad |
| 2079 |
% |\adl@cr|\quad |
| 2080 |
% |\adl@argcr|\quad |
| 2081 |
% |\adl@endarray| |
| 2082 |
% \end{itemize} |
| 2083 |
% |
| 2084 |
% Note that |\@classz| has to be |\let|-equal to |\adl@org@classz| only if |
| 2085 |
% \textsf{array} is in use, because \LaTeX{} does not define |\@classz| but |
| 2086 |
% refers to it which is either |\@arrayclassz| or |\@tabclassz|. Yet |
| 2087 |
% another remark is that we have to conceal |\cr| for |
| 2088 |
% |\adl@cr|\slash|\adl@argcr| and |\crcr| for |\adl@endarray| by bracing |
| 2089 |
% them from \TeX's |\halign| mechanism that searches them when an |
| 2090 |
% |array|\slash|tabular| has an nested |array|\slash|tabular|. This could |
| 2091 |
% be done by a tricky |\let|-assignment such as; |
| 2092 |
% |
| 2093 |
% \begin{quote} |
| 2094 |
% |\iffalse{\let\adl@cr\cr \iffalse}\fi| |
| 2095 |
% \end{quote} |
| 2096 |
% |
| 2097 |
% but we simply use |\def| instead of |\let| because of clarity. |
| 2098 |
% |
| 2099 |
% We also |\let| the following be {\it no-operation} or their inactive |
| 2100 |
% versions. |
| 2101 |
% |
| 2102 |
% \begin{itemize}\item[] |
| 2103 |
% \SpecialIndex{\adl@hline} |
| 2104 |
% \SpecialIndex{\adl@ihdashline} |
| 2105 |
% \SpecialIndex{\adl@cdline} |
| 2106 |
% \SpecialIndex{\adl@@vlineL} |
| 2107 |
% \SpecialIndex{\adl@@vlineR} |
| 2108 |
% \SpecialIndex{\adl@vlineL} |
| 2109 |
% \SpecialIndex{\adl@vlineR} |
| 2110 |
% |\adl@hline|\quad |
| 2111 |
% |\adl@ihdashline|\quad |
| 2112 |
% |\adl@cdline|\quad |
| 2113 |
% |\adl@@vlineL|\quad |
| 2114 |
% |\adl@@vlineR|\\ |
| 2115 |
% |\adl@vlineL|\quad |
| 2116 |
% |\adl@vlineR| |
| 2117 |
% \end{itemize} |
| 2118 |
% Note that we have to inactivate both |\adl@@vlineL| and |\adl@vlineL|, |
| 2119 |
% because the latter is referred to when \textsf{array} is in use while the |
| 2120 |
% former is done otherwise. Their |R| relatives are also inactivated by |
| 2121 |
% the same reason. |
| 2122 |
% \end{macro} |
| 2123 |
% |
| 2124 |
% \SpecialIndex{\@arrayclassz} |
| 2125 |
% \SpecialIndex{\@tabclassz} |
| 2126 |
% \SpecialIndex{\@classz} |
| 2127 |
% \SpecialIndex{\@@startpbox} |
| 2128 |
% \SpecialIndex{\@@endpbox} |
| 2129 |
% \SpecialIndex{\@startpbox} |
| 2130 |
% \SpecialIndex{\@endpbox} |
| 2131 |
% \SpecialIndex{\adl@cr} |
| 2132 |
% \SpecialIndex{\adl@argcr} |
| 2133 |
% \SpecialIndex{\adl@endarray} |
| 2134 |
% \SpecialIndex{\adl@hline} |
| 2135 |
% \SpecialIndex{\adl@ihdashline} |
| 2136 |
% \SpecialIndex{\adl@cdline} |
| 2137 |
% \SpecialIndex{\adl@@vlineL} |
| 2138 |
% \SpecialIndex{\adl@@vlineR} |
| 2139 |
% \SpecialIndex{\adl@vlineL} |
| 2140 |
% \SpecialIndex{\adl@vlineR} |
| 2141 |
% \SpecialIndex{\adl@org@arrayclassz} |
| 2142 |
% \SpecialIndex{\adl@org@tabclassz} |
| 2143 |
% \SpecialIndex{\adl@org@classz} |
| 2144 |
% \SpecialIndex{\adl@org@@startpbox} |
| 2145 |
% \SpecialIndex{\adl@org@@endpbox} |
| 2146 |
% \SpecialIndex{\adl@org@startpbox} |
| 2147 |
% \SpecialIndex{\adl@org@endpbox} |
| 2148 |
% \SpecialIndex{\adl@cr} |
| 2149 |
% \SpecialIndex{\adl@argcr} |
| 2150 |
% \SpecialIndex{\adl@org@cline} |
| 2151 |
% \SpecialIndex{\adl@inactivehdl} |
| 2152 |
% \SpecialIndex{\adl@inactivecdl} |
| 2153 |
% \SpecialIndex{\adl@inactivevl} |
| 2154 |
% \begin{macrocode} |
| 2155 |
\def\adl@inactivate{% |
| 2156 |
\let\@arrayclassz\adl@org@arrayclassz |
| 2157 |
\let\@tabclassz\adl@org@tabclassz |
| 2158 |
\ifadl@usingarypkg \let\@classz\adl@org@classz \fi |
| 2159 |
\let\@@startpbox\adl@org@@startpbox |
| 2160 |
\let\@@endpbox\adl@org@@endpbox |
| 2161 |
\let\@startpbox\adl@org@startpbox |
| 2162 |
\let\@endpbox\adl@org@endpbox |
| 2163 |
\def\adl@cr{\cr}% |
| 2164 |
\def\adl@argcr##1{\cr}% |
| 2165 |
\def\adl@endarray{\crcr}% |
| 2166 |
\let\adl@hline\@gobbletwo |
| 2167 |
\let\adl@ihdashline\adl@inactivehdl |
| 2168 |
\let\adl@cdline\adl@inactivecdl |
| 2169 |
\let\adl@@vlineL\adl@inactivevl |
| 2170 |
\let\adl@@vlineR\adl@inactivevl |
| 2171 |
\let\adl@vlineL\adl@inactivevl |
| 2172 |
\let\adl@vlineR\adl@inactivevl} |
| 2173 |
% \end{macrocode} |
| 2174 |
% |
| 2175 |
% \begin{macro}{\adl@activate} |
| 2176 |
% \changes{v1.54-2}{2003/08/25} |
| 2177 |
% {Introduced to activate \cs{@arrayclassz} etc.\ again.} |
| 2178 |
% \changes{v1.75}{2018/12/26} |
| 2179 |
% {Add \cs{@startpbox} to activation.} |
| 2180 |
% |
| 2181 |
% On the other hand, if |\ifadl@inactive| is false, the macro |\adl@activate| |
| 2182 |
% is called from |\@array| to make inactivated macros active again in order |
| 2183 |
% to cope with the case in which an inactive \textsf{array}\slash |
| 2184 |
% \textsf{tabular} has active children in it\footnote{ |
| 2185 |
% |
| 2186 |
% Before v1.54, an active \textsf{array}\slash\textsf{tabular} in an |
| 2187 |
% inactive parent was not activated.}. |
| 2188 |
% |
| 2189 |
% To do that, |\adl@activate| makes |\@arrayclassz| etc.\ |\let|-equal to |
| 2190 |
% their active version |\adl@act@arrayclassz| etc.\ which will be defined |
| 2191 |
% (|\let|-equal to) as our own |\@arrayclassz| etc.\ in \S\ref{sec:imp-sh}. |
| 2192 |
% \end{macro} |
| 2193 |
% |
| 2194 |
% \SpecialIndex{\@arrayclassz} |
| 2195 |
% \SpecialIndex{\@tabclassz} |
| 2196 |
% \SpecialIndex{\@classz} |
| 2197 |
% \SpecialIndex{\@@startpbox} |
| 2198 |
% \SpecialIndex{\@@endpbox} |
| 2199 |
% \SpecialIndex{\@startpbox} |
| 2200 |
% \SpecialIndex{\@endpbox} |
| 2201 |
% \SpecialIndex{\adl@cr} |
| 2202 |
% \SpecialIndex{\adl@argcr} |
| 2203 |
% \SpecialIndex{\adl@endarray} |
| 2204 |
% \SpecialIndex{\adl@hline} |
| 2205 |
% \SpecialIndex{\adl@ihdashline} |
| 2206 |
% \SpecialIndex{\adl@cdline} |
| 2207 |
% \SpecialIndex{\adl@@vlineL} |
| 2208 |
% \SpecialIndex{\adl@@vlineR} |
| 2209 |
% \SpecialIndex{\adl@vlineL} |
| 2210 |
% \SpecialIndex{\adl@vlineR} |
| 2211 |
% \SpecialIndex{\adl@act@arrayclassz} |
| 2212 |
% \SpecialIndex{\adl@act@tabclassz} |
| 2213 |
% \SpecialIndex{\adl@act@classz} |
| 2214 |
% \SpecialIndex{\adl@act@@startpbox} |
| 2215 |
% \SpecialIndex{\adl@act@@endpbox} |
| 2216 |
% \SpecialIndex{\adl@act@startpbox} |
| 2217 |
% \SpecialIndex{\adl@act@endpbox} |
| 2218 |
% \SpecialIndex{\adl@act@cr} |
| 2219 |
% \SpecialIndex{\adl@act@argcr} |
| 2220 |
% \SpecialIndex{\adl@act@cline} |
| 2221 |
% \SpecialIndex{\adl@act@endarray} |
| 2222 |
% \SpecialIndex{\adl@act@hline} |
| 2223 |
% \SpecialIndex{\adl@act@ihdashline} |
| 2224 |
% \SpecialIndex{\adl@act@cdline} |
| 2225 |
% \SpecialIndex{\adl@act@@vlineL} |
| 2226 |
% \SpecialIndex{\adl@act@@vlineR} |
| 2227 |
% \begin{macrocode} |
| 2228 |
\def\adl@activate{% |
| 2229 |
\let\@arrayclassz\adl@act@arrayclassz |
| 2230 |
\let\@tabclassz\adl@act@tabclassz |
| 2231 |
\ifadl@usingarypkg \let\@classz\adl@act@classz \fi |
| 2232 |
\let\@@startpbox\adl@act@@startpbox |
| 2233 |
\let\@@endpbox\adl@act@@endpbox |
| 2234 |
\let\@startpbox\adl@act@startpbox |
| 2235 |
\let\@endpbox\adl@act@endpbox |
| 2236 |
\let\adl@cr\adl@act@cr |
| 2237 |
\let\adl@argcr\adl@act@argcr |
| 2238 |
\let\adl@endarray\adl@act@endarray |
| 2239 |
\let\adl@hline\adl@act@hline |
| 2240 |
\let\adl@ihdashline\adl@act@ihdashline |
| 2241 |
\let\adl@cdline\adl@act@cdline |
| 2242 |
\let\adl@@vlineL\adl@act@@vlineL |
| 2243 |
\let\adl@@vlineR\adl@act@@vlineR |
| 2244 |
\let\adl@vlineL\adl@act@@vlineL |
| 2245 |
\let\adl@vlineR\adl@act@@vlineR} |
| 2246 |
|
| 2247 |
%%^L |
| 2248 |
% \end{macrocode} |
| 2249 |
% |
| 2250 |
% \changes{v1.6}{2003/8/25} |
| 2251 |
% {Add a summary of activation/inactivation.} |
| 2252 |
% The summary of the activation and inactivation is shown in |
| 2253 |
% Table~\ref{tab:act}. |
| 2254 |
% |
| 2255 |
% |
| 2256 |
% |
| 2257 |
% \begin{table} |
| 2258 |
% \catcode`\|12 |
| 2259 |
% \caption{Active and Inactive Operations}\label{tab:act} |
| 2260 |
% \def\!{\texttt{\char`\\\char`\\}} |
| 2261 |
% \centerline{\begin{tabular}[t]{|l||l|l|}\hline |
| 2262 |
% command&active&inactive\\\hline\hline |
| 2263 |
% \tt l c r&&\\ |
| 2264 |
% \qquad with \textsf{array}& \cs{adl@act@classz}& |
| 2265 |
% \cs{adl@org@classz}\\ |
| 2266 |
% \qquad without \textsf{array}&\cs{adl@act@tabclassz}& |
| 2267 |
% \cs{adl@org@tabclassz}\\ |
| 2268 |
% & \cs{adl@act@arrayclassz}& |
| 2269 |
% \cs{adl@org@arrayclassz}\\\hline |
| 2270 |
% {\tt p m b} (open)&&\\ |
| 2271 |
% \qquad with \textsf{array}& \cs{adl@act@classz}& |
| 2272 |
% \cs{adl@org@classz}\\ |
| 2273 |
% \qquad without \textsf{array}&\cs{adl@act@@startpbox}& |
| 2274 |
% \cs{adl@org@@startpbox}\\\hline |
| 2275 |
% {\tt p m b} (close)& \cs{adl@act@@endpbox}& |
| 2276 |
% \cs{adl@org@@endpbox}\\\hline |
| 2277 |
% \tt \char`\|/:/;& \cs{adl@act@@vlineL/R}& |
| 2278 |
% \cs{adl@inactivevl}\\\hline |
| 2279 |
% \!& $\to$\cs{adl@act@(arg)cr}& |
| 2280 |
% $\to$\cs{cr}\\\hline |
| 2281 |
% \cs{hline}& $\to$\cs{adl@act@hline}& |
| 2282 |
% $\to$\cs{@gobbletwo}\\\hline |
| 2283 |
% \cs{hdashline}& $\to$\cs{adl@act@ihdashline}& |
| 2284 |
% $\to$\cs{adl@inactivehdl}\\\hline |
| 2285 |
% \cs{cdashline}& $\to$\cs{adl@act@cdline}& |
| 2286 |
% $\to$\cs{adl@inactivecdl}\\\hline |
| 2287 |
% \end{tabular}} |
| 2288 |
% \end{table} |
| 2289 |
% |
| 2290 |
% |
| 2291 |
% |
| 2292 |
% \subsection{Making Preamble} |
| 2293 |
% \label{sec:imp-pream} |
| 2294 |
% |
| 2295 |
% Each preamble character is converted to a part of |\halign|'s preamble as |
| 2296 |
% follows. |
| 2297 |
% |
| 2298 |
% \begin{itemize} |
| 2299 |
% \item |
| 2300 |
% \begin{macro}{\adl@colhtdp} |
| 2301 |
% \changes{v1.5-2}{2002/06/26} |
| 2302 |
% {The pseudo-formal description of $\langle\hbox{\it put-lrc}\rangle$ |
| 2303 |
% is modified.} |
| 2304 |
% \SpecialIndex{\adl@box} |
| 2305 |
% \SpecialIndex{\adl@height} |
| 2306 |
% \SpecialIndex{\adl@depth} |
| 2307 |
% `|l|', `|r|' and `|c|' are converted to the following \meta{lrc}. |
| 2308 |
% |
| 2309 |
% \begingroup \catcode`\|12 |
| 2310 |
% \begin{eqnarray*} |
| 2311 |
% \meta{lrc}&::=& |
| 2312 |
% [\cs{hfil}]\meta{put-lrc}[\cs{hfil}]\\ |
| 2313 |
% \meta{put-lrc}&::=& |
| 2314 |
% \cs{setbox}\cs{adl@box}\cs{hbox}\Meta{lrc-contents}\\ |
| 2315 |
% && \cs{adl@colhtdp }\cs{unhbox}\cs{adl@box}\\ |
| 2316 |
% \meta{lrc-contents}&::=& |
| 2317 |
% \hbox{\texttt{\$\cs{relax}\#\$}}\ |\\ |
| 2318 |
% && \hbox{\texttt{\#\cs{unskip}}}\\ |
| 2319 |
% \end{eqnarray*} |
| 2320 |
% \endgroup |
| 2321 |
% |
| 2322 |
% That is, the content of a column is at first packed into the |\box| |
| 2323 |
% register |\adl@box|, then its height and depth are compared to |
| 2324 |
% |\adl@height| and |\adl@depth| by the macro |\adl@colhtdp|, and finally |
| 2325 |
% the box is put with leading and/or trailing |\hfil|. |
| 2326 |
% \end{macro} |
| 2327 |
% |
| 2328 |
% \item |
| 2329 |
% \begin{macro}{\adl@vlineL} |
| 2330 |
% \begin{macro}{\adl@vlineR} |
| 2331 |
% \def\G{{\mit\Gamma}} |
| 2332 |
% `\verb!|!', `|:|' and |;{|\meta{dash}|/|\meta{gap}|}| are converted to the |
| 2333 |
% following \meta{vline}. |
| 2334 |
% |
| 2335 |
% \begingroup \catcode`\|12 |
| 2336 |
% \begin{eqnarray*} |
| 2337 |
% \meta{vline}&::=& |
| 2338 |
% [\cs{hskip}\cs{doublerulesep}]\meta{vline-LR}\\ |
| 2339 |
% \meta{vline-LR}&::=& |
| 2340 |
% \cs{adl@vlineL}\Meta{$\G_d$}\Meta{$\G_g$}\Meta{c} |
| 2341 |
% \hbox{{\tt\char`\{}\meta{d}/\meta{g}{\tt\char`\}}}\ |\\ |
| 2342 |
% && \cs{adl@vlineR}\Meta{$\G_d$}\Meta{$\G_g$}\Meta{c} |
| 2343 |
% \hbox{{\tt\char`\{}\meta{d}/\meta{g}{\tt\char`\}}}\\ |
| 2344 |
% \meta{d}&::=& |
| 2345 |
% 0\ |&\hbox to.3\textwidth{\ldots\ for `\texttt{|}'\hfil}\cr |
| 2346 |
% && \cs{dashlinedash}\ |& |
| 2347 |
% \hbox to.3\textwidth{\ldots\ for `\texttt{:}'\hfil}\cr |
| 2348 |
% && \meta{dash}& |
| 2349 |
% \hbox to.3\textwidth{\ldots\ for `\texttt{;}'\hfil}\cr |
| 2350 |
% \meta{g}&::=& |
| 2351 |
% 0\ |&\hbox to.3\textwidth{\ldots\ for `\texttt{|}'\hfil}\cr |
| 2352 |
% && \cs{dashlinegap}\ |& |
| 2353 |
% \hbox to.3\textwidth{\ldots\ for `\texttt{:}'\hfil}\cr |
| 2354 |
% && \meta{gap}& |
| 2355 |
% \hbox to.3\textwidth{\ldots\ for `\texttt{;}'\hfil}\cr |
| 2356 |
% \end{eqnarray*} |
| 2357 |
% \endgroup |
| 2358 |
% |
| 2359 |
% \SpecialIndex{\CT@arc@} |
| 2360 |
% \SpecialIndex{\adl@dashgapcolor} |
| 2361 |
% Note that \meta{c} is the column number (leftmost is 1) where the |
| 2362 |
% character appears, and \meta{$\G_d$} and \meta{$\G_g$} is the |
| 2363 |
% color of dashs and gaps specified in |\CT@arc@| and |\adl@dashgapcolor|. |
| 2364 |
% \end{macro}\end{macro} |
| 2365 |
% \end{itemize} |
| 2366 |
% |
| 2367 |
% \SpecialIndex{\adl@currentcolumn} |
| 2368 |
% Additionally, each column except for the last one has; |
| 2369 |
% |
| 2370 |
% \begin{quote} |
| 2371 |
% |\global\advance\adl@currentcolumn\@ne| |
| 2372 |
% \end{quote} |
| 2373 |
% |
| 2374 |
% just before |&| to increment |\adl@currentcolumn|. Other features, such |
| 2375 |
% as inserting spaces of |\arraycolsep|\slash|\tabcolsep|, are as same as |
| 2376 |
% original scheme. This means that |@|\Meta{text} and |!|\Meta{text} of |
| 2377 |
% \textsf{array} are {\em not} handled specially although it could interfere |
| 2378 |
% with drawing vertical lines. Therefore, we have the problem 1 shown in |
| 2379 |
% \S\ref{sec:prob}, which is very hard to solve. Note that the measurement |
| 2380 |
% of the column of `|p|' of \LaTeX{} original is done by (modified) |
| 2381 |
% |\@@startpbox| and |\@@endpbox| and thus the preamble for `|p|' is not |
| 2382 |
% modified. In the case with \textsf{array}, however, the preambles for |
| 2383 |
% `|p|' and its relatives `|m|' and `|b|' are modified to set |\adl@box| to |
| 2384 |
% the box for them. |
| 2385 |
% |
| 2386 |
% \begin{macro}{\adl@mkpream} |
| 2387 |
% \begin{macro}{\@mkpream} |
| 2388 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2389 |
% {Modified for new column counting and control sequence redefinition.} |
| 2390 |
% \changes{v1.71}{2004/08/31} |
| 2391 |
% {Modified to nullify \cs{adl@startmbox} and \cs{adl@endmbox} for |
| 2392 |
% \textsf{array's} \texttt{m}-columns.} |
| 2393 |
% \SpecialIndex{\adl@colhtdp} |
| 2394 |
% \SpecialIndex{\adl@vlineL} |
| 2395 |
% \SpecialIndex{\adl@vlineR} |
| 2396 |
% \SpecialIndex{\adl@startmbox} |
| 2397 |
% \SpecialIndex{\adl@endmbox} |
| 2398 |
% \SpecialIndex{\adl@preaminit} |
| 2399 |
% \SpecialIndex{\afterassignment} |
| 2400 |
% |
| 2401 |
% To make the preamble shown above, |\@mkpream| is modified to |\let| |
| 2402 |
% control sequences |\adl@colhtpd|, |\adl@vlineL| and |\adl@vlineR| be |
| 2403 |
% |\relax| in order to keep them from being expanded by |\edef|\slash |
| 2404 |
% |\xdef| for the preamble construction. The control sequences |
| 2405 |
% |\adl@startmbox| and |\adl@endmbox| for \texttt{m}-columns of |
| 2406 |
% \textsf{array} are also made |\let|-equal to |\relax|. |
| 2407 |
% |
| 2408 |
% Giving them their own definition is done by |\adl@preaminit| that is |
| 2409 |
% called using |\afterassignment| after |\@preamble| is made by |
| 2410 |
% |\adl@mkpream|, the original version of |\@mkpream|. If \textsf{array} is |
| 2411 |
% not in use, |\@mkpream| is followed by an |\edef| of |\@preamble| to add |
| 2412 |
% |\ialign| etc.\ and thus |\adl@preaminit| is properly called {\em after} |
| 2413 |
% this final {\em assignment} to make |\@preamble|. |
| 2414 |
% |
| 2415 |
% With \textsf{array}, on the other hand, calling |\adl@preaminit| is safe |
| 2416 |
% because |\@mkpream| is followed by |\xdef| for |\@preamble| too, but has |
| 2417 |
% no effect because it is in the group for |\@mkpream|. This grouping, |
| 2418 |
% however, gives us an easier way to give those control sequences their own |
| 2419 |
% definition. That is, we simply initiate them with the definitions that |
| 2420 |
% will be regained when the group is closed. |
| 2421 |
% |
| 2422 |
% \SpecialIndex{\adl@ncol} |
| 2423 |
% \SpecialIndex{\adl@columns} |
| 2424 |
% \SpecialIndex{\ifadl@leftrule} |
| 2425 |
% The modified |\@mkpream| also initializes |\adl@ncol| and |
| 2426 |
% |\ifadl@leftrule|, and set |\adl@columns| to the value of |\adl@ncol| |
| 2427 |
% locally after the preamble is made. This has an effect in the case |
| 2428 |
% without \textsf{array} because the body of |array|\slash|tabular| is in |
| 2429 |
% the same grouping context of |\@mkpream|. With \textsf{array}, on the |
| 2430 |
% other hand, this assignment has no effect but safe because it is included |
| 2431 |
% in a group of |\@mkpream|'s own. |
| 2432 |
% \end{macro}\end{macro} |
| 2433 |
% |
| 2434 |
% \begin{macrocode} |
| 2435 |
|
| 2436 |
%% Making Preamble |
| 2437 |
|
| 2438 |
\let\adl@mkpream\@mkpream |
| 2439 |
\def\@mkpream#1{\let\adl@colhtdp\relax |
| 2440 |
\let\adl@vlineL\relax \let\adl@vlineR\relax |
| 2441 |
\let\adl@startmbox\relax \let\adl@endmbox\relax |
| 2442 |
\global\adl@ncol\@ne \adl@leftruletrue |
| 2443 |
\adl@mkpream{#1}\adl@columns\adl@ncol \afterassignment\adl@preaminit} |
| 2444 |
|
| 2445 |
% \end{macrocode} |
| 2446 |
% |
| 2447 |
% \begin{macro}{\@addamp} |
| 2448 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2449 |
% {Modified for new column counting in preamble construction.} |
| 2450 |
% \SpecialIndex{\adl@currentcolumn} |
| 2451 |
% \SpecialIndex{\adl@ncol} |
| 2452 |
% |
| 2453 |
% The macro |\@addamp| is also modified to add the code for incrementing the |
| 2454 |
% counter |\adl@currentcolumn| to |\@preamble| with |&|. The counter |
| 2455 |
% |\adl@ncol| is also incremented by |\@addamp| so that we can refer to its |
| 2456 |
% value as \meta{c} of |\adl@vlineL|\slash|R|\@. This increment is done |
| 2457 |
% |\global|-ly in order that we locally set |\adl@columns| to the counting |
| 2458 |
% result outside of the group for |\@mkpream| of \textsf{array}. Therefore, |
| 2459 |
% whether or not \textsf{array} is in use, |\adl@columns| will have a |
| 2460 |
% correct value and will be correctly referred to by |\hdashline| to know how |
| 2461 |
% many columns are specified in the preamble. Note that this |\global| |
| 2462 |
% assignment is safe because the life time of |\adl@ncol| is same as that of |
| 2463 |
% |\@preamble|. |
| 2464 |
% \end{macro} |
| 2465 |
% |
| 2466 |
% \begin{macrocode} |
| 2467 |
\def\@addamp{\if@firstamp\@firstampfalse \else |
| 2468 |
\@addtopreamble{\global\advance\adl@currentcolumn\@ne &}% |
| 2469 |
\global\advance\adl@ncol\@ne \fi} |
| 2470 |
|
| 2471 |
% \end{macrocode} |
| 2472 |
% |
| 2473 |
% \SpecialIndex{\ifadl@usingarypkg} |
| 2474 |
% Since the implementation of |\@testpach| and macros for class-0 characters |
| 2475 |
% (i.e. |l|, |r| and |c|) is completely different between \LaTeX{} and |
| 2476 |
% \textsf{array}, we have to have two versions switched by |
| 2477 |
% |\adl@usingarypkg|. |
| 2478 |
% |
| 2479 |
% \subsubsection*{With \textsf{array}} |
| 2480 |
% |
| 2481 |
% \begin{macro}{\@testpach} |
| 2482 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2483 |
% {The version for \textsf{array} is introduced.} |
| 2484 |
% \SpecialIndex{\@arrayrule} |
| 2485 |
% \SpecialIndex{\adl@arrayrule} |
| 2486 |
% \SpecialIndex{\adl@arraydashrule} |
| 2487 |
% \SpecialIndex{\adl@argarraydashrule} |
| 2488 |
% |
| 2489 |
% Although we introduced two preamble characters `|:|' and `|;|', we did not |
| 2490 |
% introduce new character {\em class} because we want to minimize the |
| 2491 |
% modification of original codes. Therefore, `|:|' and `|;|' is classified |
| 2492 |
% into class-1 together with `\verb!|!'\@. Since these characters obviously |
| 2493 |
% have their own appropriate operations, |\@testpach| is modified so that |
| 2494 |
% |\@arrayrule|, which is invoked from |\@mkpream| in the case of class-1 |
| 2495 |
% character, is |\let|-equal to the macro corresponding to each character. |
| 2496 |
% \end{macro} |
| 2497 |
% |
| 2498 |
% \begin{macrocode} |
| 2499 |
\ifadl@usingarypkg |
| 2500 |
\def\@testpach{\@chclass |
| 2501 |
\ifnum \@lastchclass=6 \@ne \@chnum \@ne \else |
| 2502 |
\ifnum \@lastchclass=7 5 \else |
| 2503 |
\ifnum \@lastchclass=8 \tw@ \else |
| 2504 |
\ifnum \@lastchclass=9 \thr@@ |
| 2505 |
\else \z@ |
| 2506 |
\ifnum \@lastchclass = 10 \else |
| 2507 |
\edef\@nextchar{\expandafter\string\@nextchar}% |
| 2508 |
\@chnum |
| 2509 |
\if \@nextchar c\z@ \else |
| 2510 |
\if \@nextchar l\@ne \else |
| 2511 |
\if \@nextchar r\tw@ \else |
| 2512 |
\z@ \@chclass |
| 2513 |
\if\@nextchar |\@ne \let\@arrayrule\adl@arrayrule \else |
| 2514 |
\if\@nextchar :\@ne \let\@arrayrule\adl@arraydashrule \else |
| 2515 |
\if\@nextchar ;\@ne \let\@arrayrule\adl@argarraydashrule \else |
| 2516 |
\if \@nextchar !6 \else |
| 2517 |
\if \@nextchar @7 \else |
| 2518 |
\if \@nextchar <8 \else |
| 2519 |
\if \@nextchar >9 \else |
| 2520 |
10 |
| 2521 |
\@chnum |
| 2522 |
\if \@nextchar m\thr@@\else |
| 2523 |
\if \@nextchar p4 \else |
| 2524 |
\if \@nextchar b5 \else |
| 2525 |
\z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi \fi \fi |
| 2526 |
\fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi} |
| 2527 |
|
| 2528 |
% \end{macrocode} |
| 2529 |
% |
| 2530 |
% \begin{macro}{\@classz} |
| 2531 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2532 |
% {Introduced because \textsf{array} uses it.} |
| 2533 |
% \changes{v1.71}{2004/08/31} |
| 2534 |
% {Modified to call \cs{adl@startmbox} and \cs{adl@endmbox} for |
| 2535 |
% \textsf{array}'s \texttt{m}-columns.} |
| 2536 |
% \SpecialIndex{\adl@putlrc} |
| 2537 |
% \SpecialIndex{\adl@box} |
| 2538 |
% \SpecialIndex{\adl@startmbox} |
| 2539 |
% \SpecialIndex{\adl@endmbox} |
| 2540 |
% |
| 2541 |
% In \textsf{array}, |array| and |tabular| share common macro for class-0 |
| 2542 |
% named |\@classz|, which also generates the preamble for `|p|', `|m|' and |
| 2543 |
% `|b|'. Thus we modify it to measure the height and depth of the |
| 2544 |
% class-0 column by the macro |\adl@putlrc|, and to set |\adl@box| to the |
| 2545 |
% box for `|p|' and its relatives. Note that a |m|-type preamble |
| 2546 |
% (|@chnum|${}=3$) has to be generated to have |\adl@startmbox| and |
| 2547 |
% |\adl@endmbox| in it because a |\vcenter| construct cannot be assigned |
| 2548 |
% to |\adl@box| by |\setbox| directly. |
| 2549 |
% \end{macro} |
| 2550 |
% |
| 2551 |
% \begin{macrocode} |
| 2552 |
\def\@classz{\@classx |
| 2553 |
\@tempcnta \count@ |
| 2554 |
\prepnext@tok |
| 2555 |
\@addtopreamble{\ifcase \@chnum |
| 2556 |
\hfil |
| 2557 |
\adl@putlrc{\d@llarbegin \insert@column \d@llarend}\hfil \or |
| 2558 |
\hskip1sp\adl@putlrc{\d@llarbegin \insert@column \d@llarend}\hfil \or |
| 2559 |
\hfil\hskip1sp\adl@putlrc{\d@llarbegin \insert@column \d@llarend}\or |
| 2560 |
\setbox\adl@box\hbox \adl@startmbox{\@nextchar}\insert@column |
| 2561 |
\adl@endmbox\or |
| 2562 |
\setbox\adl@box\vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or |
| 2563 |
\setbox\adl@box\vbox \@startpbox{\@nextchar}\insert@column \@endpbox |
| 2564 |
\fi}\prepnext@tok} |
| 2565 |
% \end{macrocode} |
| 2566 |
% |
| 2567 |
% \begin{macro}{\adl@class@start} |
| 2568 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2569 |
% {Introduced for class number identification.} |
| 2570 |
% \begin{macro}{\adl@class@iiiorvii} |
| 2571 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2572 |
% {Introduced for class number identification.} |
| 2573 |
% |
| 2574 |
% Another stuff for compatibility is to refer to the class number for the |
| 2575 |
% beginning of preamble which is different between \LaTeX{} and |
| 2576 |
% \textsf{array}, and that for `|p|' or `|@|' to get the argument of `|;|' as |
| 2577 |
% explained later. In the case with \textsf{array}, the former is class-4 |
| 2578 |
% and we use `|@|' (class-7) for the latter. |
| 2579 |
% \end{macro}\end{macro} |
| 2580 |
% |
| 2581 |
% \begin{macrocode} |
| 2582 |
\def\adl@class@start{4} |
| 2583 |
\def\adl@class@iiiorvii{7} |
| 2584 |
|
| 2585 |
% \end{macrocode} |
| 2586 |
% |
| 2587 |
% \subsubsection*{Without \textsf{array}} |
| 2588 |
% |
| 2589 |
% \begin{macro}{\@testpach} |
| 2590 |
% \SpecialIndex{\@arrayrule} |
| 2591 |
% \SpecialIndex{\adl@arrayrule} |
| 2592 |
% \SpecialIndex{\adl@arraydashrule} |
| 2593 |
% \SpecialIndex{\adl@argarraydashrule} |
| 2594 |
% |
| 2595 |
% The reason why and how we modify |\@testpach| of \LaTeX{} is same as those |
| 2596 |
% of \textsf{array}. |
| 2597 |
% \end{macro} |
| 2598 |
% |
| 2599 |
% \begin{macrocode} |
| 2600 |
\else |
| 2601 |
\def\@testpach#1{\@chclass \ifnum \@lastchclass=\tw@ 4\relax \else |
| 2602 |
\ifnum \@lastchclass=\thr@@ 5\relax \else |
| 2603 |
\z@ \if #1c\@chnum \z@ \else |
| 2604 |
\if #1l\@chnum \@ne \else |
| 2605 |
\if #1r\@chnum \tw@ \else |
| 2606 |
\@chclass |
| 2607 |
\if #1|\@ne \let\@arrayrule\adl@arrayrule \else |
| 2608 |
\if #1:\@ne \let\@arrayrule\adl@arraydashrule \else |
| 2609 |
\if #1;\@ne \let\@arrayrule\adl@argarraydashrule \else |
| 2610 |
\if #1@\tw@ \else |
| 2611 |
\if #1p\thr@@ \else \z@ \@preamerr 0\fi |
| 2612 |
\fi \fi \fi \fi \fi \fi \fi \fi \fi} |
| 2613 |
|
| 2614 |
% \end{macrocode} |
| 2615 |
% |
| 2616 |
% \begin{macro}{\@arrayclassz} |
| 2617 |
% \begin{macro}{\@tabclassz} |
| 2618 |
% \SpecialIndex{\adl@putlrc} |
| 2619 |
% |
| 2620 |
% Since \LaTeX{} has two macros for class-0, one for |array| and the other |
| 2621 |
% for |tabular|, we have to modify both. Since the box for `|p|' is opened |
| 2622 |
% by |\@@startpbox|, however, we may not worry about it. |
| 2623 |
% \end{macro}\end{macro} |
| 2624 |
% |
| 2625 |
% \begin{macrocode} |
| 2626 |
\def\@arrayclassz{\ifcase \@lastchclass \@acolampacol \or \@ampacol \or |
| 2627 |
\or \or \@addamp \or |
| 2628 |
\@acolampacol \or \@firstampfalse \@acol \fi |
| 2629 |
\edef\@preamble{\@preamble |
| 2630 |
\ifcase \@chnum |
| 2631 |
\hfil\adl@putlrc{$\relax\@sharp$}\hfil |
| 2632 |
\or \adl@putlrc{$\relax\@sharp$}\hfil |
| 2633 |
\or \hfil\adl@putlrc{$\relax\@sharp$}\fi}} |
| 2634 |
\def\@tabclassz{\ifcase \@lastchclass \@acolampacol \or \@ampacol \or |
| 2635 |
\or \or \@addamp \or |
| 2636 |
\@acolampacol \or \@firstampfalse \@acol \fi |
| 2637 |
\edef\@preamble{\@preamble |
| 2638 |
\ifcase \@chnum |
| 2639 |
\hfil\adl@putlrc{\@sharp\unskip}\hfil |
| 2640 |
\or \adl@putlrc{\@sharp\unskip}\hfil |
| 2641 |
\or \hfil\hskip\z@ \adl@putlrc{\@sharp\unskip}\fi}} |
| 2642 |
% \end{macrocode} |
| 2643 |
% |
| 2644 |
% \begin{macro}{\adl@class@start} |
| 2645 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2646 |
% {Introduced for class number identification.} |
| 2647 |
% \begin{macro}{\adl@class@iiiorvii} |
| 2648 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2649 |
% {Introduced for class number identification.} |
| 2650 |
% In \LaTeX{}, the beginning of preamble is class-6 and we use `|p|' |
| 2651 |
% (class-3) to get the argument of `|;|'. |
| 2652 |
% \end{macro}\end{macro} |
| 2653 |
% |
| 2654 |
% \begin{macrocode} |
| 2655 |
\def\adl@class@start{6} |
| 2656 |
\def\adl@class@iiiorvii{3} |
| 2657 |
\fi |
| 2658 |
|
| 2659 |
% \end{macrocode} |
| 2660 |
% |
| 2661 |
% Hereafter, codes for \LaTeX{} and \textsf{array} are common again. |
| 2662 |
% |
| 2663 |
% \begin{macro}{\adl@putlrc} |
| 2664 |
% \changes{v1.5-2}{2002/06/26} |
| 2665 |
% {\cs{adl@putlrc} must do \cs{unhbox}\cs{adl@box} to make glues |
| 2666 |
% effective.} |
| 2667 |
% \SpecialIndex{\adl@box} |
| 2668 |
% \SpecialIndex{\adl@colhtdp} |
| 2669 |
% |
| 2670 |
% The macro |\adl@putlrc| is for class-0 preamble characters to set |
| 2671 |
% |\adl@box| to the contents of a column, measure its height\slash depth by |
| 2672 |
% |\adl@colhtdp| and put the box by |\unhbox| (not by |\box|) in order to |
| 2673 |
% make the glues in the contents effective. |
| 2674 |
% \end{macro} |
| 2675 |
% |
| 2676 |
% \begin{macrocode} |
| 2677 |
\def\adl@putlrc#1{\setbox\adl@box\hbox{#1}\adl@colhtdp \unhbox\adl@box} |
| 2678 |
|
| 2679 |
% \end{macrocode} |
| 2680 |
% |
| 2681 |
% \begin{macro}{\adl@arrayrule} |
| 2682 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2683 |
% {Modified to replace \cs{adl@columns} with \cs{adl@ncol}.} |
| 2684 |
% \begin{macro}{\adl@arraydashrule} |
| 2685 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2686 |
% {Modified to replace \cs{adl@columns} with \cs{adl@ncol}.} |
| 2687 |
% \begin{macro}{\adl@argarraydashrule} |
| 2688 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2689 |
% {Modified to replace \cs{adl@columns} with \cs{adl@ncol}.} |
| 2690 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2691 |
% {Modified to pretend \texttt{p} or \texttt{@} depending on if |
| 2692 |
% \textsf{array} is in use.} |
| 2693 |
% \begin{macro}{\adl@xarraydashrule} |
| 2694 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2695 |
% {Modified to refer \cs{adl@class@start} rather than \LaTeX's 6.} |
| 2696 |
% \changes{v1.4-2-2}{1999/06/25} |
| 2697 |
% {Modified to add invisible rule of \cs{arrayrulewidth} wide if |
| 2698 |
% \cs{ADLsome}\penalty\exhyphenpenalty\texttt{wide}.} |
| 2699 |
% \changes{v1.7-3}{2004/5/21} |
| 2700 |
% {Modified to add color arguments to \cs{adl@vline}\texttt{L}\slash |
| 2701 |
% \texttt{R}} |
| 2702 |
% \SpecialIndex{\@lastchclass} |
| 2703 |
% \SpecialIndex{\adl@class@start} |
| 2704 |
% \SpecialIndex{\ifadl@leftrule} |
| 2705 |
% \SpecialIndex{\adl@vlineL} |
| 2706 |
% \SpecialIndex{\adl@vlineR} |
| 2707 |
% \SpecialIndex{\adl@ncol} |
| 2708 |
% \SpecialIndex{\CT@arc@} |
| 2709 |
% \SpecialIndex{\adl@dashgapcolor} |
| 2710 |
% \SpecialIndex{\color} |
| 2711 |
% \def\G{{\mit\Gamma}} |
| 2712 |
% |
| 2713 |
% The preamble parts for vertical solid- and dash-lines are constructed by |
| 2714 |
% the macros |\adl@arrayrule| for `\verb!|!', |\adl@arraydashrule| for |
| 2715 |
% `|:|', and |\adl@argarraydashrule| for `|;|'.\@ The macro; |
| 2716 |
% |
| 2717 |
% \begin{quote} |
| 2718 |
% |\adl@xarraydashrule|\Meta{$c^L$}\Meta{$c^R$}|{|\meta{d}|/|\meta{g}|}| |
| 2719 |
% \end{quote} |
| 2720 |
% |
| 2721 |
% is invoked by them to perform common operations. It at first checks the |
| 2722 |
% preamble character is the first element of the preamble |
| 2723 |
% (|\@lastchclass|${}=|\adl@class@start|$) or it follows another character |
| 2724 |
% for vertical line (|\@lastchclass|${}=1$). If this is not satisfied, the |
| 2725 |
% vertical line is put at the right edge of a column and thus |
| 2726 |
% |\ifadl@leftrule| is set to false. Then it adds |
| 2727 |
% |\adl@vlineL|\Meta{$\G_d$}\Meta{$\G_g$} |
| 2728 |
% \Meta{$c^L$}|{|\meta{d}|/|\meta{g}|}| if |\ifadl@leftrule| is |
| 2729 |
% true indicating the vertical line will appear at the left edge of the |
| 2730 |
% column \meta{$c^L$}, or |\adl@vlineR|\Meta{$\G_d$}\Meta{$\G_g$} |
| 2731 |
% \Meta{$c^R$}|{|\meta{d}|/|\meta{g}|}| otherwise. Note that \meta{$c^L$} |
| 2732 |
% is always 1 for {\em main} preamble while \meta{$c^R$} is the column |
| 2733 |
% number given by |\adl@ncol|, but \meta{$c^L$} may not be 1 for the |
| 2734 |
% preamble of |\multicolumn| as described in \S\ref{sec:imp-mc}. Also note |
| 2735 |
% that $\G_d$ and $\G_g$ are |\CT@arc@| and |\adl@dashgapcolor| |
| 2736 |
% respectively whose bodies are |\color| for dashes and gaps specified by |
| 2737 |
% |\arrayrulecolor| and |\dashgapcolor|, or |\relax| if they are not colored. |
| 2738 |
% |
| 2739 |
% In addition, an invisible |\vrule| of |\arrayrulewidth| wide is added if |
| 2740 |
% both |\ADL#some#wide| and |\ADLactivate| are in effect, i.e.\ both |
| 2741 |
% |\ifadl@zwrule| and |\ifadl@inactive| are false, to keep a space for |
| 2742 |
% the vertical line having {\em real} width. |
| 2743 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 2744 |
% |
| 2745 |
% \begin{macro}{\adl@classv} |
| 2746 |
% \begin{macro}{\adl@classvfordash} |
| 2747 |
% \SpecialIndex{\@nextchar} |
| 2748 |
% \SpecialIndex{\@chclass} |
| 2749 |
% \SpecialIndex{\@classv} |
| 2750 |
% \SpecialIndex{\adl@class@iiiorvii} |
| 2751 |
% |
| 2752 |
% The argument of `|;|' is not provided by |\adl@argarraydashrule| but is |
| 2753 |
% directly passed from the preamble text through |\@nextchar|. This direct |
| 2754 |
% passing is implemented by the following trick. The macro |
| 2755 |
% |\adl@argarraydashrule| set |\@chclass| to |\adl@class@iiiorvii| to |
| 2756 |
% pretend it is for `|p|' if \textsf{array} is not in use, or `|@|' |
| 2757 |
% otherwise. Then it temporally changes the definition of |\@classv|, which |
| 2758 |
% is incidentally for the argument of `|p|' and `|@|' in the case without/with |
| 2759 |
% \textsf{array} respectively, to |\adl@classvfordash| to process the |
| 2760 |
% argument of `|;|' rather than that of `|p|' or `|@|'\@. Then |
| 2761 |
% |\adl@classvfordash| is invoked by |\@mkpream| and it adds the argument to |
| 2762 |
% |\@preamble|. Finally, it restores the definition of |\@classv| and sets |
| 2763 |
% |\@chclass| to 1 to indicate that the last item is a vertical line |
| 2764 |
% specification. |
| 2765 |
% \end{macro}\end{macro} |
| 2766 |
% |
| 2767 |
% \begin{macrocode} |
| 2768 |
\def\adl@arrayrule{% |
| 2769 |
\adl@xarraydashrule |
| 2770 |
{\@ne}{\adl@ncol}{{\z@/\z@}}} |
| 2771 |
\def\adl@arraydashrule{% |
| 2772 |
\adl@xarraydashrule |
| 2773 |
{\@ne}{\adl@ncol}% |
| 2774 |
{{\dashlinedash/\dashlinegap}}} |
| 2775 |
\def\adl@argarraydashrule{% |
| 2776 |
\adl@xarraydashrule |
| 2777 |
{\@ne}{\adl@ncol}{}% |
| 2778 |
\@chclass\adl@class@iiiorvii \let\@classv\adl@classvfordash} |
| 2779 |
\def\adl@xarraydashrule#1#2#3{% |
| 2780 |
\ifnum\@lastchclass=\adl@class@start\else |
| 2781 |
\ifnum\@lastchclass=\@ne\else |
| 2782 |
\adl@leftrulefalse \fi\fi |
| 2783 |
\ifadl@zwvrule\else \ifadl@inactive\else |
| 2784 |
\@addtopreamble{\vrule\@width\arrayrulewidth |
| 2785 |
\@height\z@ \@depth\z@}\fi \fi |
| 2786 |
\ifadl@leftrule |
| 2787 |
\@addtopreamble{\adl@vlineL{\CT@arc@}{\adl@dashgapcolor}% |
| 2788 |
{\number#1}#3}% |
| 2789 |
\else \@addtopreamble{\adl@vlineR{\CT@arc@}{\adl@dashgapcolor}% |
| 2790 |
{\number#2}#3}\fi} |
| 2791 |
\let\adl@classv\@classv |
| 2792 |
\def\adl@classvfordash{\@addtopreamble{{\@nextchar}}\let\@classv\adl@classv |
| 2793 |
\@chclass\@ne} |
| 2794 |
|
| 2795 |
%%^L |
| 2796 |
% \end{macrocode} |
| 2797 |
% |
| 2798 |
% |
| 2799 |
% \subsection{Building Columns} |
| 2800 |
% \label{sec:imp-col} |
| 2801 |
% |
| 2802 |
% \begin{macro}{\adl@preaminit} |
| 2803 |
% \begin{macro}{\adl@colhtdp} |
| 2804 |
% \begin{macro}{\adl@vlineL} |
| 2805 |
% \begin{macro}{\adl@vlineR} |
| 2806 |
% |
| 2807 |
% If \textsf{array} is not in use, after the |\@preamble| is completed, the |
| 2808 |
% control sequences for macros in it should regain their own definition. |
| 2809 |
% The macro |\adl@preaminit| performs this operation for macros we |
| 2810 |
% introduced, |\adl@colhtdp|, |\adl@vlineL| and |\adl@vlineR|. For the case |
| 2811 |
% with \textsf{array}, we will call |\adl@preaminit| in \textsf{arydshln} to |
| 2812 |
% initiate them with the definitions as described later. |
| 2813 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 2814 |
% |
| 2815 |
% \begin{macrocode} |
| 2816 |
|
| 2817 |
%% Building Columns |
| 2818 |
|
| 2819 |
\def\adl@preaminit{\let\adl@colhtdp\adl@@colhtdp |
| 2820 |
\let\adl@vlineL\adl@@vlineL \let\adl@vlineR\adl@@vlineR} |
| 2821 |
|
| 2822 |
% \end{macrocode} |
| 2823 |
% |
| 2824 |
% \begin{macro}{\adl@@colhtdp} |
| 2825 |
% For the measurement of the height and depth of a row, |\adl@@colhtdp| |
| 2826 |
% compares |\adl@height| and |\adl@depth| to the height and depth of |
| 2827 |
% |\adl@box| which contains the main part of the column to be built, and |
| 2828 |
% |\global|-ly updates the registers if they are less. |
| 2829 |
% \end{macro} |
| 2830 |
% |
| 2831 |
% \begin{macrocode} |
| 2832 |
\def\adl@@colhtdp{% |
| 2833 |
\ifdim\adl@height<\ht\adl@box \global\adl@height\ht\adl@box \fi |
| 2834 |
\ifdim\adl@depth<\dp\adl@box \global\adl@depth\dp\adl@box\fi} |
| 2835 |
|
| 2836 |
% \end{macrocode} |
| 2837 |
% |
| 2838 |
% \begin{macro}{\adl@@vlineL} |
| 2839 |
% \changes{v1.7-3}{2004/5/21} |
| 2840 |
% {Color arguments are added.} |
| 2841 |
% \begin{macro}{\adl@@vlineR} |
| 2842 |
% \changes{v1.7-3}{2004/5/21} |
| 2843 |
% {Color arguments are added.} |
| 2844 |
% \begin{macro}{\adl@@ivline} |
| 2845 |
% \changes{v1.7-3}{2004/5/21} |
| 2846 |
% {Invocations of \cs{adl@setcolor} are added.} |
| 2847 |
% \begin{macro}{\adl@setcolor} |
| 2848 |
% \changes{v1.7-3}{2004/5/21} |
| 2849 |
% {Introduced to color vertical lines.} |
| 2850 |
% \begin{macro}{\adl@nocolor} |
| 2851 |
% \changes{v1.7-3}{2004/5/21} |
| 2852 |
% {Introduced to examine if coloring is specified.} |
| 2853 |
% \begin{macro}{\adl@dashcolor} |
| 2854 |
% \changes{v1.7-3}{2004/5/21} |
| 2855 |
% {Introduced as the temporary variable of color specification of |
| 2856 |
% dashes.} |
| 2857 |
% \begin{macro}{\adl@gapcolor} |
| 2858 |
% \changes{v1.7-3}{2004/5/21} |
| 2859 |
% {Introduced as the temporary variable of color specification of |
| 2860 |
% gaps.} |
| 2861 |
% \SpecialIndex{\color} |
| 2862 |
% \SpecialIndex{\current@color} |
| 2863 |
% \def\G{{\mit\Gamma}} \let\g\gamma |
| 2864 |
% The macro |
| 2865 |
% |\adl@@vlineL|\meta{$\G_d$}\meta{$\G_g$}\meta{c}|{|\meta{d}|/|\meta{g}|}| |
| 2866 |
% adds the element |
| 2867 |
% $e=\langle c,d,g\rangle={}$ |
| 2868 |
% |\@elt|\Meta{c}\Meta{d}\Meta{g}\Meta{$\g_d$}\Meta{$\g_g$} to the tail of |
| 2869 |
% the list |\adl@colsL| to construct $C^L_i$, where $\g_d$ and $\g_g$ are |
| 2870 |
% the color specifications given by |\color| macros in $\G_d$ and $\G_g$. |
| 2871 |
% The macro |\add@@vlineR| performs similar operation but the element is |
| 2872 |
% added to the head of |\adl@colsR| for $C^R_i$ because it is processed |
| 2873 |
% right-to-left manner. The argument \meta{d} and \meta{g} are extracted by |
| 2874 |
% the macro |\adl@ivline| which converts given dimensional values of them to |
| 2875 |
% integers. It also sets \meta{d} and \meta{g} to 0 (i.e. solid-line) if one |
| 2876 |
% of given values are not positive, in order to make it sure that one dash |
| 2877 |
% segment has positive length. Then it invokes |\adl@setcolor| to define |
| 2878 |
% |\adl@dashcolor| and |\adl@gapcolor| with the color specification of |
| 2879 |
% $\G_d$ and $\G_g$. Since |\adl@setcolor| locally expands |\color| macro |
| 2880 |
% in $\G_d$ and $\G_g$ to define |\currnet@color| that becomes the body of |
| 2881 |
% |\adl@dashcolor| ($\g_d$) and |\adl@gapcolor| ($\g_g$) with expansion, |
| 2882 |
% different |\color| specifications of a color, such as |\color{red}| |
| 2883 |
% and |\color[rgb]{1,0,0}|, will produce a unified result such as |
| 2884 |
% |{rgb 1 0 0}|. If $\G_d$ or $\G_g$ is |\relax| which is the body of |
| 2885 |
% |\adl@nocolor|, $\g_d$ or $\g_g$ is also |\relax| to indicate dashes are |
| 2886 |
% colored (or not colored) as done in outer world and gaps are transparent. |
| 2887 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 2888 |
% |
| 2889 |
% \begin{macrocode} |
| 2890 |
\def\adl@@vlineL#1#2#3#4{\adl@ivline#4\@nil{#1}{#2}% |
| 2891 |
\xdef\adl@colsL{\adl@colsL |
| 2892 |
\@elt{#3}{\number\@tempcnta}{\number\@tempcntb}% |
| 2893 |
{\adl@dashcolor}{\adl@gapcolor}}} |
| 2894 |
\def\adl@@vlineR#1#2#3#4{\adl@ivline#4\@nil{#1}{#2}% |
| 2895 |
\xdef\adl@colsR{% |
| 2896 |
\@elt{#3}{\number\@tempcnta}{\number\@tempcntb}% |
| 2897 |
{\adl@dashcolor}{\adl@gapcolor}% |
| 2898 |
\adl@colsR}} |
| 2899 |
\def\adl@ivline#1/#2\@nil#3#4{% |
| 2900 |
\@tempdima#1\relax \@tempcnta\@tempdima |
| 2901 |
\@tempdima#2\relax \@tempcntb\@tempdima |
| 2902 |
\ifnum\@tempcnta>\z@ \else \@tempcnta\z@ \@tempcntb\z@ \fi |
| 2903 |
\ifnum\@tempcntb>\z@ \else \@tempcnta\z@ \@tempcntb\z@ \fi |
| 2904 |
\adl@setcolor\adl@dashcolor{#3}\adl@setcolor\adl@gapcolor{#4}} |
| 2905 |
\def\adl@setcolor#1#2{\def\@tempa{#2}\ifx\@tempa\adl@nocolor \def#1{\relax}% |
| 2906 |
\else{#2\xdef#1{\current@color}}\fi} |
| 2907 |
\def\adl@nocolor{\relax} |
| 2908 |
% \end{macrocode} |
| 2909 |
% |
| 2910 |
% \begin{macro}{\adl@colhtdp} |
| 2911 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2912 |
% {Initialized by calling \cs{adl@preaminit}.} |
| 2913 |
% \begin{macro}{\adl@vlineL} |
| 2914 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2915 |
% {Initialized by calling \cs{adl@preaminit}.} |
| 2916 |
% \begin{macro}{\adl@vlineR} |
| 2917 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2918 |
% {Initialized by calling \cs{adl@preaminit}.} |
| 2919 |
% \SpecialIndex{\adl@preaminit} |
| 2920 |
% |
| 2921 |
% After |\adl@@colhtdp|, |\adl@@vlineL| and |\adl@@vlineR| are defined, |
| 2922 |
% we call |\adl@preaminit| to |\let| their single |@| counterparts be equal |
| 2923 |
% to them. Therefore, in the case with \textsf{array}, |\adl@colhtdp| etc.\ |
| 2924 |
% are temporarily |\relax| when |\@preamble| is being generated in the group |
| 2925 |
% of |\@mkpream|, and regain their own definitions outside the group where |
| 2926 |
% the completed |\@preamble| is referred to. |
| 2927 |
% \end{macro}\end{macro}\end{macro} |
| 2928 |
% |
| 2929 |
% \begin{macrocode} |
| 2930 |
\adl@preaminit |
| 2931 |
|
| 2932 |
% \end{macrocode} |
| 2933 |
% |
| 2934 |
% \begin{macro}{\adl@inactivevl} |
| 2935 |
% \changes{v1.4-2-3}{1999/06/25} |
| 2936 |
% {Introduced to emulate `\texttt{:}' and \texttt{;} by |
| 2937 |
% \protect\VERTBAR.} |
| 2938 |
% \changes{v1.7-3}{2004/5/21} |
| 2939 |
% {Modified to color the \cs{vline} by the first argument.} |
| 2940 |
% \SpecialIndex{\ifadl@zwvrule} |
| 2941 |
% |
| 2942 |
% If |\ADLinactivate| is in effect, |\adl@vlineL|\slash|R| and |
| 2943 |
% |\adl@@vlineL|\slash|R| are |\let|-equal |
| 2944 |
% to |\adl@inactivevl|. This macro simply puts a |\vrule| by |\vline| with |
| 2945 |
% |\color| (or |\relax|) in its first argument and |
| 2946 |
% with\slash without negative |\hskip| of a half of |\arrayrulewidth| wide |
| 2947 |
% depending on |\ifadl@zwvrule|, discarding other arguments. |
| 2948 |
% \end{macro} |
| 2949 |
% |
| 2950 |
% \begin{macrocode} |
| 2951 |
\def\adl@inactivevl#1#2#3#4{\ifadl@zwvrule \hskip-.5\arrayrulewidth \fi |
| 2952 |
{#1\vline}\ifadl@zwvrule \hskip-.5\arrayrulewidth \fi} |
| 2953 |
|
| 2954 |
% \end{macrocode} |
| 2955 |
% |
| 2956 |
% |
| 2957 |
% \begin{macro}{\@@startpbox} |
| 2958 |
% \begin{macro}{\@@endpbox} |
| 2959 |
% \begin{macro}{\@startpbox} |
| 2960 |
% \changes{v1.75}{2018/12/26} |
| 2961 |
% {Introduced to cope with the \cs{color@begingroup}\slash |
| 2962 |
% \cs{color@endgroup} problem.} |
| 2963 |
% \begin{macro}{\@endpbox} |
| 2964 |
% \changes{v1.4-2-1}{1999/06/25} |
| 2965 |
% {Introduced because \textsf{array} uses it.} |
| 2966 |
% \changes{v1.75}{2018/12/26} |
| 2967 |
% {Modified to ensure that the macro has \cs{color@endgroup} |
| 2968 |
% irrespective of \textsf{array}'s version.} |
| 2969 |
% \begin{macro}{\adl@startmbox} |
| 2970 |
% \changes{v1.71}{2004/08/31} |
| 2971 |
% {Introduced to the bug fix of \textsf{array}'s \texttt{m}-columns.} |
| 2972 |
% \changes{v1.75}{2018/12/26} |
| 2973 |
% {Replace \cs{@startpbox} with \cs{adl@org@startpbox} to avoid the |
| 2974 |
% color-grouping problem.} |
| 2975 |
% \changes{v1.76}{2019/02/21} |
| 2976 |
% {Replace \cs{adl@org@startpbox} with \cs{@startpbox} to do |
| 2977 |
% color-grouping always and to invoke \cs{adl@LTstartpbox} through |
| 2978 |
% \cs{@stratpbox} when \textsf{longtable} is in use.} |
| 2979 |
% \begin{macro}{\adl@endmbox} |
| 2980 |
% \changes{v1.71}{2004/08/31} |
| 2981 |
% {Introduced to the bug fix of \textsf{array}'s \texttt{m}-columns.} |
| 2982 |
% \changes{v1.76}{2019/02/21} |
| 2983 |
% {Replace \cs{adl@org@endpbox} with what \cs{@endpbox} of |
| 2984 |
% \textsf{array} has to perform color-grouping always.} |
| 2985 |
% \SpecialIndex{\@finalstrut} |
| 2986 |
% \SpecialIndex{\color@begingroup} |
| 2987 |
% \SpecialIndex{\color@endgroup} |
| 2988 |
% \SpecialIndex{\adl@box} |
| 2989 |
% \SpecialIndex{\adl@colhtdp} |
| 2990 |
% \SpecialIndex{\adl@LTstartpbox} |
| 2991 |
% |
| 2992 |
% The macros to make |\parbox| for `|p|', |\@@startpbox| and |
| 2993 |
% \hbox{|\@@endpbox|}, are modified for height\slash depth measurement. The |
| 2994 |
% code for |\@@endpbox| is based on that of \LaTeXe{} to fix the bug of |
| 2995 |
% |\strut|-ing in \LaTeX-2.09, but |\@finalstrut| is manually expanded |
| 2996 |
% because it is not available in \LaTeX-2.09. |
| 2997 |
% |
| 2998 |
% In \textsf{array}, these two macros are not used but |\@startpbox| and |
| 2999 |
% |\@endpbox| are. Until v2.4h, the former may be untouched and the latter |
| 3000 |
% can be |\let|-equal to |\@@endpbox|. However in v2.4i, |\color@begingroup| |
| 3001 |
% and |\color@endgroup| are added to them to make the compatibility issue a |
| 3002 |
% little bit complicated. That is, our version of |\@endpbox| would have to |
| 3003 |
% have |\color@endgroup| if and only if \textsf{array} is v2.4i or later |
| 3004 |
% because |\@startpbox| has |\color@begingroup| in these versions, if we |
| 3005 |
% relied on the original |\@startpbox|. To avoid version dependent coding, |
| 3006 |
% we copy the new definition of |\@starpbox| to ensure it has |
| 3007 |
% |\color@begingroup| and let our own |\@endpbox| with height\slash depth |
| 3008 |
% measurement have |\color@endgroup| irrespective of the version of |
| 3009 |
% \textsf{array}. Note that the assigning the box having |'p'| or |'b'| to |
| 3010 |
% |\adl@box| for the measurement is done in our own |\@classz| shown in |
| 3011 |
% \S\ref{sec:imp-pream}. |
| 3012 |
% |
| 3013 |
% As for |m|-type columns, we need a special care because its body |
| 3014 |
% |\vcenter| cannot be assigned directly to |\adl@box| by |
| 3015 |
% |\setbox|\footnote{ |
| 3016 |
% |
| 3017 |
% The author had forgotten this fact until Morten H\o gholm pointed out it. |
| 3018 |
% Thanks Morten.}. |
| 3019 |
% |
| 3020 |
% Thus we enclose a |$\vcenter{|\ldots|}$| construct in a |\hbox| and assign |
| 3021 |
% it to |\adl@box|. The construct is opened and closed by the macros |
| 3022 |
% |\adl@startmbox| and |\adl@endmbox| with |\@startpbox| and what |
| 3023 |
% |\@endpbox| of \textsf{array} 2.4j has, in order to perform color-grouping |
| 3024 |
% regardless of the version of \textsf{array}. The latter macro also has |
| 3025 |
% our own function to measure the height and depth of the |\hbox| by |
| 3026 |
% |\adl@colhtdp|. Note that |\@startpbox| in |\adl@startmbox| can be |
| 3027 |
% different from the definition made here and, more specifically, will be |
| 3028 |
% |\adl@LTstartpbox| when \textsf{longtable} is in use. Also noote that the |
| 3029 |
% mechanism with |\vcenter| was replaced with a vertical shift of a box for |
| 3030 |
% '|m|' in v2.4f of \textsf{array}, but we stick the old mechanism to avoid |
| 3031 |
% version dependent coding. |
| 3032 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 3033 |
% |
| 3034 |
% \begin{macrocode} |
| 3035 |
\def\@@startpbox#1{\setbox\adl@box\vtop\bgroup \hsize#1\@arrayparboxrestore} |
| 3036 |
\def\@@endpbox{\unskip \ifhmode \nobreak |
| 3037 |
\vrule\@width\z@\@height\z@\@depth\dp\@arstrutbox \fi |
| 3038 |
\par \egroup \adl@colhtdp \box\adl@box \hfil} |
| 3039 |
\def\@startpbox#1{\bgroup |
| 3040 |
\color@begingroup |
| 3041 |
\setlength\hsize{#1}\@arrayparboxrestore |
| 3042 |
\everypar{% |
| 3043 |
\vrule\@height\ht\@arstrutbox\@width\z@ |
| 3044 |
\everypar{}}% |
| 3045 |
} |
| 3046 |
\def\@endpbox{\@finalstrut\@arstrutbox \color@endgroup \egroup |
| 3047 |
\adl@colhtdp \box\adl@box \hfil} |
| 3048 |
\def\adl@startmbox{\bgroup $\vcenter\@startpbox} |
| 3049 |
\def\adl@endmbox{\@finalstrut\@arstrutbox \color@endgroup \egroup |
| 3050 |
$\egroup \adl@colhtdp \box\adl@box \hfil} |
| 3051 |
|
| 3052 |
%%^L |
| 3053 |
% \end{macrocode} |
| 3054 |
% |
| 3055 |
% |
| 3056 |
% |
| 3057 |
% \subsection{Multi-columns} |
| 3058 |
% \label{sec:imp-mc} |
| 3059 |
% |
| 3060 |
% \begin{macro}{\multicolumn} |
| 3061 |
% \changes{v1.4-2-1}{1999/06/25} |
| 3062 |
% {Modified for several reason.} |
| 3063 |
% \begin{macro}{\adl@preamble} |
| 3064 |
% \begin{macro}{\adl@mcaddamp} |
| 3065 |
% \changes{v1.4-2-1}{1999/06/25} |
| 3066 |
% {Introduced for the complaint on multiple columns if with |
| 3067 |
% \textsf{array}.} |
| 3068 |
% \begin{macro}{\adl@activatepbox} |
| 3069 |
% \changes{v1.4-2-1}{1999/06/25} |
| 3070 |
% {Introduced to do nothing if with \textsf{array}.} |
| 3071 |
% |
| 3072 |
% The macro |\multicolumn| is modified for the following. |
| 3073 |
% |
| 3074 |
% \begin{itemize} |
| 3075 |
% \item |
| 3076 |
% The macros to construct the parts of |\@preamble| for vertical lines, |
| 3077 |
% |\adl@arrayrule|, |\adl@arraydashrule| and |\adl@argarraydashrule|, have |
| 3078 |
% to perform operations slightly different from those for main preamble. |
| 3079 |
% Thus they are |\def|-ined to multi-column version |\adl@mcarrayrule|, etc. |
| 3080 |
% \changes{v1.3}{1998/10/08} |
| 3081 |
% {\cs{def}-s for \cs{adl@mcarrayrule} etc. are enclosed in a group.} |
| 3082 |
% These |\def|-initions are enclosed in a group so that they are not |
| 3083 |
% affected to |array| or |tabular| which may occur in the third argument of |
| 3084 |
% |\multicolumn|. In order to make |\@preamble| work well outside of the |
| 3085 |
% group containing |\@makepream|, |\adl@preamble| is |\global|-ly |\let|-equal |
| 3086 |
% to |\@preamble| just after |\@makepream| in the group and then |
| 3087 |
% reverse |\let|-assignment is performed just after the group is closed. |
| 3088 |
% These global assignment is unnecessary with \textsf{array} because |
| 3089 |
% |\@preamlbe| is constructed |\global|-ly, but safe. |
| 3090 |
% |
| 3091 |
% Since this grouping nullifies the effect of |\adl@preaminit| called in |
| 3092 |
% |\@mkpream|, we call |\adl@preaminit| again after the group closing. |
| 3093 |
% |
| 3094 |
% \item |
| 3095 |
% In \textsf{array}, |\@addamp| to make |\@preamble| for |\multicolumn| has |
| 3096 |
% a different definition from that for main one. Thus it is |\let|-equal |
| 3097 |
% to |\adl@mcaddamp| whose definition is switched by |\ifadl@usingarypkg|. |
| 3098 |
% |
| 3099 |
% \item |
| 3100 |
% If \textsf{array} is in use, |\@preamble| has to be |\xdef|-ed once again |
| 3101 |
% by |\@addpreamble| with an |\@empty| argument after |\@mkpreamble| to |
| 3102 |
% expand the contents of |\toks| registers. This is performed whether or |
| 3103 |
% not with \textsf{array} because it is safe. |
| 3104 |
% |
| 3105 |
% \item |
| 3106 |
% As done in |\@array|, |\set@typeset@protect| is replaced with direct |
| 3107 |
% |\let|. |
| 3108 |
% |
| 3109 |
% \item |
| 3110 |
% If without \textsf{array}, |\@startpbox| and |\@endpbox| should be |
| 3111 |
% |\let|-equal to their |@@| counterparts, while should not with |
| 3112 |
% \textsf{array}. Thus we define |\adl@activatepbox| to do or not to do so |
| 3113 |
% depending on |\ifadl@usingarypkg|. |
| 3114 |
% |
| 3115 |
% \item |
| 3116 |
% The counter |\adl@currentcolumn| is |\global|-ly incremented by the first |
| 3117 |
% argument of |\multicolumn| (number of columns to be |\span|-ned). |
| 3118 |
% \end{itemize} |
| 3119 |
% |
| 3120 |
% Note that |\adl@columns| is modified by |\@mkpream|, but it is not |
| 3121 |
% referred to by |\adl@mcarrayrule| etc., and its value is restored before |
| 3122 |
% referred to by |\hdashline|, etc. |
| 3123 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 3124 |
% |
| 3125 |
% \SpecialIndex{\adl@arrayrule} |
| 3126 |
% \SpecialIndex{\adl@arraydashrule} |
| 3127 |
% \SpecialIndex{\adl@argarraydashrule} |
| 3128 |
% \SpecialIndex{\adl@mcarrayrule} |
| 3129 |
% \SpecialIndex{\adl@mcarraydashrule} |
| 3130 |
% \SpecialIndex{\adl@mcargarraydashrule} |
| 3131 |
% \SpecialIndex{\ifadl@usingarypkg} |
| 3132 |
% \SpecialIndex{\adl@currentcolumn} |
| 3133 |
% |
| 3134 |
% \begin{macrocode} |
| 3135 |
|
| 3136 |
%% Multi-Columns |
| 3137 |
|
| 3138 |
\def\multicolumn#1#2#3{\multispan{#1}\begingroup \begingroup |
| 3139 |
\def\adl@arrayrule{\adl@mcarrayrule{#1}}% |
| 3140 |
\def\adl@arraydashrule{\adl@mcarraydashrule{#1}}% |
| 3141 |
\def\adl@argarraydashrule{\adl@mcargarraydashrule{#1}}% |
| 3142 |
\let\@addamp\adl@mcaddamp |
| 3143 |
\@mkpream{#2}\@addtopreamble\@empty |
| 3144 |
\global\let\adl@preamble\@preamble \endgroup |
| 3145 |
\let\@preamble\adl@preamble |
| 3146 |
\def\@sharp{#3}\let\protect\relax |
| 3147 |
\adl@activatepbox |
| 3148 |
\adl@preaminit |
| 3149 |
\@arstrut \@preamble\hbox{}\endgroup |
| 3150 |
\global\advance\adl@currentcolumn#1\ignorespaces} |
| 3151 |
\ifadl@usingarypkg |
| 3152 |
\def\adl@mcaddamp{\if@firstamp\@firstampfalse \else\@preamerror5\fi} |
| 3153 |
\let\adl@activatepbox\relax |
| 3154 |
\else |
| 3155 |
\let\adl@mcaddamp\@addamp |
| 3156 |
\def\adl@activatepbox{\let\@startpbox\@@startpbox |
| 3157 |
\let\@endpbox\@@endpbox} |
| 3158 |
\fi |
| 3159 |
|
| 3160 |
% \end{macrocode} |
| 3161 |
% |
| 3162 |
% \begin{macro}{\adl@mcarrayrule} |
| 3163 |
% \begin{macro}{\adl@mcarraydashrule} |
| 3164 |
% \begin{macro}{\adl@mcargarraydashrule} |
| 3165 |
% \changes{v1.4-2-1}{1999/06/25} |
| 3166 |
% {Modified to pretend \texttt{p} or \texttt{@} depending on if |
| 3167 |
% \textsf{array} is in use.} |
| 3168 |
% \SpecialIndex{\adl@arrayrule} |
| 3169 |
% \SpecialIndex{\adl@arraydashrule} |
| 3170 |
% \SpecialIndex{\adl@argarraydashrule} |
| 3171 |
% \SpecialIndex{\adl@currentcolumn} |
| 3172 |
% |
| 3173 |
% The preamble parts for vertical lines are constructed by the macros |
| 3174 |
% |\adl@mcarrayrule|, |\adl@mcarraydashrule| and |\adl@mcargarraydashrule| |
| 3175 |
% to which the first argument \meta{$n$} of |\multicolumn| is passed to know |
| 3176 |
% the number of columns to be |\span|-ned. They are similar to their |
| 3177 |
% relatives for main preamble, |\adl@arrayrule|, etc., but the arguments |
| 3178 |
% \meta{$c^L$} and \meta{$c^R$} passed to |\adl@xarraydashrule| are; |
| 3179 |
% $$ |
| 3180 |
% c^L=c,\qquad c^R=c+n-1 |
| 3181 |
% $$ |
| 3182 |
% where $c={}$|\adl@currentcolumn|. This makes leading vertical lines drawn |
| 3183 |
% at the left edge of the leftmost |\span|-ned column and trailing ones at |
| 3184 |
% the right edge of the rightmost column. |
| 3185 |
% \end{macro}\end{macro}\end{macro} |
| 3186 |
% |
| 3187 |
% \begin{macrocode} |
| 3188 |
\def\adl@mcarrayrule#1{\@tempcnta#1\advance\@tempcnta\adl@currentcolumn |
| 3189 |
\advance\@tempcnta\m@ne |
| 3190 |
\adl@xarraydashrule |
| 3191 |
{\adl@currentcolumn}{\@tempcnta}{{\z@/\z@}}} |
| 3192 |
\def\adl@mcarraydashrule#1{\@tempcnta#1\advance\@tempcnta\adl@currentcolumn |
| 3193 |
\advance\@tempcnta\m@ne |
| 3194 |
\adl@xarraydashrule |
| 3195 |
{\adl@currentcolumn}{\@tempcnta}% |
| 3196 |
{{\dashlinedash/\dashlinegap}}} |
| 3197 |
\def\adl@mcargarraydashrule#1{\@tempcnta#1\advance\@tempcnta\adl@currentcolumn |
| 3198 |
\advance\@tempcnta\m@ne |
| 3199 |
\adl@xarraydashrule |
| 3200 |
{\adl@currentcolumn}{\@tempcnta}{}% |
| 3201 |
\@chclass\adl@class@iiiorvii \let\@classv\adl@classvfordash} |
| 3202 |
|
| 3203 |
%%^L |
| 3204 |
% \end{macrocode} |
| 3205 |
% |
| 3206 |
% |
| 3207 |
% |
| 3208 |
% \subsection{End of Rows} |
| 3209 |
% \label{sec:imp-eor} |
| 3210 |
% |
| 3211 |
% \begin{macro}{\@xarraycr} |
| 3212 |
% \changes{v1.4-2-1}{1999/06/25} |
| 3213 |
% {The version for \textsf{array} is introduced.} |
| 3214 |
% \begin{macro}{\@xtabularcr} |
| 3215 |
% \begin{macro}{\@xargarraycr} |
| 3216 |
% \begin{macro}{\@yargarraycr} |
| 3217 |
% \SpecialIndex{\ifadl@usingarypkg} |
| 3218 |
% |
| 3219 |
% At the end of the $i\th$ row, we have to calculate $h_i$ which is the height |
| 3220 |
% plus depth of the row, and add elements \meta{$C^L_i,h_i$} and |
| 3221 |
% \meta{$C^R_i,h_i$} to $R^L$ and $R^R$. To do this, |\cr|-s in the macros |
| 3222 |
% \hbox{|\@xarraycr|}, |\@xtabularcr|, |\@xargarraycr| are replaced with our |
| 3223 |
% own |\adl@cr|. The macro |\@yargarraycr|\meta{dimen} is also modified but |
| 3224 |
% its |\cr| is replaced with |\adl@argcr|\meta{dimen} to add (negative) |
| 3225 |
% |\dimen| to $h_i$. Note that |\@xargarraycr|\meta{dimen} uses ordinary |
| 3226 |
% |\adl@cr| because the extra vertical space of \meta{dimen} is inserted to |
| 3227 |
% the last column. |
| 3228 |
% |
| 3229 |
% Note that the implementation of |\@xarraycr| is slightly different between |
| 3230 |
% \LaTeX{} and \textsf{array}, we have to have two versions and choose one. |
| 3231 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 3232 |
% |
| 3233 |
% \begin{macrocode} |
| 3234 |
|
| 3235 |
%% End of row |
| 3236 |
|
| 3237 |
\ifadl@usingarypkg |
| 3238 |
\def\@xarraycr{\@ifnextchar[{\@argarraycr}{\ifnum0=`{}\fi\adl@cr}} |
| 3239 |
\else |
| 3240 |
\def\@xarraycr{\@ifnextchar[{\@argarraycr}{\ifnum0=`{\fi}${}\adl@cr}} |
| 3241 |
\fi |
| 3242 |
\def\@xtabularcr{\@ifnextchar[{\@argtabularcr}{\ifnum0=`{\fi}\adl@cr}} |
| 3243 |
\def\@xargarraycr#1{\@tempdima#1\advance\@tempdima\dp\@arstrutbox |
| 3244 |
\vrule\@height\z@\@depth\@tempdima\@width\z@ |
| 3245 |
\adl@cr} |
| 3246 |
\def\@yargarraycr#1{\adl@argcr{#1}\noalign{\vskip #1}} |
| 3247 |
|
| 3248 |
% \end{macrocode} |
| 3249 |
% |
| 3250 |
% \begin{macro}{\adl@cr} |
| 3251 |
% \begin{macro}{\adl@argcr} |
| 3252 |
% The macro |\adl@cr| and |\adl@argcr| perform |\cr| and then invoke the |
| 3253 |
% common macro |\adl@@cr|\meta{x}. The argument \meta{x} is the extra |
| 3254 |
% (negative) vertical space for |\adl@argcr|, while it is 0 for |\adl@cr|. |
| 3255 |
% \end{macro}\end{macro} |
| 3256 |
% |
| 3257 |
% \begin{macro}{\adl@@cr} |
| 3258 |
% \changes{v1.4-2-6}{1999/06/25} |
| 3259 |
% {Modified to set \cs{adl@finaldepth}.} |
| 3260 |
% \changes{v1.6}{2003/8/25} |
| 3261 |
% {Modified to insert \cs{adl@discard}.} |
| 3262 |
% \SpecialIndex{\@arstrutbox} |
| 3263 |
% \SpecialIndex{\adl@totalheight} |
| 3264 |
% \SpecialIndex{\adl@colsL} |
| 3265 |
% \SpecialIndex{\adl@colsR} |
| 3266 |
% \SpecialIndex{\adl@rowsL} |
| 3267 |
% \SpecialIndex{\adl@rowsR} |
| 3268 |
% \SpecialIndex{\adl@connect} |
| 3269 |
% \SpecialIndex{\adl@discard} |
| 3270 |
% \SpecialIndex{\adl@finaldepth} |
| 3271 |
% \SpecialIndex{\adl@height} |
| 3272 |
% \SpecialIndex{\adl@depth} |
| 3273 |
% \SpecialIndex{\adl@currentcolumn} |
| 3274 |
% |
| 3275 |
% The macro |\adl@@cr|\meta{x} at first calculate $h_i$ as follows. The |
| 3276 |
% registers |\adl@height|${}=\eta$ and |\adl@depth|${}=\delta$ have the |
| 3277 |
% maximum height and depth of the columns in the row. However, they could |
| 3278 |
% be smaller than the height and/or depth of |\@arstrutbox|, $\eta_s$ and |
| 3279 |
% $\delta_s$. If so, the height and/or depth of the row are $\eta_s$ and |
| 3280 |
% $\delta_s$. Therefore, $h_i$ is caluclated by; |
| 3281 |
% $$ |
| 3282 |
% h_i = \max(\eta,\eta_s) + \max(\delta,\delta_s). |
| 3283 |
% $$ |
| 3284 |
% Additionally, if the extra space \meta{x} is negative, a vertical space of |
| 3285 |
% $x$ is inserted below the row\footnote{ |
| 3286 |
% |
| 3287 |
% Before v1.54, negative \meta{x} shrinks the height of the row by $\vert |
| 3288 |
% x\vert$. Although the former result may be more appropriate if the row |
| 3289 |
% has vertical lines than the current because lines extrude to the next row |
| 3290 |
% now, new feature is considered compatible with original |
| 3291 |
% \texttt{array}\slash \texttt{tabular}.}. |
| 3292 |
% |
| 3293 |
% Thus the integer value of $h_i+x$ is |
| 3294 |
% |\global|-ly added to |\adl@totalheight|, and the elements |
| 3295 |
% \meta{$C^L_i{=}\cs{adl@colsL},h_i$} and |
| 3296 |
% \meta{$C^R_i{=}\cs{adl@colsR},h_i$} are added to the tail of |
| 3297 |
% $R^L={}$|\adl@rowsL| and $R^C={}$|\adl@rowsR|\@. If $x$ is not 0 |
| 3298 |
% (negative), {\it discard}$(x)$ or {\it connect}$(x)$ is also added after |
| 3299 |
% \meta{$C^{L/R}_i,h_i$} according to the current environment (|longtable| |
| 3300 |
% or not). In the real implementation, $R^L$ and $R^C$ has the following |
| 3301 |
% format of \meta{rows}. |
| 3302 |
% |
| 3303 |
% |
| 3304 |
% \begin{eqnarray*} |
| 3305 |
% \meta{rows}&::=& |
| 3306 |
% [\meta{row}\hbox{\tt;}]^*\\ |
| 3307 |
% \meta{row}&::=& |
| 3308 |
% \hbox{{\tt(}\meta{cols}{\tt/}\meta{$h_i$}{\tt)}}\\ |
| 3309 |
% \meta{cols}&::=& |
| 3310 |
% [\hbox{\cs{elt}\Meta{c}\Meta{d}\Meta{g}}]^*\ \vert\qquad\qquad& |
| 3311 |
% \hbox to.3\textwidth{\ldots\ $C^L$ or $C^R$\hss}\cr |
| 3312 |
% && \cs{adl@connect}\ \vert& |
| 3313 |
% \hbox to.3\textwidth{\ldots\ for {\it connect}$(h_i)$\hss}\cr |
| 3314 |
% && \cs{adl@discard}\ \vert& |
| 3315 |
% \hbox to.3\textwidth{\ldots\ for {\it discard}$(h_i)$\hss}\cr |
| 3316 |
% && \cs{relax}& |
| 3317 |
% \hbox to.3\textwidth{\ldots\ for {\it disconnect}$(h_i)$\hss}\cr |
| 3318 |
% \noalign{\vskip-\baselineskip} |
| 3319 |
% \end{eqnarray*} |
| 3320 |
% |
| 3321 |
% Since |\adl@discard| is |\def|-ined as |\adl@connect| by |\adl@arrayinit|, |
| 3322 |
% added |\adl@discard| transforms itself into |\adl@connect| if current |
| 3323 |
% envrionment is not |longtable|. Otherwise, as we make |\adl@discard| |
| 3324 |
% |\let|-equal to |\relax| when a |longtable| environment starts, it keeps |
| 3325 |
% its own form. |
| 3326 |
% |
| 3327 |
% Then, |\adl@finaldepth| is set to |\adl@depth| if $x$ is zero, or to zero |
| 3328 |
% otherwise (negative), in order to make the depth of |array|\slash|tabular| |
| 3329 |
% equal to that of the last row. Finally, |\adl@colsL|, |\adl@colsR|, |
| 3330 |
% |\adl@currentcolumn|, |\adl@height| and |\adl@depth| are reinitialized to |
| 3331 |
% process the next row. |
| 3332 |
% \end{macro} |
| 3333 |
% |
| 3334 |
% \begin{macrocode} |
| 3335 |
\def\adl@cr{\cr\noalign{\adl@@cr\z@}} |
| 3336 |
\def\adl@argcr#1{\cr\noalign{\adl@@cr{#1}}} |
| 3337 |
\def\adl@@cr#1{ |
| 3338 |
\ifdim\adl@height<\ht\@arstrutbox \adl@height\ht\@arstrutbox\fi |
| 3339 |
\ifdim\adl@depth<\dp\@arstrutbox \adl@depth\dp\@arstrutbox\fi |
| 3340 |
\advance\adl@height\adl@depth |
| 3341 |
\global\advance\adl@totalheight\adl@height |
| 3342 |
\@tempdima#1\relax \global\advance\adl@totalheight\@tempdima |
| 3343 |
\xdef\adl@rowsL{\adl@rowsL |
| 3344 |
(\adl@colsL/\number\adl@height);% |
| 3345 |
\ifdim#1=\z@\else (\adl@discard/\number\@tempdima);\fi}% |
| 3346 |
\xdef\adl@rowsR{\adl@rowsR |
| 3347 |
(\adl@colsR/\number\adl@height);% |
| 3348 |
\ifdim#1=\z@\else (\adl@discard/\number\@tempdima);\fi}% |
| 3349 |
\gdef\adl@colsL{}\gdef\adl@colsR{} |
| 3350 |
\global\adl@currentcolumn\@ne |
| 3351 |
\ifdim#1=\z@ \global\adl@finaldepth\adl@depth |
| 3352 |
\else \global\adl@finaldepth\z@\fi |
| 3353 |
\global\adl@height\z@ \global\adl@depth\z@} |
| 3354 |
|
| 3355 |
%%^L |
| 3356 |
% \end{macrocode} |
| 3357 |
% |
| 3358 |
% |
| 3359 |
% |
| 3360 |
% \subsection{Horizontal Lines} |
| 3361 |
% \label{sec:imp-hline} |
| 3362 |
% |
| 3363 |
% \begin{macro}{\hline} |
| 3364 |
% \changes{v1.4-2-6}{1999/06/25} |
| 3365 |
% {Modified to set \cs{adl@finaldepth} to zero.} |
| 3366 |
% \changes{v1.7-1}{2004/5/21} |
| 3367 |
% {Modified to shift up if null-wide.} |
| 3368 |
% \begin{macro}{\cline} |
| 3369 |
% \changes{v1.4-2-6}{1999/06/25} |
| 3370 |
% {Modified to set \cs{adl@finaldepth} to zero.} |
| 3371 |
% \changes{v1.7-1}{2004/5/21} |
| 3372 |
% {Modified to shift up if null-wide.} |
| 3373 |
% \SpecialIndex{\adl@hline} |
| 3374 |
% \SpecialIndex{\adl@xhline} |
| 3375 |
% \SpecialIndex{\adl@connect} |
| 3376 |
% \SpecialIndex{\adl@finaldepth} |
| 3377 |
% \SpecialIndex{\adl@org@cline} |
| 3378 |
% |
| 3379 |
% The macro |\hline| is modified to insert |\vskip-\arrayrulewidth| before |
| 3380 |
% drawing if |\ADLnullwidehline| is in effect, or to add the element ${\it |
| 3381 |
% connect}(w)={}$|(\adl@connect/|\allowbreak|\number\arrayrulewidth)| to the |
| 3382 |
% end of $R^L$ and $R^R$ by |\adl@hline| otherwise. The other modifications |
| 3383 |
% are to set |\adl@finaldepth| to zero for the case that the last vertical |
| 3384 |
% item is |\hline|, and to check if it is followed by not only |\hline| but |
| 3385 |
% also |\hdashline| by |\adl@xhline|. |
| 3386 |
% |
| 3387 |
% The macro |\cline| is also modified to set |\adl@finaldepth| to zero. As |
| 3388 |
% for the feature of |\ADLnullwidehline|, it inserts |\vskip-\arrayrulewidth| |
| 3389 |
% to shift the line up befor drawing, and |\vskip\arrayrulewidth| after |
| 3390 |
% drawing to cancel the negative skip inserted by |\adl@org@cline|. |
| 3391 |
% \end{macro}\end{macro} |
| 3392 |
% |
| 3393 |
% \begin{macrocode} |
| 3394 |
|
| 3395 |
%% Horizontal Lines |
| 3396 |
|
| 3397 |
\def\hline{\noalign{\ifnum0=`}\fi |
| 3398 |
\ifadl@zwhrule \vskip-\arrayrulewidth |
| 3399 |
\else \adl@hline\adl@connect\arrayrulewidth \fi |
| 3400 |
\hrule\@height\arrayrulewidth |
| 3401 |
\global\adl@finaldepth\z@ |
| 3402 |
\futurelet\@tempa\adl@xhline} |
| 3403 |
\def\cline#1{\noalign{\global\adl@finaldepth\z@ |
| 3404 |
\ifadl@zwhrule \vskip-\arrayrulewidth\fi} |
| 3405 |
\adl@org@cline{#1}% |
| 3406 |
\noalign{\ifadl@zwhrule \vskip\arrayrulewidth\fi}} |
| 3407 |
|
| 3408 |
% \end{macrocode} |
| 3409 |
% |
| 3410 |
% \begin{macro}{\hdashline} |
| 3411 |
% \changes{v1.4-2-5}{1999/06/25} |
| 3412 |
% {Modified to make \cs{adl@hdashline} usable for |
| 3413 |
% \cs{first}\slash\texttt{lasthdashline}.} |
| 3414 |
% \begin{macro}{\adl@hdashline} |
| 3415 |
% \changes{v1.4-2-5}{1999/06/25} |
| 3416 |
% {Modified to be usable for |
| 3417 |
% \cs{first}\slash\texttt{lasthdashline}.} |
| 3418 |
% \changes{v1.7-1}{2004/5/21} |
| 3419 |
% {Modified for null-wide horizontal lines.} |
| 3420 |
% \begin{macro}{\adl@ihdashline} |
| 3421 |
% \changes{v1.4-2-5}{1999/06/25} |
| 3422 |
% {Introduced as the substitute of old \cs{adl@hdashline}.} |
| 3423 |
% \changes{v1.7-1}{2004/5/21} |
| 3424 |
% {\cs{adl@hline} is moved to \cs{adl@hdashline} for null-wide lines.} |
| 3425 |
% \SpecialIndex{\adl@hcline} |
| 3426 |
% \SpecialIndex{\dashlinedash} |
| 3427 |
% \SpecialIndex{\dashlinegap} |
| 3428 |
% |
| 3429 |
% The macro |\hdashline| calls |\adl@hdashline| to open the |\noalign| |
| 3430 |
% construct by the well-known trick |{\ifnum0=`}\fi| and then to invoke |
| 3431 |
% |\adl@ihdashline| checking the existence of its optional argument |
| 3432 |
% |[|\meta{dash}|/|\meta{gap}|]|. Before the invocation, it inserts |
| 3433 |
% |\vskip-\arrayrulewidth| if |\ADLnullwidehline| is in effect, or adds |
| 3434 |
% ${\it connect}(w)$ to the end of $R^L$ and $R^R$. Then |\adl@ihdashline| |
| 3435 |
% closes the |\noalign| by |\ifnum0=`{\fi}| to start the pseudo row for the |
| 3436 |
% horizontal dash-line. Before the dash-line is drawn by |\adl@hcline| |
| 3437 |
% which is also used for |\cdashline|, all the columns are |\span|-ned by |
| 3438 |
% giving |\adl@columns| to |\multispan|. Finally, the |\noalign| is opened |
| 3439 |
% again and |\adl@xhline| is invoked to check whether |\h(dash)line| is |
| 3440 |
% followed. |
| 3441 |
% \end{macro}\end{macro}\end{macro} |
| 3442 |
% |
| 3443 |
% \begin{macro}{\adl@inactivehdl} |
| 3444 |
% \changes{v1.4-2-3}{1999/06/25} |
| 3445 |
% {Introduced to emulate \cs{hdashline} by \cs{hline}.} |
| 3446 |
% \changes{v1.7-1}{2004/5/21} |
| 3447 |
% {Modified to shift up if null-wide.} |
| 3448 |
% |
| 3449 |
% If |\ADLinactivate| is in effect, |\adl@ihdashline| is |\let|-equal |
| 3450 |
% to |\adl@inactivehdl|. This macro simply puts a |\hrule| discarding its |
| 3451 |
% arguments after inserting |\vskip|\allowbreak|-\arrayrulewidth| if |
| 3452 |
% |\ADLnullwidehline| is in effect. |
| 3453 |
% \end{macro} |
| 3454 |
% |
| 3455 |
% \begin{macrocode} |
| 3456 |
\def\hdashline{\adl@hdashline\adl@ihdashline} |
| 3457 |
\def\adl@hdashline#1{\noalign{\ifnum0=`}\fi |
| 3458 |
\ifadl@zwhrule \vskip-\arrayrulewidth |
| 3459 |
\else \adl@hline\adl@connect\arrayrulewidth \fi |
| 3460 |
\@ifnextchar[%] |
| 3461 |
{#1}% |
| 3462 |
{#1[\dashlinedash/\dashlinegap]}} |
| 3463 |
\def\adl@ihdashline[#1/#2]{\ifnum0=`{\fi}% |
| 3464 |
\multispan{\adl@columns}\unskip \adl@hcline\z@[#1/#2]% |
| 3465 |
\noalign{\ifnum0=`}\fi |
| 3466 |
\futurelet\@tempa\adl@xhline} |
| 3467 |
\def\adl@inactivehdl[#1/#2]{\ifadl@zwhrule \vskip-\arrayrulewidth \fi |
| 3468 |
\hrule\@height\arrayrulewidth |
| 3469 |
\futurelet\@tempa\adl@xhline} |
| 3470 |
|
| 3471 |
% \end{macrocode} |
| 3472 |
% |
| 3473 |
% \begin{macro}{\adl@xhline} |
| 3474 |
% \SpecialIndex{\@xhline} |
| 3475 |
% |
| 3476 |
% The macro |\adl@xhline| is the counterpart of the original |\@xhline|. |
| 3477 |
% This is introduced to check the mixed sequence of |\hline| and |
| 3478 |
% |\hdashline|, and to add the element ${\it |
| 3479 |
% disconnect}(s)={}$|(\relax/\doublerulesep)| to the end of $R^L$ and $R^R$ |
| 3480 |
% by |\adl@hline| if a pair of |\h(dash)line| is found. |
| 3481 |
% \end{macro} |
| 3482 |
% |
| 3483 |
% \begin{macrocode} |
| 3484 |
\def\adl@xhline{\ifx\@tempa\hline \adl@ixhline\fi |
| 3485 |
\ifx\@tempa\hdashline \adl@ixhline\fi |
| 3486 |
\ifnum0=`{\fi}} |
| 3487 |
\def\adl@ixhline{\vskip\doublerulesep \adl@hline\relax\doublerulesep} |
| 3488 |
|
| 3489 |
% \end{macrocode} |
| 3490 |
% |
| 3491 |
% \begin{macro}{\adl@hline} |
| 3492 |
% \SpecialIndex{\adl@totalheight} |
| 3493 |
% \SpecialIndex{\adl@rowsL} |
| 3494 |
% \SpecialIndex{\adl@rowsR} |
| 3495 |
% |
| 3496 |
% The macro |\adl@hline|\meta{cs}\meta{dimen} |\global|-ly adds the integer |
| 3497 |
% value of \meta{dimen} to |\adl@totalheight| and adds the element |
| 3498 |
% |(|\meta{cs}|/\number|\meta{dimen}|)| to the tail of $R^L$ and $R^R$. The |
| 3499 |
% arguments \meta{cs}\meta{dimen} are |\adl@connect\arrayrulewidth| for |
| 3500 |
% ${\it connect}(w)$ or |\relax\doublerulesep| for ${\it disconnect}(s)$. |
| 3501 |
% \end{macro} |
| 3502 |
% |
| 3503 |
% \begin{macrocode} |
| 3504 |
\def\adl@hline#1#2{\@tempcnta#2 |
| 3505 |
\global\advance\adl@totalheight\@tempcnta |
| 3506 |
\xdef\adl@rowsL{\adl@rowsL |
| 3507 |
(#1/\number\@tempcnta);}% |
| 3508 |
\xdef\adl@rowsR{\adl@rowsR |
| 3509 |
(#1/\number\@tempcnta);}} |
| 3510 |
|
| 3511 |
% \end{macrocode} |
| 3512 |
% |
| 3513 |
% \begin{macro}{\cdashline} |
| 3514 |
% \changes{v1.4-2-7}{1999/06/25} |
| 3515 |
% {Modified to call renamed \cs{adl@cdline}.} |
| 3516 |
% \begin{macro}{\adl@cdline} |
| 3517 |
% \changes{v1.4-2-7}{1999/06/25} |
| 3518 |
% {Renamed and modified to call renamed \cs{adl@cdlinea}\slash |
| 3519 |
% \texttt{b}.} |
| 3520 |
% \changes{v1.7-1}{2004/5/21} |
| 3521 |
% {Modified to shift up if null-wide.} |
| 3522 |
% \begin{macro}{\adl@cdlinea} |
| 3523 |
% \changes{v1.4-2-7}{1999/06/25} |
| 3524 |
% {Renamed.} |
| 3525 |
% \begin{macro}{\adl@cdlineb} |
| 3526 |
% \changes{v1.4-2-7}{1999/06/25} |
| 3527 |
% {Renamed.} |
| 3528 |
% \SpecialIndex{\@cline} |
| 3529 |
% \SpecialIndex{\adl@cla} |
| 3530 |
% \SpecialIndex{\adl@clb} |
| 3531 |
% \SpecialIndex{\adl@org@cline} |
| 3532 |
% \SpecialIndex{\adl@hcline} |
| 3533 |
% |
| 3534 |
% The macro |\cdashline| at first opens |\noalign| and then invokes |
| 3535 |
% |\adl@cdline| checking the existence of its optional argument |
| 3536 |
% |[|\meta{dash}|/|\meta{gap}|]|. The macro |\adl@cdline| first inserts |
| 3537 |
% |\vskip-\arrayrulewidth| if |\ADLnullwidehline| is in effect. Then it |
| 3538 |
% performs column |\span|-ing by the code based on that of |\@cline| in |
| 3539 |
% \LaTeX-2.09 because \LaTeXe's version will not work with \LaTeX-2.09. The |
| 3540 |
% main job is done by |\adl@hcline| after the target columns are |\span|-ned |
| 3541 |
% by |\adl@cdlinea| or |\adl@cdlineb|. |
| 3542 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 3543 |
% |
| 3544 |
% \begin{macro}{\adl@inactivecdl} |
| 3545 |
% \changes{v1.4-2-3}{1999/06/25} |
| 3546 |
% {Introduced to emulate \cs{cdashline} by \cs{cline}.} |
| 3547 |
% \changes{v1.7-1}{2004/5/21} |
| 3548 |
% {Modified to invoke \cs{cline} rather than \cs{adl@orgcline} for |
| 3549 |
% null-wide.} |
| 3550 |
% |
| 3551 |
% If |\ADLinactivate| is in effect, |\adl@cdline| is |\let|-equal |
| 3552 |
% to |\adl@inactivecdl|. This macro simply calls our own |\cline|, after |
| 3553 |
% closing the |\noalign| opened by |\cdashline|. |
| 3554 |
% \end{macro} |
| 3555 |
% |
| 3556 |
% \begin{macrocode} |
| 3557 |
\def\cdashline#1{\noalign{\ifnum0=`}\fi |
| 3558 |
\@ifnextchar[%] |
| 3559 |
{\adl@cdline[#1]}% |
| 3560 |
{\adl@cdline[#1][\dashlinedash/\dashlinegap]}} |
| 3561 |
\def\adl@cdline[#1-#2]{\ifadl@zwhrule \vskip-\arrayrulewidth \fi |
| 3562 |
\global\adl@cla#1\relax |
| 3563 |
\global\advance\adl@cla\m@ne |
| 3564 |
\ifnum\adl@cla>\z@ \global\let\@gtempa\adl@cdlinea |
| 3565 |
\else \global\let\@gtempa\adl@cdlineb\fi |
| 3566 |
\global\adl@clb#2\relax |
| 3567 |
\global\advance\adl@clb-\adl@cla \ifnum0=`{\fi} |
| 3568 |
\@gtempa{-\arrayrulewidth}} |
| 3569 |
\def\adl@cdlinea{\multispan\adl@cla &\multispan\adl@clb \unskip \adl@hcline} |
| 3570 |
\def\adl@cdlineb{\multispan\adl@clb \unskip \adl@hcline} |
| 3571 |
|
| 3572 |
\def\adl@inactivecdl[#1-#2][#3]{\ifnum0=`{\fi}\cline{#1-#2}} |
| 3573 |
|
| 3574 |
% \end{macrocode} |
| 3575 |
% |
| 3576 |
% \begin{macro}{\adl@hcline} |
| 3577 |
% \changes{v1.4-2-4}{1999/06/25} |
| 3578 |
% {Modified to use \cs{adl@draw}.} |
| 3579 |
% \changes{v1.54-3}{2003/08/25} |
| 3580 |
% {Omit \cs{vskip} if the space is 0.} |
| 3581 |
% \changes{v1.7-1}{2004/5/21} |
| 3582 |
% {Modified not to shift null-wide \cs{cdashline} down.} |
| 3583 |
% \SpecialIndex{\adl@draw} |
| 3584 |
% \SpecialIndex{\adl@vrule} |
| 3585 |
% \SpecialIndex{\adl@finaldepth} |
| 3586 |
% |
| 3587 |
% The macro |\adl@hcline|\meta{w}|[|\meta{d}|/|\meta{g}|]| draws a |
| 3588 |
% horizontal dash-line of dash size $d$ and gap size $g$ for |\hdashline| |
| 3589 |
% and |\cdashline| in the |\span|-ned columns by |\adl@draw|. As we will |
| 3590 |
% discuss in \S\ref{sec:imp-draw}, the macro requires $d$ and $g$ are |
| 3591 |
% passed through |\@tempdima| and \hbox{|\@tempdimb|}, and control sequences |
| 3592 |
% \meta{rule}, \meta{skip} and \meta{box} are passed through its arguments |
| 3593 |
% to make it usable for both horizontal and vertical lines. Then the |
| 3594 |
% vertical space of $w$, $-$|\arrayrulewidth| for |\cdashline|, is |
| 3595 |
% inserted if it is not 0 (for |\hdashline|) and |\ADLnullwidehline| is not |
| 3596 |
% in effect. |
| 3597 |
% \end{macro} |
| 3598 |
% |
| 3599 |
% \begin{macrocode} |
| 3600 |
\def\adl@hcline#1[#2/#3]{\@tempdima#2\relax \@tempdimb#3\relax |
| 3601 |
\adl@draw\adl@vrule\hskip\hbox \cr |
| 3602 |
\noalign{\global\adl@finaldepth\z@ \ifdim#1=\z@\else |
| 3603 |
\ifadl@zwhrule\else \vskip#1\fi\fi}} |
| 3604 |
|
| 3605 |
% \end{macrocode} |
| 3606 |
% |
| 3607 |
% \begin{macro}{\firsthdashline} |
| 3608 |
% \changes{v1.4-2-5}{1999/06/25} |
| 3609 |
% {Introduced as the dashed version of \cs{firsthline}.} |
| 3610 |
% \begin{macro}{\lasthdashline} |
| 3611 |
% \changes{v1.4-2-5}{1999/06/25} |
| 3612 |
% {Introduced as the dashed version of \cs{lasthline}.} |
| 3613 |
% \SpecialIndex{\firsthline} |
| 3614 |
% \SpecialIndex{\lasthline} |
| 3615 |
% \SpecialIndex{\adl@hdashline} |
| 3616 |
% \SpecialIndex{\adl@ihdashline} |
| 3617 |
% |
| 3618 |
% If \textsf{array} is in use, we wish to have dashed counterparts of |
| 3619 |
% |\first|\slash|lasthline| named |\first|\slash|lasthdashline|, which |
| 3620 |
% simply call |\adl@hdashline| with an argument to call |
| 3621 |
% |\adl@first|\slash|lasthdashline| after closing |\noalign| opened by |
| 3622 |
% |\adl@hdashline|. |
| 3623 |
% \end{macro}\end{macro} |
| 3624 |
% |
| 3625 |
% \begin{macro}{\adl@defflhdl} |
| 3626 |
% \changes{v1.4-2-5}{1999/06/25} |
| 3627 |
% {Introduced for the tricky definition of \cs{adl@first}\slash |
| 3628 |
% \texttt{lasthdashline}.} |
| 3629 |
% \begin{macro}{\adl@idefflhdl} |
| 3630 |
% \changes{v1.4-2-5}{1999/06/25} |
| 3631 |
% {Introduced for the tricky definition of \cs{adl@first}\slash |
| 3632 |
% \texttt{lasthdashline}.} |
| 3633 |
% \begin{macro}{\adl@firsthdashline} |
| 3634 |
% \changes{v1.4-2-5}{1999/06/25} |
| 3635 |
% {Introduced as the body of \cs{firsthdashline}.} |
| 3636 |
% \begin{macro}{\adl@lasthdashline} |
| 3637 |
% \changes{v1.4-2-5}{1999/06/25} |
| 3638 |
% {Introduced as the body of \cs{lasthdashline}.} |
| 3639 |
% The macros |\adl@first|\slash|lasthdashline|, however, are defined in a |
| 3640 |
% tricky manner to replace |\hline| in |\first|\slash|lasthline| with; |
| 3641 |
% |
| 3642 |
% \begin{quote} |
| 3643 |
% |\adl@hdashline\adl@ihdashline[|\meta{dash}|/|\meta{gap}|]| |
| 3644 |
% \end{quote} |
| 3645 |
% |
| 3646 |
% in order to avoid copy-and-replace. To do that, we define |\adl@defflhdl| |
| 3647 |
% and |\adl@idefflhdl| in which the body of |\first|\slash|lasthline| is |
| 3648 |
% expanded by |\exapndafter| and the parts preceding and following |\hline| |
| 3649 |
% are extracted. Then the preceding part \meta{p}, the calling sequence of |
| 3650 |
% |\adl@hdashline|, and the following part \meta{f} are connected to be the |
| 3651 |
% body of |\adl@first|\slash|lasthdashline|. Thus we define |
| 3652 |
% |\adl@firsthdashline| as follows. |
| 3653 |
% |
| 3654 |
% \begin{quote} |
| 3655 |
% |\def\adl@firsthdashline|\texttt{[\#1/\#2]}|{%|\\ |
| 3656 |
% \mbox{\qquad}\meta{p}\\ |
| 3657 |
% \mbox{\qquad}|\adl@hdashline\adl@ihdashline|\texttt{[\#1/\#2]}\\ |
| 3658 |
% \mbox{\qquad}\meta{f}|}| |
| 3659 |
% \end{quote} |
| 3660 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 3661 |
% |
| 3662 |
% \begin{macrocode} |
| 3663 |
\ifadl@usingarypkg |
| 3664 |
\def\firsthdashline{\adl@hdashline{\ifnum0=`{\fi}\adl@firsthdashline}} |
| 3665 |
\def\lasthdashline{\adl@hdashline{\ifnum0=`{\fi}\adl@lasthdashline}} |
| 3666 |
|
| 3667 |
\def\adl@defflhdl#1{\def\@tempa{#1} |
| 3668 |
\expandafter\adl@idefflhdl} |
| 3669 |
\def\adl@idefflhdl#1\hline#2\@nil{% |
| 3670 |
\@namedef\@tempa[##1/##2]{#1\adl@hdashline\adl@ihdashline[##1/##2]#2}} |
| 3671 |
\adl@defflhdl{adl@firsthdashline}\firsthline\@nil |
| 3672 |
\adl@defflhdl{adl@lasthdashline}\lasthline\@nil |
| 3673 |
\fi |
| 3674 |
|
| 3675 |
%%^L |
| 3676 |
% \end{macrocode} |
| 3677 |
% |
| 3678 |
% |
| 3679 |
% \subsection{End of Environment} |
| 3680 |
% \label{sec:imp-eoe} |
| 3681 |
% |
| 3682 |
% \begin{macro}{\endarray} |
| 3683 |
% \changes{v1.74}{2018/09/26} |
| 3684 |
% {Add conditional invokation of \cs{@arrayright}.} |
| 3685 |
% \begin{macro}{\endtabular} |
| 3686 |
% \changes{v1.7}{2004/5/21} |
| 3687 |
% {Modified to refer proper \cs{endarray} depending on the |
| 3688 |
% exsistance of \textsf{colortbl}.} |
| 3689 |
% \begin{macro}{\endtabular*} |
| 3690 |
% \SpecialIndex{\adl@arrayrestore} |
| 3691 |
% |
| 3692 |
% The macros to close the |array|/|tabular| environment, |\endarray| and |
| 3693 |
% |\endtabular(*)|, are modified so that they invoke |\adl@endarray| to draw |
| 3694 |
% vertical lines just before closing |\halign|, and |\adl@arrayrestore| to |
| 3695 |
% restore registers and data structures |\global|-ly modified in the |
| 3696 |
% environment. Note that \textsf{array} and related packages such as |
| 3697 |
% \textsf{delarray} define a macro |\@arrayright| as the closing hook and |
| 3698 |
% thus we invoke it if it is defined. |
| 3699 |
% \end{macro}\end{macro}\end{macro} |
| 3700 |
% |
| 3701 |
% \SpecialIndex{\@arrayright} |
| 3702 |
% |
| 3703 |
% \begin{macrocode} |
| 3704 |
|
| 3705 |
%% End of Environment |
| 3706 |
|
| 3707 |
\def\endarray{\adl@endarray \egroup \adl@arrayrestore \egroup |
| 3708 |
\csname @arrayright\endcsname} |
| 3709 |
\def\endtabular{\endarray $\egroup} |
| 3710 |
\expandafter\let\csname endtabular*\endcsname\endtabular |
| 3711 |
|
| 3712 |
% \end{macrocode} |
| 3713 |
% |
| 3714 |
% \begin{macro}{\adl@endarray} |
| 3715 |
% \changes{v1.4-2-6}{1999/06/25} |
| 3716 |
% {Modified to set the depth of \texttt{array}\slash\texttt{tabular} |
| 3717 |
% to \cs{adl@finaldepth}.} |
| 3718 |
% \begin{macro}{\adl@rows} |
| 3719 |
% \begin{macro}{\adl@addvl} |
| 3720 |
% \begin{macro}{\adl@vlrowL} |
| 3721 |
% \begin{macro}{\adl@vlrowR} |
| 3722 |
% \begin{macro}{\adl@vlrow} |
| 3723 |
% \SpecialIndex{\adl@height} |
| 3724 |
% \SpecialIndex{\adl@depth} |
| 3725 |
% \SpecialIndex{\adl@@cr} |
| 3726 |
% \SpecialIndex{\adl@currentcolumn} |
| 3727 |
% \SpecialIndex{\adl@rowsL} |
| 3728 |
% \SpecialIndex{\adl@rowsR} |
| 3729 |
% \SpecialIndex{\adl@makevlrL} |
| 3730 |
% \SpecialIndex{\adl@makevlrR} |
| 3731 |
% \SpecialIndex{\adl@drawvl} |
| 3732 |
% \SpecialIndex{\adl@finaldepth} |
| 3733 |
% |
| 3734 |
% The macro |\adl@endarray| at first closes the last row by |\crcr|. If this |
| 3735 |
% |\crcr| has real effect, we have to invoke |\adl@@cr| to perfrom our own |
| 3736 |
% end-of-row operations. We assume that the |\crcr| is effective if either |
| 3737 |
% |\adl@height| or |\adl@depth| has a non-zero value\footnote{ |
| 3738 |
% |
| 3739 |
% The author confesses that this rule is not strict and the introduction of a |
| 3740 |
% switch could improve the strictness.}. |
| 3741 |
% |
| 3742 |
% Then the rows to draw vertical lines $L_1$, \ldots, $L_n$; |
| 3743 |
% $$ |
| 3744 |
% \sigma_1 L_1 \sigma_2 L_2 \ldots L_{n-1}\sigma_n L_n\sigma_{n+1} |
| 3745 |
% $$ |
| 3746 |
% are created in |\adl@vlrowL| and |\adl@vlrowR| by |\adl@makevlrL| and |
| 3747 |
% |\adl@makevlrR|. In the real implementation, |
| 3748 |
% $L_k=\meta{$\gamma_k,\pi_k,\delta_k,\xi_k,\tau_k,\beta_k$}$ is represented |
| 3749 |
% as; |
| 3750 |
% |
| 3751 |
% \begin{quote} |
| 3752 |
% |\adl@vl{|$\beta_k$|}{|$\tau_k-\beta_k$|}{|$\delta_k$|}{|$\xi_k$|}|. |
| 3753 |
% \end{quote} |
| 3754 |
% |
| 3755 |
% Thus |\adl@vl| is made |\let|-equal to |\relax| when the rows are |
| 3756 |
% constructed and to \hbox{|\adl@@vl|} when the rows are put. |
| 3757 |
% |
| 3758 |
% Since |\adl@makevlrL| and |\adl@makevlrR| shares common macros, they |
| 3759 |
% conceptually have the following interface. |
| 3760 |
% |
| 3761 |
% \begin{quote} |
| 3762 |
% \begin{tabbing} |
| 3763 |
% \cs{adl@vlrow}${}={}$\cs{adl@makevlrL/R}(\= |
| 3764 |
% \cs{adl@rows}\,:\,\meta{$R^L$ or $R^R$},\\ |
| 3765 |
% \> \cs{adl@currentcolumn}\,:\,\meta{start column},\\ |
| 3766 |
% \> \cs{adl@addvl}\,:\,\meta{macro to add an element}) |
| 3767 |
% \end{tabbing} |
| 3768 |
% \end{quote} |
| 3769 |
% |
| 3770 |
% Thus they are invoked as; |
| 3771 |
% |
| 3772 |
% \begin{quote}\leavevmode |
| 3773 |
% \cs{adl@vlrowL}${}={}$\cs{adl@makevrL}( |
| 3774 |
% \cs{adl@rowsL}, |
| 3775 |
% 1, |
| 3776 |
% \cs{adl@addvlL})\\ |
| 3777 |
% \cs{adl@vlrowR}${}={}$\cs{adl@makevrR}( |
| 3778 |
% \cs{adl@rowsR}, |
| 3779 |
% \cs{adl@columns}, |
| 3780 |
% \cs{adl@addvlR}) |
| 3781 |
% \end{quote} |
| 3782 |
% |
| 3783 |
% \changes{v1.54-1}{2003/08/25} |
| 3784 |
% {Rows for vertical lines are replaced by \cs{adl@drawvl}.} |
| 3785 |
% |
| 3786 |
% Finally, after constructed rows for vertical lines are put by |
| 3787 |
% |\adl@drawvl|, a vertical skip of $-{}$|\adl@finaldepth| is inserted to |
| 3788 |
% move back to the last baseline, and then an invisible |\vrule| of |
| 3789 |
% |\adl@finaldepth| deep is put to make |array|\slash|tabular| has the depth |
| 3790 |
% of the last real row or zero if it ends with a horizontal line. |
| 3791 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 3792 |
% |
| 3793 |
% \begin{macrocode} |
| 3794 |
\def\adl@endarray{\crcr \noalign{ |
| 3795 |
\ifdim\adl@height=\z@ |
| 3796 |
\ifdim\adl@depth=\z@ \else \adl@@cr\z@ \fi |
| 3797 |
\else \adl@@cr\z@ \fi |
| 3798 |
\let\adl@vl\relax |
| 3799 |
\def\adl@vlrow{}\adl@currentcolumn\@ne |
| 3800 |
\let\adl@rows\adl@rowsL |
| 3801 |
\let\adl@addvl\adl@addvlL |
| 3802 |
\adl@makevlrL \global\let\adl@vlrowL\adl@vlrow |
| 3803 |
\def\adl@vlrow{}\adl@currentcolumn\adl@columns |
| 3804 |
\let\adl@rows\adl@rowsR |
| 3805 |
\let\adl@addvl\adl@addvlR |
| 3806 |
\adl@makevlrR \global\let\adl@vlrowR\adl@vlrow |
| 3807 |
\global\let\adl@vl\adl@@vl}% |
| 3808 |
\adl@drawvl |
| 3809 |
\noalign{\vskip-\adl@finaldepth}% |
| 3810 |
\omit\vrule\@width\z@\@height\z@\@depth\adl@finaldepth\cr} |
| 3811 |
|
| 3812 |
% \end{macrocode} |
| 3813 |
% |
| 3814 |
% \begin{macro}{\adl@arrayrestore} |
| 3815 |
% \SpecialIndex{\adl@height} |
| 3816 |
% \SpecialIndex{\adl@depth} |
| 3817 |
% \SpecialIndex{\adl@currentcolumn} |
| 3818 |
% \SpecialIndex{\adl@totalheight} |
| 3819 |
% \SpecialIndex{\adl@heightsave} |
| 3820 |
% \SpecialIndex{\adl@depthsave} |
| 3821 |
% \SpecialIndex{\adl@currentcolumnsave} |
| 3822 |
% \SpecialIndex{\adl@totalheightsave} |
| 3823 |
% \SpecialIndex{\adl@rowsL} |
| 3824 |
% \SpecialIndex{\adl@rowsR} |
| 3825 |
% \SpecialIndex{\adl@rowsLsave} |
| 3826 |
% \SpecialIndex{\adl@rowsRsave} |
| 3827 |
% \SpecialIndex{\adl@colsL} |
| 3828 |
% \SpecialIndex{\adl@colsR} |
| 3829 |
% \SpecialIndex{\adl@colsLsave} |
| 3830 |
% \SpecialIndex{\adl@colsRsave} |
| 3831 |
% |
| 3832 |
% The macro |\adl@arrayrestore| restores the values of registers and data |
| 3833 |
% structures, |\adl@height|, |\adl@depth|, |\adl@currentcolumn|, |
| 3834 |
% |\adl@totalheight|, |\adl@rowsL|, |\adl@rowsR|, |\adl@colsL| and |
| 3835 |
% |\adl@colsR|, saved by |\adl@arrayinit|. |
| 3836 |
% \end{macro} |
| 3837 |
% |
| 3838 |
% \begin{macrocode} |
| 3839 |
\def\adl@arrayrestore{% |
| 3840 |
\global\adl@height\adl@heightsave |
| 3841 |
\global\adl@depth\adl@depthsave |
| 3842 |
\global\adl@currentcolumn\adl@currentcolumnsave |
| 3843 |
\global\adl@totalheight\adl@totalheightsave |
| 3844 |
\global\let\adl@rowsL\adl@rowsLsave |
| 3845 |
\global\let\adl@rowsR\adl@rowsRsave |
| 3846 |
\global\let\adl@colsL\adl@colsLsave |
| 3847 |
\global\let\adl@colsR\adl@colsRsave} |
| 3848 |
|
| 3849 |
%%^L |
| 3850 |
% \end{macrocode} |
| 3851 |
% |
| 3852 |
% |
| 3853 |
% |
| 3854 |
% \def\defprog{ |
| 3855 |
% \def\WHILE{\hbox{\bf while}} |
| 3856 |
% \def\DO{\hbox{\bf do}} |
| 3857 |
% \def\BEGIN{\hbox{\bf begin}} |
| 3858 |
% \def\END{\hbox{\bf end}} |
| 3859 |
% \def\IF{\hbox{\bf if}} |
| 3860 |
% \def\THEN{\hbox{\bf then}} |
| 3861 |
% \def\ELSE{\hbox{\bf else}} |
| 3862 |
% \def\TRUE{\hbox{\bf true}} |
| 3863 |
% \def\FALSE{\hbox{\bf false}} |
| 3864 |
% \let\_\gets |
| 3865 |
% \def\GAMMA{{\mit\Gamma}} |
| 3866 |
% \def\LAMBDA{{\mit\Lambda}} |
| 3867 |
% \def\!{\stepcounter{enumi}\llap{\footnotesize(\arabic{enumi})\quad}} |
| 3868 |
% } |
| 3869 |
% \begin{figure}[p]\defprog |
| 3870 |
% \begin{itemize}\item[] |
| 3871 |
% \let\B\bot |
| 3872 |
% \setcounter{enumi}{0} |
| 3873 |
% \begin{tabbing} |
| 3874 |
%\!$\LAMBDA\_\meta{}$; $R\_R^L$; $\gamma\_1$;\\ |
| 3875 |
%\!\WHILE\ $\gamma\leq\GAMMA$ \DO\ \BEGIN\\ |
| 3876 |
%\!\qquad\= |
| 3877 |
% $\tau\_H$; $\beta\_H$; $\eta\_0$; $\delta\_ \meta{$-1,\B$}$; |
| 3878 |
% $\xi\_ \meta{$-1,\B$}$;\\ |
| 3879 |
%\!\> ${\it conn}\_\FALSE$; ${\it double}\_\FALSE;$; $R'\_\meta{}$\\ |
| 3880 |
%\!\> \WHILE\ $R\neq\meta{}$ \DO\ \BEGIN\\ |
| 3881 |
%\!\>\qquad\= $\meta{$r,R$}\_R$;\\ |
| 3882 |
%\!\> \> $\meta{$C,h$}\_r$;\\ |
| 3883 |
%\!\> \> \IF\ $C=\meta{}$ \THEN\ \BEGIN\quad |
| 3884 |
% ${\it add}(\tau,\beta,\delta,\xi)$; $\eta\_0$;\quad\END;\\ |
| 3885 |
%\!\> \> \ELSE\IF\ $C=\meta{connect}$ \THEN\quad $\eta\_h$;\\ |
| 3886 |
%\!\> \> \ELSE\ \BEGIN\\ |
| 3887 |
%\!\> \>\qquad\= $\meta{$e,C'$}=C$; $\meta{$c,d,g$}=e$;\\ |
| 3888 |
%\!\> \> \> \IF\ $c=\gamma$ \THEN\ \BEGIN\\ |
| 3889 |
%\!\> \> \>\qquad\= \IF\ $d=\delta\LAND g=\xi$ \THEN\ \BEGIN\\ |
| 3890 |
%\!\> \> \> \>\qquad\= \IF\ $\lnot{\it conn}$ \THEN\ \BEGIN\\ |
| 3891 |
%\!\> \> \> \> \>\qquad\= $\tau\_\beta+\eta$; |
| 3892 |
% ${\it conn}\_\TRUE$;\\ |
| 3893 |
%\!\> \> \> \> \> \END;\\ |
| 3894 |
%\!\> \> \> \> \END;\\ |
| 3895 |
%\!\> \> \> \> \ELSE\ \BEGIN\\ |
| 3896 |
%\!\> \> \> \> \> ${\it add}(\tau,\beta,\delta,\xi)$;\\ |
| 3897 |
%\!\> \> \> \> \> $\delta\_d$; $\xi\_g$; |
| 3898 |
% $\tau\_\beta+\eta$; |
| 3899 |
% ${\it conn}\_\TRUE$;\\ |
| 3900 |
%\!\> \> \> \> \END;\\ |
| 3901 |
%\!\> \> \> \> \IF\ $C'=\meta{\meta{$\gamma,?,?$},$?$}$ \THEN |
| 3902 |
% \quad ${\it double}\_\TRUE$;\\ |
| 3903 |
%\!\> \> \> \> $C\_C'$;\\ |
| 3904 |
%\!\> \> \> \END;\\ |
| 3905 |
%\!\> \> \> \ELSE\quad ${\it add}(\tau,\beta,\delta,\xi)$;\\ |
| 3906 |
%\!\> \> \> $\eta\_0$;\\ |
| 3907 |
%\!\> \> \END;\\ |
| 3908 |
%\!\> \> $\beta\_\beta-h$; $R'\_\meta{$R',\meta{$C,h$}$}$\\ |
| 3909 |
%\!\> \END;\\ |
| 3910 |
%\!\> ${\it add}(\tau,\beta,\delta,\xi)$; $R\_R'$;\\ |
| 3911 |
%\!\> \IF\ {\it double} \THEN\quad |
| 3912 |
% $\LAMBDA\_\meta{$\LAMBDA,\cs{hskip}\cs{doublerulesep}$}$;\\ |
| 3913 |
%\!\> \ELSE\ \BEGIN\\ |
| 3914 |
%\!\> \> $\gamma\_\gamma+1$;\\ |
| 3915 |
%\!\> \> \IF\ $\gamma>\GAMMA$ \THEN\quad\= |
| 3916 |
% $\LAMBDA\_\meta{$\LAMBDA,\cs{hfil}$}$;\\ |
| 3917 |
%\!\> \> \ELSE\> |
| 3918 |
% $\LAMBDA\_ |
| 3919 |
% \meta{$\LAMBDA,\cs{hfil}\hbox{\tt\&}\cs{omit}$}$;\\ |
| 3920 |
%\!\> \END;\\ |
| 3921 |
%\!\END;\\ |
| 3922 |
%\!\\ |
| 3923 |
%\!{\bf procedure} ${\it add}(\tau,\beta,\delta,\xi)$ \BEGIN\\ |
| 3924 |
%\!\> \IF\ {\it conn} \THEN\ \BEGIN\\ |
| 3925 |
%\!\> \> $\LAMBDA\_ |
| 3926 |
% \meta{$\LAMBDA,\meta{$\beta,\tau-\beta,\delta,\xi$}$}$; |
| 3927 |
% ${\it conn}\_\FALSE$;\\ |
| 3928 |
%\!\> \END;\\ |
| 3929 |
%\!\END; |
| 3930 |
% \end{tabbing} |
| 3931 |
% \end{itemize} |
| 3932 |
% \caption{Conceptual Code of \cs{adl@makevlrL}} |
| 3933 |
% \label{fig-makevlr} |
| 3934 |
% \end{figure} |
| 3935 |
% |
| 3936 |
% |
| 3937 |
% |
| 3938 |
% \subsection{Drawing Vertical Lines} |
| 3939 |
% \label{sec:imp-vl} |
| 3940 |
% |
| 3941 |
% \SpecialIndex{\adl@rowsL} |
| 3942 |
% \SpecialIndex{\adl@rowsR} |
| 3943 |
% \SpecialIndex{\adl@rows} |
| 3944 |
% \SpecialIndex{\adl@vlrowL} |
| 3945 |
% \SpecialIndex{\adl@vlrowR} |
| 3946 |
% \SpecialIndex{\adl@vlrow} |
| 3947 |
% \SpecialIndex{\adl@columns} |
| 3948 |
% \SpecialIndex{\adl@currentcolumn} |
| 3949 |
% \SpecialIndex{\adl@lastconn} |
| 3950 |
% \SpecialIndex{\adl@dash} |
| 3951 |
% \SpecialIndex{\adl@gap} |
| 3952 |
% \SpecialIndex{\adl@vlrow} |
| 3953 |
% \SpecialIndex{\ifadl@connected} |
| 3954 |
% \SpecialIndex{\ifadl@doublerule} |
| 3955 |
% \SpecialIndex{\adl@totalheight} |
| 3956 |
% |
| 3957 |
% \changes{v1.73-1}{2016/04/28} |
| 3958 |
% {Add $\eta\EQ\cs{adl@lastconn}$, its initialization and updates, and |
| 3959 |
% the addition to $\tau$.} |
| 3960 |
% |
| 3961 |
% Figure~\ref{fig-makevlr} shows the conceptual code of |\adl@makevlrL|. |
| 3962 |
% The correspondance of variables in the code and control sequences in the |
| 3963 |
% real implementation is as follows. |
| 3964 |
% \begin{itemize}\item[] |
| 3965 |
% $\begin{array}[t]{*4{r@{\;{:}\;}l}} |
| 3966 |
% R^L& \cs{adl@rowsL}& |
| 3967 |
% R& \cs{adl@rows}& |
| 3968 |
% R'& \cs{@tempb}& |
| 3969 |
% \mit\Lambda& \cs{adl@vlrowL}\\ |
| 3970 |
% \mit\Gamma& \cs{adl@columns}& |
| 3971 |
% \gamma& \rlap{\cs{adl@currentcolumn}}\\ |
| 3972 |
% \tau& \cs{@tempcnta}& |
| 3973 |
% \beta& \cs{@tempcntb}& |
| 3974 |
% \eta& \rlap{\cs{adl@lastconn}}\\ |
| 3975 |
% \delta& \rlap{\cs{adl@dash}/\cs{adl@dashcolor}}& |
| 3976 |
% \multicolumn2c{}& |
| 3977 |
% \xi& \rlap{\cs{adl@gap}/\cs{adl@gapcolor}}&\multicolumn2c{}\\ |
| 3978 |
% H& \rlap{\cs{adl@totalheight}}\\ |
| 3979 |
% {\it conn}& \rlap{\cs{ifadl@connected}}&\multicolumn2c{}& |
| 3980 |
% {\it double}& \rlap{\cs{ifadl@doublerule}}\\ |
| 3981 |
% \end{array}$ |
| 3982 |
% \end{itemize} |
| 3983 |
% |
| 3984 |
% \begin{macro}{\adl@makevlrL} |
| 3985 |
% \changes{v1.4-2-8}{1999/06/25} |
| 3986 |
% {Modified to replace \cs{hfil} with \cs{hss} to prevent drawing |
| 3987 |
% vertical lines widen columns.} |
| 3988 |
% \begin{macro}{\adl@makevlrR} |
| 3989 |
% \changes{v1.4-2-8}{1999/06/25} |
| 3990 |
% {Modified to replace \cs{hfil} with \cs{hss} to prevent drawing |
| 3991 |
% vertical lines widen columns.} |
| 3992 |
% The macro |\adl@makevlrL| corresponds to the line (2) and (31)--(36). Its |
| 3993 |
% right-edge counterpart |\adl@makevlrR| has the same correspondance but the |
| 3994 |
% lines (1)--(2) are; |
| 3995 |
% |
| 3996 |
% \begin{quote}\defprog\setcounter{enumi}{0} |
| 3997 |
% \begin{tabbing} |
| 3998 |
%\!$\LAMBDA\_\meta{}$; $R\_R^R$; $\gamma\_\GAMMA$;\\ |
| 3999 |
%\!\WHILE\ $\gamma>0$ \DO\ \BEGIN |
| 4000 |
% \end{tabbing} |
| 4001 |
% \end{quote} |
| 4002 |
% |
| 4003 |
% and (31)--(36) are; |
| 4004 |
% |
| 4005 |
% \begin{quote}\defprog\setcounter{enumi}{30} |
| 4006 |
% \begin{tabbing} |
| 4007 |
%\!\qquad\= |
| 4008 |
% \IF\ {\it double} \THEN\quad |
| 4009 |
% $\LAMBDA\_\meta{$\cs{hskip}\cs{doublerulesep},\LAMBDA$}$;\\ |
| 4010 |
%\!\> \ELSE\ \BEGIN\\ |
| 4011 |
%\!\>\qquad\= $\gamma\_\gamma-1$;\\ |
| 4012 |
%\!\> \> \IF\ $\gamma=0$ \THEN\quad\= |
| 4013 |
% $\LAMBDA\_\meta{$\cs{hss},\LAMBDA$}$;\\ |
| 4014 |
%\!\> \> \ELSE\> |
| 4015 |
% $\LAMBDA\_ |
| 4016 |
% \meta{$\hbox{\tt\&}\cs{omit}\cs{hss},\LAMBDA$}$;\\ |
| 4017 |
%\!\> \END;\\ |
| 4018 |
% \end{tabbing} |
| 4019 |
% \end{quote} |
| 4020 |
% \end{macro}\end{macro} |
| 4021 |
% \begin{macrocode} |
| 4022 |
|
| 4023 |
%% Drawing Vertical Lines |
| 4024 |
|
| 4025 |
\def\adl@makevlrL{\adl@makevlr |
| 4026 |
\ifadl@doublerule |
| 4027 |
\edef\adl@vlrow{\adl@vlrow \hskip\doublerulesep}% |
| 4028 |
\let\next\adl@makevlrL |
| 4029 |
\else |
| 4030 |
\advance\adl@currentcolumn\@ne |
| 4031 |
\ifnum\adl@currentcolumn>\adl@columns \let\next\relax |
| 4032 |
\edef\adl@vlrow{\adl@vlrow \hss}% |
| 4033 |
\else \let\next\adl@makevlrL |
| 4034 |
\edef\adl@vlrow{\adl@vlrow \hss &\omit}% |
| 4035 |
\fi\fi\next} |
| 4036 |
\def\adl@makevlrR{\adl@makevlr |
| 4037 |
\ifadl@doublerule |
| 4038 |
\edef\adl@vlrow{\hskip\doublerulesep \adl@vlrow}% |
| 4039 |
\let\next\adl@makevlrR |
| 4040 |
\else |
| 4041 |
\advance\adl@currentcolumn\m@ne |
| 4042 |
\ifnum\adl@currentcolumn=\z@ \let\next\relax |
| 4043 |
\edef\adl@vlrow{\hss \adl@vlrow}% |
| 4044 |
\else \let\next\adl@makevlrR |
| 4045 |
\edef\adl@vlrow{&\omit \hss \adl@vlrow}% |
| 4046 |
\fi\fi\next} |
| 4047 |
|
| 4048 |
% \end{macrocode} |
| 4049 |
% |
| 4050 |
% \begin{macro}{\adl@makevlr} |
| 4051 |
% \changes{v1.7-3}{2004/5/21} |
| 4052 |
% {Modified to initialize \cs{adl@dashcolor} and \cs{adl@gapcolor}.} |
| 4053 |
% \changes{v1.73-1}{2016/04/28} |
| 4054 |
% {Add $\eta\EQ\cs{adl@lastconn}\gets0$.} |
| 4055 |
% \SpecialIndex{\adl@addvl} |
| 4056 |
% \SpecialIndex{\adl@lastconn} |
| 4057 |
% |
| 4058 |
% The macro |\adl@makevlr| corresponds to the lines (3)--(4) and (30). |
| 4059 |
% \end{macro} |
| 4060 |
% |
| 4061 |
% \begin{macrocode} |
| 4062 |
\def\adl@makevlr{\@tempcnta\adl@totalheight \@tempcntb\adl@totalheight |
| 4063 |
\let\adl@lastconn\z@ \adl@dash\m@ne \adl@gap\m@ne |
| 4064 |
\let\adl@dashcolor\relax \let\adl@gapcolor\relax |
| 4065 |
\adl@connectedfalse \adl@doublerulefalse \def\@tempb{}% |
| 4066 |
\expandafter\adl@imakevlr\adl@rows\@nil;% |
| 4067 |
\adl@addvl |
| 4068 |
\edef\adl@rows{\@tempb}} |
| 4069 |
|
| 4070 |
% \end{macrocode} |
| 4071 |
% |
| 4072 |
% \begin{macro}{\adl@imakevlr} |
| 4073 |
% \begin{macro}{\adl@iimakevlr} |
| 4074 |
% |
| 4075 |
% \changes{v1.73-1}{2016/04/28} |
| 4076 |
% {Modify the definition of \cs{adl@connect} to pass $h$ to |
| 4077 |
% \cs{adl@@connect}.} |
| 4078 |
% |
| 4079 |
% \begin{macro}{\adl@endmakevlr} |
| 4080 |
% \SpecialIndex{\@elt} |
| 4081 |
% \SpecialIndex{\adl@connect} |
| 4082 |
% |
| 4083 |
% The macro |\adl@imakevlr|\meta{$r$}|;| corresponds to the lines (5)--(6), |
| 4084 |
% and the macro |\adl@iimakevlr(|\meta{$C$}|/|\meta{$h$}|)| to (7) and (28). |
| 4085 |
% \end{macro}\end{macro}\end{macro} |
| 4086 |
% |
| 4087 |
% \begin{macrocode} |
| 4088 |
\def\adl@imakevlr#1;{\def\@tempa{#1}\ifx\@tempa\@nnil \let\next\relax |
| 4089 |
\else \adl@iimakevlr#1\let\next\adl@imakevlr \fi \next} |
| 4090 |
\def\adl@iimakevlr(#1/#2){\let\@elt\adl@iiimakevlr |
| 4091 |
\def\adl@connect{\adl@@connect#2}% |
| 4092 |
\let\adl@endmakevlr\adl@endmakevlrcut |
| 4093 |
#1\adl@endmakevlr |
| 4094 |
\let\@elt\relax \let\adl@connect\relax |
| 4095 |
\advance\@tempcntb-#2\edef\@tempb{\@tempb(\@tempc/#2);}} |
| 4096 |
|
| 4097 |
% \end{macrocode} |
| 4098 |
% |
| 4099 |
% \begin{macro}{\adl@iiimakevlr} |
| 4100 |
% \changes{v1.7-3}{2004/5/21} |
| 4101 |
% {Modified to check color indentity.} |
| 4102 |
% \changes{v1.73-1}{2016/04/28} |
| 4103 |
% {Replace two occurences of $\tau\gets\beta$ with |
| 4104 |
% $\tau\gets\beta+\eta$ and add $\eta\gets0$, where |
| 4105 |
% $\eta\EQ\cs{adl@lastconn}$.} |
| 4106 |
% \begin{macro}{\adl@ivmakevlr} |
| 4107 |
% \changes{v1.7-3}{2004/5/21} |
| 4108 |
% {Modified not to see $d$ and $g$ which now have colors.} |
| 4109 |
% \begin{macro}{\adl@vmakevlr} |
| 4110 |
% \begin{macro}{\adl@endmakevlrcut} |
| 4111 |
% \changes{v1.73-1}{2016/04/28} |
| 4112 |
% {Add $\eta\EQ\cs{adl@lastconn}\gets0$.} |
| 4113 |
% \begin{macro}{\adl@endmakevlrconn} |
| 4114 |
% \begin{macro}{\adl@@connect} |
| 4115 |
% \changes{v1.73-1}{2016/04/28} |
| 4116 |
% {Add $\eta\EQ\cs{adl@lastconn}\gets h$ with the added |
| 4117 |
% argument $h$.} |
| 4118 |
% |
| 4119 |
% The correspondance of the lines (8)--(30) is a little bit complicated. As |
| 4120 |
% shown above, |\adl@iimakevlr| expands $C$ attaching the sentinel |
| 4121 |
% |\adl@endmakevlr|. |
| 4122 |
% |
| 4123 |
% \begin{enumerate} |
| 4124 |
% \item |
| 4125 |
% If $C\neq\meta{}$ and $C\neq\meta{connect}$, $C$ has at least one |
| 4126 |
% |\@elt|\meta{$c$}\meta{$d$}\meta{$g$} which is made |\let|-equal to |
| 4127 |
% |\adl@iiimakevlr| by |\adl@iimakevlr|. Thus the lines (10)--(21) and |
| 4128 |
% (25)--(26) are performed by |\adl@iiimakevlr|. |
| 4129 |
% |
| 4130 |
% Then; |
| 4131 |
% \begin{enumerate} |
| 4132 |
% \item |
| 4133 |
% if $c=\gamma$, |\@elt| becomes |\let|-equal to |\adl@ivmakevlr| which |
| 4134 |
% corresponds to (22) in the case of $C'\neq\meta{}$. Then |\adl@vmakevlr| |
| 4135 |
% is invoked for (23) and to eat the sentinel |\adl@endmakevlr|. If |
| 4136 |
% $C'=\meta{}$, |\adl@endmakevlrconn| is invoked, because the sentinel |
| 4137 |
% |\adl@endmakevlr| is made |\let|-equal to it by |\adl@iiimakevlr|, for |
| 4138 |
% (23) (i.e.\ $C\gets\meta{}$). |
| 4139 |
% |
| 4140 |
% \item |
| 4141 |
% if $c\neq\gamma$, |\adl@vmakevlr| is invoked to perform implicit $C\gets |
| 4142 |
% C$ operation and to eat the sentinel. |
| 4143 |
% \end{enumerate} |
| 4144 |
% |
| 4145 |
% \item |
| 4146 |
% If $C=\meta{connect}$, i.e.\ it has only one element |\adl@connect|, the |
| 4147 |
% macro |\adl@@connect| is invoked with $h$ because it is |\define|-dl to be |
| 4148 |
% $|\adl@@connect|\meta{h}$. The macro performs (9) and implict $C\gets C\ {} |
| 4149 |
% (=\meta{connect})$ eating the sentinel. |
| 4150 |
% |
| 4151 |
% \item |
| 4152 |
% If $C=\meta{}$, |\adl@endmakevlrcut| that is |\let|-equal to the sentinel |
| 4153 |
% |\adl@endmakevlr| is invoked to perform (8) and implicit $C\gets C |
| 4154 |
% \ (=\meta{})$. |
| 4155 |
% \end{enumerate} |
| 4156 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 4157 |
% \SpecialIndex{\adl@addvl} |
| 4158 |
% |
| 4159 |
% \begin{macrocode} |
| 4160 |
\def\adl@iiimakevlr#1#2#3#4#5{\let\@elt\adl@ivmakevlr \let\next\relax |
| 4161 |
\ifnum#1=\adl@currentcolumn\relax |
| 4162 |
\let\adl@endmakevlr\adl@endmakevlrconn |
| 4163 |
\@tempswafalse |
| 4164 |
\ifnum#2=\adl@dash\relax |
| 4165 |
\ifnum#3=\adl@gap\relax |
| 4166 |
\def\@tempa{#4}\ifx\@tempa\adl@dashcolor |
| 4167 |
\def\@tempa{#5}\ifx\@tempa\adl@gapcolor |
| 4168 |
\@tempswatrue |
| 4169 |
\fi\fi\fi\fi |
| 4170 |
\if@tempswa |
| 4171 |
\ifadl@connected\else |
| 4172 |
\@tempcnta\@tempcntb |
| 4173 |
\advance\@tempcnta\adl@lastconn\relax |
| 4174 |
\adl@connectedtrue |
| 4175 |
\fi |
| 4176 |
\else |
| 4177 |
\adl@addvl |
| 4178 |
\adl@dash#2\relax \adl@gap#3\relax |
| 4179 |
\def\adl@dashcolor{#4}\def\adl@gapcolor{#5}% |
| 4180 |
\@tempcnta\@tempcntb |
| 4181 |
\advance\@tempcnta\adl@lastconn\relax |
| 4182 |
\adl@connectedtrue |
| 4183 |
\fi |
| 4184 |
\else |
| 4185 |
\adl@addvl |
| 4186 |
\def\next{\adl@vmakevlr\@elt{#1}{#2}{#3}{#4}{#5}}% |
| 4187 |
\fi |
| 4188 |
\let\adl@lastconn\z@ \next} |
| 4189 |
\def\adl@ivmakevlr#1{% |
| 4190 |
\ifnum#1=\adl@currentcolumn \adl@doubleruletrue \fi |
| 4191 |
\adl@vmakevlr\@elt{#1}} |
| 4192 |
\def\adl@vmakevlr#1\adl@endmakevlr{\def\@tempc{#1}} |
| 4193 |
\def\adl@endmakevlrcut{\adl@addvl \let\adl@lastconn\z@ \def\@tempc{}} |
| 4194 |
\def\adl@endmakevlrconn{\def\@tempc{}} |
| 4195 |
\def\adl@@connect#1\adl@endmakevlr{\def\adl@lastconn{#1}% |
| 4196 |
\def\@tempc{\adl@connect}} |
| 4197 |
|
| 4198 |
% \end{macrocode} |
| 4199 |
% |
| 4200 |
% \begin{macro}{\adl@addvlL} |
| 4201 |
% \changes{v1.7-3}{2004/5/21} |
| 4202 |
% {Modified to add colors to $\delta$ and $\xi$.} |
| 4203 |
% \begin{macro}{\adl@addvlR} |
| 4204 |
% \changes{v1.7-3}{2004/5/21} |
| 4205 |
% {Modified to add colors to $\delta$ and $\xi$.} |
| 4206 |
% The macro |\adl@addvlL| corresonds to the lines (38)--(42), i.e.\ the |
| 4207 |
% procedure {\it add}. The macro |\adl@addvlR| performs simlar operations, |
| 4208 |
% but its conceptual code is the following. |
| 4209 |
% |
| 4210 |
% \begin{quote}\defprog\setcounter{enumi}{37} |
| 4211 |
% \begin{tabbing} |
| 4212 |
%\!{\bf procedure} ${\it add}(\tau,\beta,\delta,\xi)$ \BEGIN\\ |
| 4213 |
%\!\qquad\= |
| 4214 |
% \IF\ {\it conn} \THEN\ \BEGIN\\ |
| 4215 |
%\!\>\qquad\= $\LAMBDA\_ |
| 4216 |
% \meta{$\meta{$\beta,\tau-\beta,\delta,\xi$},\LAMBDA$}$; |
| 4217 |
% ${\it conn}\_\FALSE$;\\ |
| 4218 |
%\!\> \END;\\ |
| 4219 |
%\!\END; |
| 4220 |
% \end{tabbing} |
| 4221 |
% \end{quote} |
| 4222 |
% \end{macro}\end{macro} |
| 4223 |
% \SpecialIndex{\ifadl@connected} |
| 4224 |
% \SpecialIndex{\adl@vlrow} |
| 4225 |
% \SpecialIndex{\adl@vl} |
| 4226 |
% \SpecialIndex{\adl@dash} |
| 4227 |
% \SpecialIndex{\adl@gap} |
| 4228 |
% |
| 4229 |
% \begin{macrocode} |
| 4230 |
\def\adl@addvlL{\ifadl@connected |
| 4231 |
\advance\@tempcnta-\@tempcntb |
| 4232 |
\edef\adl@vlrow{\adl@vlrow |
| 4233 |
\adl@vl{\number\@tempcntb}{\number\@tempcnta}% |
| 4234 |
{\number\adl@dash}{\number\adl@gap}% |
| 4235 |
{\adl@dashcolor}{\adl@gapcolor}}% |
| 4236 |
\adl@connectedfalse \fi} |
| 4237 |
\def\adl@addvlR{\ifadl@connected |
| 4238 |
\advance\@tempcnta-\@tempcntb |
| 4239 |
\edef\adl@vlrow{\adl@vl{\number\@tempcntb}{\number\@tempcnta}% |
| 4240 |
{\number\adl@dash}{\number\adl@gap}% |
| 4241 |
{\adl@dashcolor}{\adl@gapcolor}\adl@vlrow}% |
| 4242 |
\adl@connectedfalse \fi} |
| 4243 |
|
| 4244 |
% \end{macrocode} |
| 4245 |
% |
| 4246 |
% \begin{macro}{\adl@drawvl} |
| 4247 |
% \changes{v1.54-1}{2003/08/25} |
| 4248 |
% {Introduced to draw vertical lines correctly if \cs{ADLsomewide}.} |
| 4249 |
% \begin{macro}{\adl@@vl} |
| 4250 |
% \changes{v1.4-2-2}{1999/06/25} |
| 4251 |
% {Modified to make vertical line null wide only if \cs{ADLnullwide}.} |
| 4252 |
% \changes{v1.4-2-4}{1999/06/25} |
| 4253 |
% {Modified to use \cs{adl@draw}.} |
| 4254 |
% \changes{v1.54-1}{2003/08/25} |
| 4255 |
% {Insert a negative skip to left/right of the line if \cs{ADLsomewide}.} |
| 4256 |
% \changes{v1.7-3}{2004/5/21} |
| 4257 |
% {Modified to color dashs and gaps.} |
| 4258 |
% \begin{macro}{\adl@vl@leftskip} |
| 4259 |
% \begin{macro}{\adl@vl@rightskip} |
| 4260 |
% \SpecialIndex{\adl@vlrowL} |
| 4261 |
% \SpecialIndex{\adl@vlrowL} |
| 4262 |
% \SpecialIndex{\adl@vl} |
| 4263 |
% \SpecialIndex{\adl@draw} |
| 4264 |
% \SpecialIndex{\set@color} |
| 4265 |
% |
| 4266 |
% After the the macros |\adl@vlrowL| and |\adl@vlrowR| are constructed, they |
| 4267 |
% are expanded to draw vertical lines by |\adl@drawvl|. Prior to the |
| 4268 |
% expansion, the macro |\adl@drawvl| globally defines |\adl@vl@leftskip| and |
| 4269 |
% |\adl@vl@rightskip|, which are the amount of negative spaces inserted to the |
| 4270 |
% left\slash right of a vertical line, as follows. |
| 4271 |
% |
| 4272 |
% \begin{eqnarray*} |
| 4273 |
% \cs{adl@vl@leftskip}&=&\cases{ |
| 4274 |
% \cs{arrayrulewidth}/2& if \cs{ifadl@zwrule}\cr |
| 4275 |
% 0& else if leftside\cr |
| 4276 |
% \cs{arrayrulewidth}& otherwise}\\ |
| 4277 |
% \cs{adl@vl@rightskip}&=&\cases{ |
| 4278 |
% \cs{arrayrulewidth}/2& if \cs{ifadl@zwrule}\cr |
| 4279 |
% 0& else if rightside\cr |
| 4280 |
% \cs{arrayrulewidth}& otherwise} |
| 4281 |
% \end{eqnarray*} |
| 4282 |
% |
| 4283 |
% That is, if |\ADLnulwide| is in effect, a vertical line is surrounded by |
| 4284 |
% horizontal spaces of $-|\arrayrulewidth|/2$ to adjust the center of the |
| 4285 |
% line to the left or right edge of its column. Otherwise, a horizontal |
| 4286 |
% space $-|\arrayrulewidth|$ is inserted after (before) the line is drawn to |
| 4287 |
% adjust its left (right) edge to the left (right) edge of the column |
| 4288 |
% \footnote{ |
| 4289 |
% Before v1.54, the horizontal spaces was not inserted if \cs{ADLsomewide} |
| 4290 |
% and thus disconnected lines were not aligned vertically.}. |
| 4291 |
% |
| 4292 |
% Then the macros |\adl@vlrowL| and |\adl@vlrowR| are expanded. These |
| 4293 |
% macros will have |\adl@vl|, which is made |\let|-equal to |
| 4294 |
% \hbox{|\adl@@vl|} prior to the expansion, to draw a vertical line. The |
| 4295 |
% macro |
| 4296 |
% |\adl@@vl|\meta{$\beta$}\meta{$\lambda$}\meta{$\delta_l$}\meta{$\gamma_l$} |
| 4297 |
% \meta{$\delta_c$}\meta{$\gamma_c$} ($x_l$ and $x_c$ are length and color) |
| 4298 |
% draws a sloid line if $\gamma_l=0$ or a dash-line otherwise in a |\vbox| of |
| 4299 |
% $\lambda=\tau-\beta$ high and |\raise|-s it by $\beta$. The method to |
| 4300 |
% draw a dash line in the |\vbox| is analogous to that for horizontal line |
| 4301 |
% shown in \S\ref{sec:imp-hline}, except that a line is surrounded by |
| 4302 |
% horizontal spaces of |\adl@vl@leftskip| and |\adl@vl@rightskip|. Coloring |
| 4303 |
% gaps is done by drawing a vertical rule setting $\gamma_c$ by |\set@color| |
| 4304 |
% prior to dash line drawing if $\gamma_c$ is not |\relax|. To color |
| 4305 |
% dashes or solid line, |\set@color| with $\delta_c$ is done if it is not |
| 4306 |
% |\relax| before line drawing. |
| 4307 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 4308 |
% |
| 4309 |
% \begin{macrocode} |
| 4310 |
\def\adl@drawvl{% |
| 4311 |
\omit \relax \ifadl@zwvrule |
| 4312 |
\gdef\adl@vl@leftskip{.5\arrayrulewidth}% |
| 4313 |
\global\let\adl@vl@rightskip\adl@vl@leftskip |
| 4314 |
\else \global\let\adl@vl@leftskip\z@ |
| 4315 |
\global\let\adl@vl@rightskip\arrayrulewidth |
| 4316 |
\fi \adl@vlrowL \cr |
| 4317 |
\omit \relax \ifadl@zwvrule |
| 4318 |
\gdef\adl@vl@leftskip{.5\arrayrulewidth}% |
| 4319 |
\global\let\adl@vl@rightskip\adl@vl@leftskip |
| 4320 |
\else \global\let\adl@vl@leftskip\arrayrulewidth |
| 4321 |
\global\let\adl@vl@rightskip\z@ |
| 4322 |
\fi \adl@vlrowR \cr} |
| 4323 |
|
| 4324 |
\def\adl@@vl#1#2#3#4#5#6{\vbox to\z@{\vss\hbox{% |
| 4325 |
\hskip-\adl@vl@leftskip |
| 4326 |
\ifnum#3=\z@\else \def\@tempa{#6}\ifx\@tempa\adl@nocolor\else |
| 4327 |
\raise#1sp\hbox{\let\current@color\@tempa \set@color |
| 4328 |
\vrule height#2sp width\arrayrulewidth}% |
| 4329 |
\hskip-\arrayrulewidth \fi \fi |
| 4330 |
\raise#1sp\vbox to#2sp{ |
| 4331 |
\def\@tempa{#5}\ifx\@tempa\adl@nocolor\else |
| 4332 |
\let\current@color\@tempa \set@color \fi |
| 4333 |
\ifnum#3=\z@ |
| 4334 |
\hrule height#2sp depth\z@ width\arrayrulewidth |
| 4335 |
\else \@tempdima#3sp \@tempdimb#4sp |
| 4336 |
\adl@draw\adl@hrule\vskip\vbox |
| 4337 |
\fi}% |
| 4338 |
\hskip-\adl@vl@rightskip}}} |
| 4339 |
|
| 4340 |
%%^L |
| 4341 |
% \end{macrocode} |
| 4342 |
% |
| 4343 |
% |
| 4344 |
% |
| 4345 |
% \subsection{Drawing Dash-lines} |
| 4346 |
% \label{sec:imp-draw} |
| 4347 |
% \changes{v1.4-1}{1999/06/25} |
| 4348 |
% {Section 4.12 is added.} |
| 4349 |
% |
| 4350 |
% \begin{macro}{\adl@vrule} |
| 4351 |
% \changes{v1.4-2-4}{1999/06/25} |
| 4352 |
% {Introduced to draw a dash for horizontal lines in \cs{adl@draw}.} |
| 4353 |
% \begin{macro}{\adl@hrule} |
| 4354 |
% \changes{v1.4-2-4}{1999/06/25} |
| 4355 |
% {Introduced to draw a dash for vertical lines in \cs{adl@draw}.} |
| 4356 |
% As explained later, horizontal and vertical lines are drawn by a common |
| 4357 |
% macro |\adl@draw| to which the length of a dash segment, $d$, is passed |
| 4358 |
% through |\@tempdima|. The macro also has an argument that is either |
| 4359 |
% |\adl@vrule| to draw a dash for {\em horizontal} lines or |\adl@hrule| for |
| 4360 |
% {\em vertical}. These two macros commonly have one argument \meta{f} to |
| 4361 |
% draw a dash of $f\times d$ long and of |\arrayrulewidth| wide. |
| 4362 |
% \end{macro}\end{macro} |
| 4363 |
% |
| 4364 |
% \begin{macrocode} |
| 4365 |
|
| 4366 |
%% Draw Dash Lines (\adl@vrule/\adl@hrule, \hskip/\vskip, \hbox/\vbox) |
| 4367 |
|
| 4368 |
\def\adl@vrule#1{\vrule\@width#1\@tempdima\@height\arrayrulewidth\relax} |
| 4369 |
\def\adl@hrule#1{\hrule\@height#1\@tempdima\@width\arrayrulewidth\relax} |
| 4370 |
% \end{macrocode} |
| 4371 |
% |
| 4372 |
% \begin{macro}{\adl@drawi} |
| 4373 |
% \changes{v1.4-2-4}{1999/06/25} |
| 4374 |
% {Introduced as \cs{adl@draw} in mode 1.} |
| 4375 |
% \begin{macro}{\adl@drawii} |
| 4376 |
% \changes{v1.4-2-4}{1999/06/25} |
| 4377 |
% {Introduced as \cs{adl@draw} in mode 2.} |
| 4378 |
% \begin{macro}{\adl@drawiii} |
| 4379 |
% \changes{v1.4-2-4}{1999/06/25} |
| 4380 |
% {Introduced as \cs{adl@draw} in mode 3.} |
| 4381 |
% \begin{macro}{\adl@draw} |
| 4382 |
% \changes{v1.4-2-4}{1999/06/25} |
| 4383 |
% {Introduced as the mode and axis independent line drawing macro.} |
| 4384 |
% \SpecialIndex{\xleaders} |
| 4385 |
% \SpecialIndex{\cleaders} |
| 4386 |
% |
| 4387 |
% The macro |\adl@draw| is to draw a horizontal or vertical line. It is |
| 4388 |
% |\let|-equal to one of |\adl@drawi|, |\adl@drawii| and |\adl@drawiii| |
| 4389 |
% according to the drawing mode specified by |\ADLdrawingmode|. These three |
| 4390 |
% macros have common interface, |\@tempdima| and \hbox{|\@tempdimb|} for the |
| 4391 |
% length of dash and gap, $d$ and $g$, and three arguments \meta{rule}, |
| 4392 |
% \meta{skip} and \meta{box} with which |\adl@draw| is called in the |
| 4393 |
% following manner. |
| 4394 |
% |
| 4395 |
% \begin{eqnarray*} |
| 4396 |
% \hbox{|\adl@draw\adl@vrule\hskip\hbox|}&\ldots&\hbox{horizontal}\\ |
| 4397 |
% \hbox{|\adl@draw\adl@hrule\vskip\vbox|}&\ldots&\hbox{vertical} |
| 4398 |
% \end{eqnarray*} |
| 4399 |
% |
| 4400 |
% The drawing methods in three modes have been explained in |
| 4401 |
% \S\ref{sec:imp-ps2}. More specifically, |\adl@drawi| for mode 1, to which |
| 4402 |
% |\adl@draw| is |\let|-equal by default, conceptually performs the |
| 4403 |
% following operations. |
| 4404 |
% |
| 4405 |
% \begin{quote} |
| 4406 |
% \def\arg#1{\hbox{{\tt\char`\{}#1{\tt\char`\}}}} |
| 4407 |
% \meta{rule}\arg{1/2}\quad\meta{skip}$(g/2)$\\ |
| 4408 |
% |\xlearders|\meta{box} |
| 4409 |
% \arg{\meta{skip}$(g/2)$ \meta{rule}\arg{1} \meta{skip}$(g/2)$}\\ |
| 4410 |
% \phantom{\texttt{.xleaders}}\meta{skip}(0 |plus| 1|fil minus| 1|fil|)\\ |
| 4411 |
% \meta{skip}$(g/2)$\quad\meta{rule}\arg{1/2} |
| 4412 |
% \end{quote} |
| 4413 |
% |
| 4414 |
% The conceptual operations of |\adl@drawii| for mode 2 are as follows. |
| 4415 |
% |
| 4416 |
% \begin{quote} |
| 4417 |
% \def\arg#1{\hbox{{\tt\char`\{}#1{\tt\char`\}}}} |
| 4418 |
% \meta{rule}\arg{1/2}\quad\meta{skip}$(g/2)$\\ |
| 4419 |
% \meta{box}\arg{\meta{skip}$(g/2)$ \meta{rule}\arg{1} \meta{skip}$(g/2)$}\quad |
| 4420 |
% \meta{skip}$(-d-g)$\\ |
| 4421 |
% |\xlearders|\meta{box} |
| 4422 |
% \arg{\meta{skip}$(g/2)$ \meta{rule}\arg{1} \meta{skip}$(g/2)$}\\ |
| 4423 |
% \phantom{\texttt{.xleaders}}\meta{skip}(0 |plus| 1|fil minus| 1|fil|)\\ |
| 4424 |
% \meta{skip}$(-d-g)$\quad |
| 4425 |
% \meta{box}\arg{\meta{skip}$(g/2)$ \meta{rule}\arg{1} \meta{skip}$(g/2)$}\\ |
| 4426 |
% \meta{skip}$(g/2)$\quad\meta{rule}\arg{1/2} |
| 4427 |
% \end{quote} |
| 4428 |
% |
| 4429 |
% The macro |\adl@drawiii| for mode 3 is quite similar to |\adl@drawi| |
| 4430 |
% except that |\xleaders| is replaced by |\cleaders|. This replacement is |
| 4431 |
% done by temporarily |\let|-ing |\xleaders| be equal to |\cleaders|. |
| 4432 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 4433 |
% |
| 4434 |
% \SpecialIndex{\adl@box} |
| 4435 |
% |
| 4436 |
% \begin{macrocode} |
| 4437 |
\def\adl@drawi#1#2#3{% |
| 4438 |
#1{.5}#2.5\@tempdimb |
| 4439 |
\xleaders#3{#2.5\@tempdimb #1{1}#2.5\@tempdimb}% |
| 4440 |
#2\z@ plus1fil minus1fil\relax |
| 4441 |
#2.5\@tempdimb #1{.5}} |
| 4442 |
\def\adl@drawii#1#2#3{% |
| 4443 |
\setbox\adl@box#3{#2.5\@tempdimb #1{1}#2.5\@tempdimb}% |
| 4444 |
#1{.5}#2.5\@tempdimb |
| 4445 |
\copy\adl@box #2-\@tempdima #2-\@tempdimb |
| 4446 |
\xleaders\copy\adl@box#2\z@ plus1fil minus1fil\relax |
| 4447 |
#2-\@tempdima #2-\@tempdimb \copy\adl@box |
| 4448 |
#2.5\@tempdimb #1{.5}} |
| 4449 |
\def\adl@drawiii#1#2#3{{\let\xleaders\cleaders \adl@drawi#1#2#3}} |
| 4450 |
\let\adl@draw\adl@drawi |
| 4451 |
|
| 4452 |
% \end{macrocode} |
| 4453 |
% |
| 4454 |
% \begin{macro}{\ADLdrawingmode} |
| 4455 |
% \changes{v1.4-2-4}{1999/06/25} |
| 4456 |
% {Introduced to specify drawing mode.} |
| 4457 |
% The macro |\ADLdrawingmode|\Meta{m} defines the drawing mode by |\let|-ing |
| 4458 |
% |\adl@draw| be equal to |\adl@drawi| if $m=1$, and so on. If \meta{m} is |
| 4459 |
% neither 1, 2 nor 3, it is assumed as 1. |
| 4460 |
% \end{macro} |
| 4461 |
% |
| 4462 |
% \begin{macrocode} |
| 4463 |
\def\ADLdrawingmode#1{\ifcase #1% |
| 4464 |
\let\adl@draw\adl@drawi \or |
| 4465 |
\let\adl@draw\adl@drawi \or |
| 4466 |
\let\adl@draw\adl@drawii \or |
| 4467 |
\let\adl@draw\adl@drawiii \else |
| 4468 |
\let\adl@draw\adl@drawi \fi} |
| 4469 |
|
| 4470 |
%%^L |
| 4471 |
% \end{macrocode} |
| 4472 |
% |
| 4473 |
% |
| 4474 |
% |
| 4475 |
% \subsection{Shorthand Activation} |
| 4476 |
% \label{sec:imp-sh} |
| 4477 |
% \changes{v1.4-1}{1999/06/25} |
| 4478 |
% {Section 4.13 is added.} |
| 4479 |
% |
| 4480 |
% \begin{macro}{\adl@Array} |
| 4481 |
% \changes{v1.4-2-3}{1999/06/25} |
| 4482 |
% {Introduced as the body of \cs{Array}.} |
| 4483 |
% \begin{macro}{\adl@Tabular} |
| 4484 |
% \changes{v1.4-2-3}{1999/06/25} |
| 4485 |
% {Introduced as the body of \cs{Tabular}.} |
| 4486 |
% \begin{macro}{\adl@Tabularstar} |
| 4487 |
% \changes{v1.4-2-3}{1999/06/25} |
| 4488 |
% {Introduced as the body of \cs{Tabular*}.} |
| 4489 |
% \begin{macro}{\adl@Longtable} |
| 4490 |
% \changes{v1.6}{2003/8/25} |
| 4491 |
% {Introduced as the body of \cs{Longtable}.} |
| 4492 |
% \SpecialIndex{\array} |
| 4493 |
% \SpecialIndex{\tabular} |
| 4494 |
% \SpecialIndex{\tabular*} |
| 4495 |
% \SpecialIndex{\longtable} |
| 4496 |
% |
| 4497 |
% The macros|\adl@Array|, |\adl@Tabular|, |\adl@Tabular*| and |
| 4498 |
% |\adl@Longtable| start environments |array|, |tabular|, |tabular*| and |
| 4499 |
% |longtable| respectively, turning |\ifadl@inactive| false to activate |
| 4500 |
% dash-line functions. We will |\let| macros |\Array| etc.\ be equal to |
| 4501 |
% them for shorthand activation. |
| 4502 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 4503 |
% |
| 4504 |
% \begin{macrocode} |
| 4505 |
|
| 4506 |
%% Shorthand Activation |
| 4507 |
|
| 4508 |
\def\adl@Array{\adl@inactivefalse \array} |
| 4509 |
\def\adl@Tabular{\adl@inactivefalse \tabular} |
| 4510 |
\def\adl@Tabularstar{\adl@inactivefalse \@nameuse{tabular*}} |
| 4511 |
\def\adl@Longtable{\adl@inactivefalse \longtable} |
| 4512 |
|
| 4513 |
% \end{macrocode} |
| 4514 |
% |
| 4515 |
% \begin{macro}{\@notdefinable} |
| 4516 |
% \begin{macro}{\adl@notdefinable} |
| 4517 |
% \changes{v1.4-2-3}{1999/06/25} |
| 4518 |
% {Introduced to check if \cs{Array} etc. are definable.} |
| 4519 |
% \SpecialIndex{\@ifdefinable} |
| 4520 |
% |
| 4521 |
% Before making |\Array| etc.\ |\let|-equal to |\adl@Array| etc., we have to |
| 4522 |
% check if these macros having too natural names have already used. This |
| 4523 |
% check is done by |\@ifdefinable| that will call |\@notdefinable| for the |
| 4524 |
% complaint if undefinable. Since we want to complain with our own |
| 4525 |
% warning message, |\@notdefinable| is temporarily |\def|-ined so that it |
| 4526 |
% simply |\def|-ines a macro |\adl@notdefinable| as empty. Therefore, |
| 4527 |
% |\adl@notdefinebale| will have some definition if one of |\Array|, |
| 4528 |
% |\Tabular|, |\Tabular*| and |\Longtable| (if \textsf{longtable} is loaded) |
| 4529 |
% cannot be defined, while it will stay undefined otherwise. |
| 4530 |
% \end{macro}\end{macro} |
| 4531 |
% |
| 4532 |
% \begin{macrocode} |
| 4533 |
\begingroup |
| 4534 |
\def\@notdefinable{\gdef\adl@notdefinable{}} |
| 4535 |
\@ifdefinable\Array\relax |
| 4536 |
\@ifdefinable\Tabular\relax |
| 4537 |
\expandafter\@ifdefinable\csname Tabular*\endcsname\relax |
| 4538 |
\ifx\longtable\undefined\else \@ifdefinable\Longtable\relax \fi |
| 4539 |
\endgroup |
| 4540 |
|
| 4541 |
% \end{macrocode} |
| 4542 |
% |
| 4543 |
% \begin{macro}{\Array} |
| 4544 |
% \changes{v1.4-2-3}{1999/06/25} |
| 4545 |
% {Introduced as the always-active \cs{array}.} |
| 4546 |
% \begin{macro}{\Tabular} |
| 4547 |
% \changes{v1.4-2-3}{1999/06/25} |
| 4548 |
% {Introduced as the always-active \cs{tabular}.} |
| 4549 |
% \begin{macro}{\Tabular*} |
| 4550 |
% \changes{v1.4-2-3}{1999/06/25} |
| 4551 |
% {Introduced as the always-active \cs{tabular*}.} |
| 4552 |
% \begin{macro}{\Longtable} |
| 4553 |
% \changes{v1.6}{2003/8/25} |
| 4554 |
% {Introduced as the always-active \cs{longtable}.} |
| 4555 |
% \begin{macro}{\endArray} |
| 4556 |
% \changes{v1.4-2-3}{1999/06/25} |
| 4557 |
% {Introduced to \cs{end} the environment \texttt{Array}.} |
| 4558 |
% \begin{macro}{\endTabular} |
| 4559 |
% \changes{v1.4-2-3}{1999/06/25} |
| 4560 |
% {Introduced to \cs{end} the environment \texttt{Tabular}.} |
| 4561 |
% \begin{macro}{\endTabular*} |
| 4562 |
% \changes{v1.4-2-3}{1999/06/25} |
| 4563 |
% {Introduced to \cs{end} the environment \texttt{Tabular*}.} |
| 4564 |
% \begin{macro}{\endLongtable} |
| 4565 |
% \changes{v1.6}{2003/8/25} |
| 4566 |
% {Introduced to \cs{end} the environment \texttt{Longtable}.} |
| 4567 |
% \SpecialIndex{\PackageWarning} |
| 4568 |
% \SpecialIndex{\@warning} |
| 4569 |
% \SpecialIndex{\MessageBreak}% |
| 4570 |
% |
| 4571 |
% If |\adl@notdefinable| is |\undefined| indicating that all |\Array| etc.\ |
| 4572 |
% are definable, we |\let| them be equal to |\adl@Array| etc. We also |
| 4573 |
% |\let| ending macros |\endArray| etc.\ be equal to |\endarray| etc. |
| 4574 |
% Note that |\Longtable| and |\endLongtable| are defined only when |
| 4575 |
% \textsf{longtable} is loaded, and |\endLongtable| is |\def|-ined as (not |
| 4576 |
% being |\let|-equal to) |\endlongtable| because its definition of our own |
| 4577 |
% is not given yet. |
| 4578 |
% |
| 4579 |
% Otherwise, we complain with a warning message put by |\PackageWarning| if |
| 4580 |
% it is defined (i.e.\ \LaTeXe) or |\@warning| otherwise (i.e.\ \LaTeX-2.09). |
| 4581 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 4582 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 4583 |
% |
| 4584 |
% \begin{macrocode} |
| 4585 |
\ifx\adl@notdefinable\undefined |
| 4586 |
\let\Array\adl@Array |
| 4587 |
\let\Tabular\adl@Tabular |
| 4588 |
\expandafter\let\csname Tabular*\endcsname\adl@Tabularstar |
| 4589 |
\let\endArray\endarray |
| 4590 |
\let\endTabular\endtabular |
| 4591 |
\expandafter\let\csname endTabular*\endcsname\endtabular |
| 4592 |
\ifx\longtable\undefined\else |
| 4593 |
\let\Longtable\adl@Longtable |
| 4594 |
\def\endLongtable{\endlongtable} |
| 4595 |
\fi |
| 4596 |
\else |
| 4597 |
\begingroup |
| 4598 |
\ifx\longtable\undefined |
| 4599 |
\def\@tempa{Array and Tabular are not defined because one of them\MessageBreak |
| 4600 |
has been defined} |
| 4601 |
\else |
| 4602 |
\def\@tempa{Array/Tabular/Longtable are not defined because \MessageBreak |
| 4603 |
one of them has been defined} |
| 4604 |
\fi |
| 4605 |
\ifx\PackageWarning\undefined |
| 4606 |
\def\MessageBreak{^^J} |
| 4607 |
\@warning\@tempa |
| 4608 |
\else |
| 4609 |
\let\on@line\empty |
| 4610 |
\PackageWarning{arydshln}\@tempa |
| 4611 |
\fi |
| 4612 |
\endgroup |
| 4613 |
\fi |
| 4614 |
|
| 4615 |
% \end{macrocode} |
| 4616 |
% |
| 4617 |
% \begin{macro}{\ADLnoshorthanded} |
| 4618 |
% \changes{v1.4-2-3}{1999/06/25} |
| 4619 |
% {Introduced to nullify macros for shorthand activation.} |
| 4620 |
% \changes{v1.6}{2003/8/25} |
| 4621 |
% {\cs{Longtable} and \cs{endLongtable} are added.} |
| 4622 |
% If a user wishes to define an environment named |Array| or |Tabular(*)| |
| 4623 |
% (or |Longtable| if \textsf{longtable} is in use) by him/herself or by |
| 4624 |
% loading other packages {\em after} \textsf{arydshln} is loaded, |
| 4625 |
% |\newenvironment| for |Array| etc.\ will fail because they have already |
| 4626 |
% been undefinable. The macro |\ADLnoshorthanded| makes them definable |
| 4627 |
% again by |\let|-ing them and their ending counterparts be equal to |
| 4628 |
% |\relax|. |
| 4629 |
% \end{macro} |
| 4630 |
% |
| 4631 |
% \begin{macrocode} |
| 4632 |
\def\ADLnoshorthanded{% |
| 4633 |
\let\Array\relax |
| 4634 |
\let\Tabular\relax |
| 4635 |
\expandafter\let\csname Tabular*\endcsname\relax |
| 4636 |
\let\endArray\relax |
| 4637 |
\let\endTabular\relax |
| 4638 |
\expandafter\let\csname endTabular*\endcsname\relax |
| 4639 |
\ifx\longtable\undefined\else |
| 4640 |
\let\Longtable\relax |
| 4641 |
\let\endLongtable\relax \fi} |
| 4642 |
|
| 4643 |
% \end{macrocode} |
| 4644 |
% |
| 4645 |
% \vskip15\baselineskip\endgraf\vskip-15\baselineskip\vskip0pt |
| 4646 |
% \begin{macro}{\adl@act@arrayclassz} |
| 4647 |
% \changes{v1.54-2}{2003/08/25} |
| 4648 |
% {Introduced to activate \cs{@arrayclassz} etc. again.} |
| 4649 |
% \begin{macro}{\adl@act@tabclassz} |
| 4650 |
% \begin{macro}{\adl@act@classz} |
| 4651 |
% \begin{macro}{\adl@act@@startpbox} |
| 4652 |
% \begin{macro}{\adl@act@@endpbox} |
| 4653 |
% \begin{macro}{\adl@act@startpbox} |
| 4654 |
% \changes{v1.75}{2018/12/26} |
| 4655 |
% {Introduced because \cs{@startpbox} may be different from the original.} |
| 4656 |
% \begin{macro}{\adl@act@endpbox} |
| 4657 |
% \begin{macro}{\adl@act@cr} |
| 4658 |
% \begin{macro}{\adl@act@argcr} |
| 4659 |
% \begin{macro}{\adl@act@cline} |
| 4660 |
% \begin{macro}{\adl@act@endarray} |
| 4661 |
% \begin{macro}{\adl@act@hline} |
| 4662 |
% \begin{macro}{\adl@act@ihdashline} |
| 4663 |
% \begin{macro}{\adl@act@cdline} |
| 4664 |
% \begin{macro}{\adl@act@@vlineL} |
| 4665 |
% \begin{macro}{\adl@act@@vlineR} |
| 4666 |
% \SpecialIndex{\@arrayclassz} |
| 4667 |
% \SpecialIndex{\@tabclassz} |
| 4668 |
% \SpecialIndex{\@classz} |
| 4669 |
% \SpecialIndex{\@@startpbox} |
| 4670 |
% \SpecialIndex{\@@endpbox} |
| 4671 |
% \SpecialIndex{\@endpbox} |
| 4672 |
% \SpecialIndex{\adl@cr} |
| 4673 |
% \SpecialIndex{\adl@argcr} |
| 4674 |
% \SpecialIndex{\cline} |
| 4675 |
% \SpecialIndex{\adl@endarray} |
| 4676 |
% \SpecialIndex{\adl@hline} |
| 4677 |
% \SpecialIndex{\adl@ihdashline} |
| 4678 |
% \SpecialIndex{\adl@cdline} |
| 4679 |
% \SpecialIndex{\adl@@vlineL} |
| 4680 |
% \SpecialIndex{\adl@@vlineR} |
| 4681 |
% |
| 4682 |
% Finally here we define {\em active} version of |\@arrayclassz| named |
| 4683 |
% |\adl@act@arrayclassz| etc. for |\adl@activate| (see \S\ref{sec:imp-init}). |
| 4684 |
% The definitions are simply done by |\let|-ing |\adl@act@arrayclassz| equal |
| 4685 |
% to |\@arrayclassz| etc\footnote{% |
| 4686 |
% |
| 4687 |
% Alternatively, we may define \cs{adl@act@arrayclassz} in place of |
| 4688 |
% \cs{@arrayclassz} but the author chose this way to minimize the possiblity |
| 4689 |
% of {\em enbug}.}. |
| 4690 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 4691 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 4692 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 4693 |
% \end{macro} |
| 4694 |
% |
| 4695 |
% \begin{macrocode} |
| 4696 |
\let\adl@act@arrayclassz\@arrayclassz |
| 4697 |
\let\adl@act@tabclassz\@tabclassz |
| 4698 |
\ifadl@usingarypkg \let\adl@act@classz\@classz \fi |
| 4699 |
\let\adl@act@@startpbox\@@startpbox |
| 4700 |
\let\adl@act@@endpbox\@@endpbox |
| 4701 |
\let\adl@act@startpbox\@startpbox |
| 4702 |
\let\adl@act@endpbox\@endpbox |
| 4703 |
\let\adl@act@cr\adl@cr |
| 4704 |
\let\adl@act@argcr\adl@argcr |
| 4705 |
\let\adl@act@endarray\adl@endarray |
| 4706 |
\let\adl@act@hline\adl@hline |
| 4707 |
\let\adl@act@ihdashline\adl@ihdashline |
| 4708 |
\let\adl@act@cdline\adl@cdline |
| 4709 |
\let\adl@act@@vlineL\adl@@vlineL |
| 4710 |
\let\adl@act@@vlineR\adl@@vlineR |
| 4711 |
|
| 4712 |
%%^L |
| 4713 |
% \end{macrocode} |
| 4714 |
% |
| 4715 |
% |
| 4716 |
% |
| 4717 |
% \subsection{Compatibility with \textsf{colortab}} |
| 4718 |
% \label{sec:imp-colortab} |
| 4719 |
% |
| 4720 |
% \begin{macro}{\adl@CC@} |
| 4721 |
% \begin{macro}{\CC@} |
| 4722 |
% \changes{v1.5-1}{2000/07/12} |
| 4723 |
% {Modified to save/restore globals before/after height measurement.} |
| 4724 |
% \SpecialIndex{\LCC} |
| 4725 |
% \SpecialIndex{\adl@arraysave} |
| 4726 |
% \SpecialIndex{\adl@arrayrestore} |
| 4727 |
% |
| 4728 |
% The package \textsf{colortab} has a macro; |
| 4729 |
% |
| 4730 |
% \begin{quote} |
| 4731 |
% |\LCC|\meta{colorspec}|\\|\meta{rows}|\ECC| |
| 4732 |
% \end{quote} |
| 4733 |
% |
| 4734 |
% to color \meta{rows} referring \meta{colorspec}. The macro |\CC@|, the |
| 4735 |
% heart of the coloring function, first makes a box with \meta{rows} using |
| 4736 |
% |\@preamble| to measure the height of \meta{rows}, then makes a row putting |
| 4737 |
% a heavy rule of the height in each column with a color command for the |
| 4738 |
% column specified by \meta{colorspec}, and finally puts \meta{rows} |
| 4739 |
% overlaying them on the colored rule. Therefore \meta{rows} is processed |
| 4740 |
% twice by |\CC@| to update |\global| registers/structures incorrectly. |
| 4741 |
% |
| 4742 |
% Thus we modify |\CC@|, if the package \textsf{colortab} is provided, to |
| 4743 |
% save |\global| stuff by |\adl@arraysave| before the height measurement and |
| 4744 |
% restore them by |\adl@arrayrestore| after that. |
| 4745 |
% \end{macro}\end{macro} |
| 4746 |
% |
| 4747 |
% \begin{macrocode} |
| 4748 |
|
| 4749 |
%% Compatibility with colortab |
| 4750 |
|
| 4751 |
\def\adl@CC@#1#2#3{% |
| 4752 |
\ifcolortab |
| 4753 |
\noalign{% |
| 4754 |
\adl@arraysave |
| 4755 |
\setbox\CT@box=\vbox{#1#3\crcr\egroup}% |
| 4756 |
\adl@arrayrestore |
| 4757 |
\CT@dim=\ht\CT@box |
| 4758 |
\global\advance\CT@dim by \dp\CT@box |
| 4759 |
\def\CT@next{}% |
| 4760 |
\futurelet\next\CT@columncolor#2&\@nil}% |
| 4761 |
\CT@next\cr |
| 4762 |
\noalign{\vskip-\CT@dim}% |
| 4763 |
\fi |
| 4764 |
#3} |
| 4765 |
\ifx\ColortabLoaded\undefined\else |
| 4766 |
\let\CC@\adl@CC@ |
| 4767 |
\fi |
| 4768 |
|
| 4769 |
%%^L |
| 4770 |
% \end{macrocode} |
| 4771 |
% |
| 4772 |
% |
| 4773 |
% |
| 4774 |
% \subsection{Compatibility with \textsf{longtable}} |
| 4775 |
% \label{sec:imp-longtable} |
| 4776 |
% |
| 4777 |
% \changes{v1.6}{2003/8/25} |
| 4778 |
% {\S\ref{sec:imp-longtable} is added.} |
| 4779 |
% |
| 4780 |
% \SpecialOptIndex{longtable}{package} |
| 4781 |
% \SpecialOptIndex{longtable}{environment} |
| 4782 |
% \SpecialIndex{\output} |
| 4783 |
% \SpecialIndex{\adl@rowsL} |
| 4784 |
% \SpecialIndex{\adl@rowsR} |
| 4785 |
% |
| 4786 |
% Making \textsf{arydshln} compatible with \textsf{longtable} is a hard job |
| 4787 |
% because a |longtable| consists of multiple {\em chunks} and each chunk is |
| 4788 |
% a distinct |\halign|. We could draw vertical lines in each chunks as we |
| 4789 |
% do with ordinary |array|\slash |table|. However this straightforward |
| 4790 |
% solution should {\em break} dash-lines at invisible borders of chunks and |
| 4791 |
% produce awful results. |
| 4792 |
% |
| 4793 |
% Therefore, this implementation draws dash-lines in |\output| routine in |
| 4794 |
% which we have all the rows to be put in a page. The hard part is to know |
| 4795 |
% which rows are being put in |\output|. This problem is solved by |
| 4796 |
% extracting the leading part of $R^L$ (|\adl@rowsL|) and $R^R$ |
| 4797 |
% (|\adl@rowsR|) by the height\slash depth of the table fraction to be put |
| 4798 |
% and removing the part from $R^{L/R}$. |
| 4799 |
% |
| 4800 |
% |
| 4801 |
% |
| 4802 |
% \subsubsection{Initialization} |
| 4803 |
% \label{sec:imp-lt-init} |
| 4804 |
% \changes{v1.7}{2003/05/21} |
| 4805 |
% {Codes for \textsf{longtable} is surrounded by \cs{ifx}/\cs{fi}} |
| 4806 |
% |
| 4807 |
% First of all, the following switch and |\dimen| register are declared. |
| 4808 |
% \begin{itemize} |
| 4809 |
% \item |
| 4810 |
% \begin{macro}{\ifadl@LTfirstpage} |
| 4811 |
% |\ifadl@LTfirstpage| is tested in |\output| routine to examine if the page |
| 4812 |
% being put has the first fraction of a |longtable|. |
| 4813 |
% \end{macro} |
| 4814 |
% |
| 4815 |
% \item |
| 4816 |
% \begin{macro}{\adl@LTpagetotal} |
| 4817 |
% |\adl@LTpagetotal| is set to |\pagetotal| just before the first portion of a |
| 4818 |
% |longtable| is added to the main vertical list. Since the |\box255| has |
| 4819 |
% items preceding the |\longtable| and its first fraction, we can obtain the |
| 4820 |
% height of the first fraction by subtracting |\adl@LTpagetotal| from the |
| 4821 |
% height plus depth of |\box255|. |
| 4822 |
% \end{macro} |
| 4823 |
% \end{itemize} |
| 4824 |
% |
| 4825 |
% |
| 4826 |
% \begin{macrocode} |
| 4827 |
|
| 4828 |
%% Compatibility with longtable: initialization |
| 4829 |
|
| 4830 |
\newif\ifadl@LTfirstpage |
| 4831 |
\newdimen\adl@LTpagetotal |
| 4832 |
|
| 4833 |
% \end{macrocode} |
| 4834 |
% |
| 4835 |
% Next, we skip everything if \textsf{longtable} is not in use, or |
| 4836 |
% we have undefined-error when we refer to the definitions in it. Note that |
| 4837 |
% since |\newif| cannot be in the |\ifx|\slash|\fi| construct, the |
| 4838 |
% declarations above are excluded. |
| 4839 |
% |
| 4840 |
% \begin{macrocode} |
| 4841 |
\ifx\longtable\undefined\else |
| 4842 |
|
| 4843 |
% \end{macrocode} |
| 4844 |
% |
| 4845 |
% |
| 4846 |
% \begin{macro}{\adl@LT@array} |
| 4847 |
% \begin{macro}{\LT@array} |
| 4848 |
% \changes{v1.73-2}{2016/04/28} |
| 4849 |
% {Add \cs{let}-assignment of \cs{adl@LThdashline} to |
| 4850 |
% \cs{adl@hdashline} so that the \textsf{longtable} version of |
| 4851 |
% \cs{adl@hdashline} is effective only in \texttt{longtable} |
| 4852 |
% environment rather than globally.} |
| 4853 |
% |
| 4854 |
% \begin{macro}{\adl@discard} |
| 4855 |
% \SpecialIndex{\adl@arrayinit} |
| 4856 |
% \SpecialIndex{\adl@hdashline} |
| 4857 |
% \SpecialIndex{\adl@ihdashline} |
| 4858 |
% \SpecialIndex{\adl@LTihdashline} |
| 4859 |
% \SpecialIndex{\ifadl@inactive} |
| 4860 |
% |
| 4861 |
% Then we redefine the macro |\LT@array|, which is the heart of |\longtable|, |
| 4862 |
% saving its original definition in |\adl@LT@array|. The modified |
| 4863 |
% |\LT@array| first calls |\adl@arrayinit| to initialize the global data |
| 4864 |
% structures, and sets |\ifadl@LTfirstpage| to true. Then |\adl@dashline|, |
| 4865 |
% |\adl@idashline| and |\adl@discard| are made |\let|-equal to the |
| 4866 |
% \textsf{longtable} versions |\adl@LTdashline| and |\adl@LTidashline|, and |
| 4867 |
% |\relax| (to inhibit expansion) respectively. Then the macro calls |
| 4868 |
% |\adl@LTinactivate| if |\adl@inactive| is true, and finally calls its |
| 4869 |
% original version |\adl@LT@array|. Note that since |longtable| cannot be |
| 4870 |
% nested; |
| 4871 |
% |
| 4872 |
% \begin{itemize} |
| 4873 |
% \item |
| 4874 |
% |\adl@arraysave| in |\adl@arrayinit| is unnecessary but safe, and thus |
| 4875 |
% its invocation timing is not so sensitive; and |
| 4876 |
% |
| 4877 |
% \item |
| 4878 |
% activator is not required. |
| 4879 |
% \end{itemize} |
| 4880 |
% |
| 4881 |
% Also note that the assignment |\adl@ncol| to |\adl@columns| in |
| 4882 |
% |\adl@arrayinit| is void and thus we will do it afterward. |
| 4883 |
% \end{macro}\end{macro}\end{macro} |
| 4884 |
% |
| 4885 |
% \begin{macro}{\adl@LTinactivate} |
| 4886 |
% \SpecialIndex{\adl@inactivate} |
| 4887 |
% \SpecialIndex{\adl@ihdashline} |
| 4888 |
% \SpecialIndex{\adl@LTinactivehdl} |
| 4889 |
% \SpecialIndex{\endlongtable} |
| 4890 |
% \SpecialIndex{\LT@make@row} |
| 4891 |
% \SpecialIndex{\LT@echunk} |
| 4892 |
% \SpecialIndex{\LT@end@hd@ft} |
| 4893 |
% \SpecialIndex{\LT@kill} |
| 4894 |
% \SpecialIndex{\LT@output} |
| 4895 |
% \SpecialIndex{\adl@org@endlongtable} |
| 4896 |
% \SpecialIndex{\adl@org@LT@make@row} |
| 4897 |
% \SpecialIndex{\adl@org@LT@echunk} |
| 4898 |
% \SpecialIndex{\adl@org@LT@end@hd@ft} |
| 4899 |
% \SpecialIndex{\adl@org@LT@kill} |
| 4900 |
% \SpecialIndex{\adl@org@LT@output} |
| 4901 |
% |
| 4902 |
% The macro |\adl@LTinactivate| first calls |\adl@inactivate| to do basic |
| 4903 |
% inactivation and then |\let|-s the following control sequences be equal to |
| 4904 |
% their counterparts in \textsf{longtable}. |
| 4905 |
% \begin{itemize}\item[] |
| 4906 |
% |\endlongtable|\quad |
| 4907 |
% |\LT@make@row|\quad |
| 4908 |
% |\LT@echunk|\quad |
| 4909 |
% |\LT@end@hd@ft|\quad |
| 4910 |
% |\LT@kill|\\ |
| 4911 |
% |\LT@output| |
| 4912 |
% \end{itemize} |
| 4913 |
% It also make |\adl@idashline| |\let|-equal to its inactive version because |
| 4914 |
% we need the macro to find mixed |\hline| and |\hdasnline| sequence. |
| 4915 |
% \end{macro} |
| 4916 |
% |
| 4917 |
% \begin{macrocode} |
| 4918 |
\let\adl@LT@array\LT@array |
| 4919 |
\def\LT@array{\adl@arrayinit \adl@LTfirstpagetrue |
| 4920 |
\let\adl@discard\relax \let\adl@hdashline\adl@LThdashline |
| 4921 |
\let\adl@ihdashline\adl@LTihdashline |
| 4922 |
\ifadl@inactive \adl@LTinactivate \fi |
| 4923 |
\adl@LT@array} |
| 4924 |
\def\adl@LTinactivate{\adl@inactivate |
| 4925 |
\let\endlongtable\adl@org@endlongtable |
| 4926 |
\let\LT@make@row\adl@org@LT@make@row |
| 4927 |
\let\LT@echunk\adl@org@LT@echunk |
| 4928 |
\let\LT@end@hd@ft\adl@org@LT@end@hd@ft |
| 4929 |
\let\LT@kill\adl@org@LT@kill |
| 4930 |
\let\LT@output\adl@org@LT@output |
| 4931 |
\let\adl@ihdashline\adl@LTinactivehdl} |
| 4932 |
|
| 4933 |
% \end{macrocode} |
| 4934 |
% |
| 4935 |
% \begin{macro}{\adl@org@LT@make@row} |
| 4936 |
% \begin{macro}{\LT@make@row} |
| 4937 |
% \SpecialIndex{\adl@ncol} |
| 4938 |
% \SpecialIndex{\adl@columns} |
| 4939 |
% \SpecialIndex{\adl@LTstartpbox} |
| 4940 |
% \SpecialIndex{\adl@@LTstartpbox} |
| 4941 |
% \SpecialIndex{\@startpbox} |
| 4942 |
% \SpecialIndex{\@@startpbox} |
| 4943 |
% \SpecialIndex{\adl@LTendpbox} |
| 4944 |
% \SpecialIndex{\@endpbox} |
| 4945 |
% \SpecialIndex{\@@endpbox} |
| 4946 |
% \SpecialIndex{\LT@startpbox} |
| 4947 |
% \SpecialIndex{\adl@endmbox} |
| 4948 |
% \SpecialIndex{\adl@@endmbox} |
| 4949 |
% \SpecialIndex{\adl@LTendmbox} |
| 4950 |
% |
| 4951 |
% \changes{v1.72-1}{2016/03/19} |
| 4952 |
% {Modified to add \cs{let}-assignments to \cs{adl@@endmbox} and |
| 4953 |
% \cs{adl@endbmox} so that footnotes are correclty processed at the |
| 4954 |
% closing of a \texttt{m}-type column.} |
| 4955 |
% \changes{v1.75}{2018/12/26} |
| 4956 |
% {Add description that \cs{adl@LTendpbox} is common for \cs{@endpbox} |
| 4957 |
% and \cs{@@endpbox}.} |
| 4958 |
% \changes{v1.76}{2019/02/21} |
| 4959 |
% {Modified to add \cs{let}-assignment |
| 4960 |
% $\cs{@startpbox}\EQ\cs{adl@LTstartpbox}$ if \textsf{array} is in |
| 4961 |
% use, and to replace the RHS of \cs{let}-assignments of |
| 4962 |
% \cs{@@startpbox} and \cs{@startpbox} for the case without |
| 4963 |
% \textsf{array}, which was \cs{adl@LTstartpbox}, with newly |
| 4964 |
% introduced \cs{adl@@LTstartpbox}.} |
| 4965 |
% |
| 4966 |
% The macro |\LT@make@row| is redefined for additional initialization which |
| 4967 |
% must be done after the original |\LT@array| performs its own |
| 4968 |
% initialization. First, |\LT@make@row| itself is reset to its original |
| 4969 |
% version |\adl@org@LT@make@row| to initialize stuff only once, since |
| 4970 |
% |\LT@make@row| is called repeatedly at each chunk. Next |\adl@ncol| is |
| 4971 |
% assigned to |\adl@columns| to give its value calculated in |\@mkpream|. |
| 4972 |
% |
| 4973 |
% Then macros to begin\slash end |p|-boxes are made |\let|-equal to our own |
| 4974 |
% version because the original |\LT@array| has done it with |
| 4975 |
% \textsf{longtable}'s own version. That is, if \textsf{array} is in use |
| 4976 |
% |\@startpbox| is |\let|-equal to our own |\adl@LTstartpbox|, while |
| 4977 |
% |\@@startpbox| and |\@startpbox| are |\let|-equal to another macro |
| 4978 |
% |\adl@@LTstartpbox| of our own. On the other hand, |\@@endpbox| and |
| 4979 |
% |\@endpbox| are commonly |\let|-equal to our own |\adl@LTendpbox|. Note |
| 4980 |
% that these our own macros indirectly invoke |\color@begingroup| and |
| 4981 |
% |\color@endgroup|, which are added to |\LT@startpbox| and |\LT@endpbox| of |
| 4982 |
% \textsf{longtable} bundled in \textsf{latex-tools} 2019-01-05, to make the |
| 4983 |
% color grouping effective regardless the version of \textsf{longtable}. |
| 4984 |
% Also note that we need |\adl@LTendmbox| to close |m|-boxes through our own |
| 4985 |
% closing macro |\adl@endmbox|, whose definition is kept in |\adl@@endmbox|, |
| 4986 |
% for \textsf{longtable}-specific operations for footnotes. |
| 4987 |
% |
| 4988 |
% Finally, the original version |\adl@org@LT@make@row| is called. |
| 4989 |
% \end{macro}\end{macro} |
| 4990 |
% |
| 4991 |
% \begin{macrocode} |
| 4992 |
\let\adl@org@LT@make@row\LT@make@row |
| 4993 |
\def\LT@make@row{\let\LT@make@row\adl@org@LT@make@row |
| 4994 |
\adl@columns\adl@ncol |
| 4995 |
\ifadl@usingarypkg |
| 4996 |
\let\@startpbox\adl@LTstartpbox |
| 4997 |
\else |
| 4998 |
\let\@@startpbox\adl@@LTstartpbox |
| 4999 |
\let\@startpbox\adl@@LTstartpbox |
| 5000 |
\fi |
| 5001 |
\let\@@endpbox\adl@LTendpbox |
| 5002 |
\let\@endpbox\adl@LTendpbox |
| 5003 |
\let\adl@@endmbox\adl@endmbox |
| 5004 |
\let\adl@endmbox\adl@LTendmbox |
| 5005 |
\adl@org@LT@make@row} |
| 5006 |
|
| 5007 |
%%^L |
| 5008 |
% \end{macrocode} |
| 5009 |
% |
| 5010 |
% The summary of the activation and inactivation specific to |
| 5011 |
% \textsf{longtable} is shown in Table~\ref{tab:lt-act}. |
| 5012 |
% |
| 5013 |
% |
| 5014 |
% |
| 5015 |
% \begin{table} |
| 5016 |
% \catcode`\|12 |
| 5017 |
% \caption{Active and Inactive \textsf{longtable} Operations}\label{tab:lt-act} |
| 5018 |
% \def\!{\texttt{\char`\\\char`\\}} |
| 5019 |
% \centerline{\begin{tabular}[t]{|l||l|l|}\hline |
| 5020 |
% command&active&inactive\\\hline\hline |
| 5021 |
% {\tt p b} (open)&&\\ |
| 5022 |
% \qquad with \textsf{array}& \cs{adl@act@classz}& |
| 5023 |
% \cs{adl@org@classz}\\ |
| 5024 |
% & \quad$\to$\cs{adl@LTstartpbox}& |
| 5025 |
% \quad$\to$\cs{LT@startpbox}\\ |
| 5026 |
% \qquad without \textsf{array}&\cs{adl@@LTstartpbox}& |
| 5027 |
% \cs{LT@startpbox}\\\hline |
| 5028 |
% {\tt m} (open)& \cs{adl@act@classz}& |
| 5029 |
% \cs{adl@org@classz}\\ |
| 5030 |
% & \quad$\to$\cs{adl@startmbox}& |
| 5031 |
% \quad$\to$\cs{LT@startpbox}\\ |
| 5032 |
% & \quad$\to$\cs{LT@startpbox}&\\\hline |
| 5033 |
% {\tt p b} (close)& \cs{adl@LTendpbox}& |
| 5034 |
% \cs{LT@endpbox}\\\hline |
| 5035 |
% {\tt m} (close)& \cs{adl@LTendmbox}& |
| 5036 |
% \cs{LT@endpbox}\\\hline |
| 5037 |
% \cs{hline}& $\to$\cs{adl@act@hline}& |
| 5038 |
% $\to$\cs{@gobbletwo}\\\hline |
| 5039 |
% \cs{hdashline}& $\to$\cs{adl@LTihdashline}& |
| 5040 |
% $\to$\cs{adl@LTinactivehdl}\\ |
| 5041 |
% & $\to$\cs{adl@act@hline}& |
| 5042 |
% $\to$\cs{@gobbletwo}\\\hline |
| 5043 |
% \cs{endlongtable}& modified version& |
| 5044 |
% \cs{adl@org@endlongtable}\\ |
| 5045 |
% \cs{LT@make@row}&& \cs{adl@org@LT@make@row}\\ |
| 5046 |
% \cs{LT@echunk}&& \cs{adl@org@LT@echunk}\\ |
| 5047 |
% \cs{LT@end@hd@ft}&& \cs{adl@org@LT@end@hd@ft}\\ |
| 5048 |
% \cs{LT@kill}&& \cs{adl@org@LT@kill}\\ |
| 5049 |
% \cs{LT@output}&& \cs{adl@org@LT@output}\\\hline |
| 5050 |
% \end{tabular}} |
| 5051 |
% \end{table} |
| 5052 |
% |
| 5053 |
% |
| 5054 |
% |
| 5055 |
% \subsubsection{Ending Chunks} |
| 5056 |
% \label{sec:imp-lt-echunk} |
| 5057 |
% |
| 5058 |
% \begin{macro}{\adl@org@endlongtable} |
| 5059 |
% \begin{macro}{\endlongtable} |
| 5060 |
% \begin{macro}{\adl@org@LT@echunk} |
| 5061 |
% \begin{macro}{\LT@echunk} |
| 5062 |
% \begin{macro}{\adl@LTlastrow} |
| 5063 |
% \SpecialIndex{\adl@height} |
| 5064 |
% \SpecialIndex{\adl@depth} |
| 5065 |
% \SpecialIndex{\adl@@cr} |
| 5066 |
% |
| 5067 |
% When a chunk is closed with |\crcr|, we have to add the information of the |
| 5068 |
% last row to $R^{L/R}=|\adl@rowsL|/|R|$ if the row is not finished by an |
| 5069 |
% explicit |\\|. This is done by |\adl@LTlastrow| as we did at the first |
| 5070 |
% job of |\adl@endarray|. Two chunk closing macros, |\endlongtable| and |
| 5071 |
% |\LT@echunk|, are modified to call |\adl@LTlastrow| before its original |
| 5072 |
% job done by |\adl@org@endlongtable| and |\adl@org@LT@echunk| respectively. |
| 5073 |
% Note that |\adl@LTlastrow| only has |\crcr| and |\noalign| and thus |
| 5074 |
% another |\crcr| in original |\endlongtable| and |\LT@echunk| is |
| 5075 |
% no-operation as desired. Also note that |\adl@LTlastrow| is called twice |
| 5076 |
% from |\endlongtable|, once from |\LT@echunk| in the original version, but |
| 5077 |
% it is safe because the first call makes |\adl@height| and |\adl@depth| |
| 5078 |
% zero and thus the second become no-operation. |
| 5079 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 5080 |
% |
| 5081 |
% |
| 5082 |
% \begin{macrocode} |
| 5083 |
|
| 5084 |
%% Compatibility with longtable: end chunk |
| 5085 |
|
| 5086 |
\let\adl@org@endlongtable\endlongtable |
| 5087 |
\def\endlongtable{\adl@LTlastrow \adl@org@endlongtable} |
| 5088 |
|
| 5089 |
\let\adl@org@LT@echunk\LT@echunk |
| 5090 |
\def\LT@echunk{\adl@LTlastrow \adl@org@LT@echunk} |
| 5091 |
|
| 5092 |
\def\adl@LTlastrow{\crcr \noalign{ |
| 5093 |
\ifdim\adl@height=\z@ |
| 5094 |
\ifdim\adl@depth=\z@ \else \adl@@cr\z@ \fi |
| 5095 |
\else \adl@@cr\z@ \fi}} |
| 5096 |
|
| 5097 |
% \end{macrocode} |
| 5098 |
% |
| 5099 |
% \begin{macro}{\adl@org@LT@end@hd@ft} |
| 5100 |
% \begin{macro}{\LT@end@hd@ft} |
| 5101 |
% \begin{macro}{\adl@LThfsave} |
| 5102 |
% \begin{macro}{\adl@LTth} |
| 5103 |
% \begin{Macro}{\\adl@LTth\LT@firsthead} |
| 5104 |
% \begin{Macro}{\\adl@LTth\LT@head} |
| 5105 |
% \begin{Macro}{\\adl@LTth\LT@lastfoot} |
| 5106 |
% \begin{Macro}{\\adl@LTth\LT@foot} |
| 5107 |
% \begin{Macro}{\\adl@rowsL\LT@firsthead} |
| 5108 |
% \begin{Macro}{\\adl@rowsL\LT@head} |
| 5109 |
% \begin{Macro}{\\adl@rowsL\LT@lastfoot} |
| 5110 |
% \begin{Macro}{\\adl@rowsL\LT@foot} |
| 5111 |
% \begin{Macro}{\\adl@rowsR\LT@firsthead} |
| 5112 |
% \begin{Macro}{\\adl@rowsR\LT@head} |
| 5113 |
% \begin{Macro}{\\adl@rowsR\LT@lastfoot} |
| 5114 |
% \begin{Macro}{\\adl@rowsR\LT@foot} |
| 5115 |
% \SpecialIndex{\endfirsthead} |
| 5116 |
% \SpecialIndex{\endhead} |
| 5117 |
% \SpecialIndex{\endlastfoot} |
| 5118 |
% \SpecialIndex{\endfoot} |
| 5119 |
% \SpecialIndex{\LT@firsthead} |
| 5120 |
% \SpecialIndex{\LT@head} |
| 5121 |
% \SpecialIndex{\LT@lastfoot} |
| 5122 |
% \SpecialIndex{\LT@foot} |
| 5123 |
% \SpecialIndex{\adl@rowsL} |
| 5124 |
% \SpecialIndex{\adl@rowsR} |
| 5125 |
% \SpecialIndex{\adl@totalheight} |
| 5126 |
% |
| 5127 |
% Another chunk ending macro is |\LT@end@hd@ft|\meta{box} to close a |
| 5128 |
% header\slash footer called by |\endfirsthead|, |\endhead|, |\endlastfoot| |
| 5129 |
% and |\endfoot| with an argument \meta{box} being |\LT@firsthead|, |
| 5130 |
% |\LT@head|, |\LT@lastfoot| and |\LT@foot| respectively. |
| 5131 |
% In order to maintain the information of rows |
| 5132 |
% $R^{L/R}=|\adl@rowsL|/|R|$ of headers/footers separately from the main one, |
| 5133 |
% the modified |\LT@end@hd@ft| saves them together with |
| 5134 |
% |\adl@totalheight| to weirdly named macros; |
| 5135 |
% |
| 5136 |
% \begin{quote} |
| 5137 |
% |\\adl@LTth|\meta{box}\\ |
| 5138 |
% |\\adl@rowsL|\meta{box}\\ |
| 5139 |
% |\\adl@rowsR|\meta{box} |
| 5140 |
% \end{quote} |
| 5141 |
% |
| 5142 |
% after closing the last row by |\adl@LTlastrow|. The |\string| |
| 5143 |
% representation of the macros looks like; |
| 5144 |
% |
| 5145 |
% \begin{quote} |
| 5146 |
% |\\adl@LTth\LT@firsthead| |
| 5147 |
% \end{quote} |
| 5148 |
% and so on. The saving operation is done by |
| 5149 |
% the macro |\adl@LThfsave|\meta{box}\meta{info} and is equivalent to; |
| 5150 |
% |
| 5151 |
% \begin{quote} |
| 5152 |
% |\global\let\|\meta{info}\meta{box}=\meta{info} |
| 5153 |
% \end{quote} |
| 5154 |
% |
| 5155 |
% After the saving, three global variables are reinitialized. Calling |
| 5156 |
% |\adl@LTlastrow| twice, once from the original version through |
| 5157 |
% |\LT@echunk| is safe as described above. |
| 5158 |
% \end{Macro}\end{Macro}\end{Macro}\end{Macro} |
| 5159 |
% \end{Macro}\end{Macro}\end{Macro}\end{Macro} |
| 5160 |
% \end{Macro}\end{Macro}\end{Macro}\end{Macro} |
| 5161 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 5162 |
% |
| 5163 |
% \begin{macrocode} |
| 5164 |
\let\adl@org@LT@end@hd@ft\LT@end@hd@ft |
| 5165 |
\def\LT@end@hd@ft#1{\adl@LTlastrow |
| 5166 |
\noalign{\edef\adl@LTth{\number\adl@totalheight}% |
| 5167 |
\adl@LThfsave#1\adl@LTth \global\adl@totalheight\z@ |
| 5168 |
\adl@LThfsave#1\adl@rowsL\gdef\adl@rowsL{}% |
| 5169 |
\adl@LThfsave#1\adl@rowsR\gdef\adl@rowsR{}} |
| 5170 |
\adl@org@LT@end@hd@ft#1} |
| 5171 |
\def\adl@LThfsave#1#2{\expandafter\global\expandafter\let |
| 5172 |
\csname\string#2\string#1\endcsname#2} |
| 5173 |
|
| 5174 |
% \end{macrocode} |
| 5175 |
% |
| 5176 |
% \begin{macro}{\adl@org@LT@kill} |
| 5177 |
% \begin{macro}{\LT@kill} |
| 5178 |
% \begin{macro}{\adl@LTkill} |
| 5179 |
% \begin{macro}{\adl@LTkillend} |
| 5180 |
% The additional job for yet another chunk closer |\LT@kill| to kill a |
| 5181 |
% template row is a little bit harder. Since the row information might have |
| 5182 |
% been added by an explicit |\\| preceding |\kill|, we have to remove it |
| 5183 |
% from the tail of |\adl@rowsL|\slash|R|, and subtract its $h_i$ from |
| 5184 |
% |\adl@totalheight| because |\kill|-ed row may be in header\slash footer |
| 5185 |
% definition. To do that, modified |\LT@kill| first ensures the information |
| 5186 |
% addition by |\adl@LTlastrow|, then traverses |\adl@rowsL|\slash|R| adding |
| 5187 |
% its non-last elements to |\@tempb| by the loop of |\adl@LTkill|, and |
| 5188 |
% assigns |\@tempb| to |\adl@rowsL|\slash|R| globally by |
| 5189 |
% |\adl@LTkillend| when |\adl@LTkill| finds the tail. The macro |
| 5190 |
% |\adl@LTkillend| also sets the $h_i$ of the last element to |\@tempcnta|, |
| 5191 |
% which is subtracted from |\adl@totalheight| globally. Finally, the |
| 5192 |
% original version |\adl@org@LT@kill| is called. |
| 5193 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 5194 |
% |
| 5195 |
% \begin{macrocode} |
| 5196 |
\let\adl@org@LT@kill\LT@kill |
| 5197 |
\def\LT@kill{\adl@LTlastrow \noalign{ |
| 5198 |
\def\@tempb{}\expandafter\adl@LTkill\adl@rowsL\@nil\adl@rowsL |
| 5199 |
\def\@tempb{}\expandafter\adl@LTkill\adl@rowsR\@nil\adl@rowsR |
| 5200 |
\global\advance\adl@totalheight-\@tempcnta}% |
| 5201 |
\adl@org@LT@kill} |
| 5202 |
\def\adl@LTkill#1;#2{\def\@tempa{#2}% |
| 5203 |
\ifx\@tempa\@nnil\def\next{\adl@LTkillend#1}% |
| 5204 |
\else\edef\@tempb{\@tempb#1;}\def\next{\adl@LTkill#2}\fi |
| 5205 |
\next} |
| 5206 |
\def\adl@LTkillend(#1/#2)#3{\global\let#3\@tempb \@tempcnta#2\relax} |
| 5207 |
|
| 5208 |
%%^L |
| 5209 |
% \end{macrocode} |
| 5210 |
% |
| 5211 |
% |
| 5212 |
% |
| 5213 |
% \subsubsection{Horizontal Lines and \texttt{p}-Boxes} |
| 5214 |
% \label{sec:imp-lt-hlpbox} |
| 5215 |
% |
| 5216 |
% \begin{macro}{\LT@hline} |
| 5217 |
% \begin{macro}{\adl@LThdashline} |
| 5218 |
% \changes{v1.7-1}{2004/5/21} |
| 5219 |
% {Keep original without shift up because it is done by |
| 5220 |
% \cs{adl@LThdline}.} |
| 5221 |
% \changes{v1.73-2}{2016/04/28} |
| 5222 |
% {Renamed from \cs{adl@hdashline} to make it effective only in |
| 5223 |
% \texttt{longtable} environments.} |
| 5224 |
% \begin{macro}{\adl@LTihdashline} |
| 5225 |
% \begin{macro}{\adl@LTinactivehdl} |
| 5226 |
% \begin{macro}{\adl@LThdlrow} |
| 5227 |
% \SpecialIndex{\hline} |
| 5228 |
% \SpecialIndex{\adl@hdashline} |
| 5229 |
% \SpecialIndex{\adl@ihdashline} |
| 5230 |
% \SpecialIndex{\adl@inactivehdl} |
| 5231 |
% \SpecialIndex{\adl@hcline} |
| 5232 |
% |
| 5233 |
% The macro |\LT@hline|, \textsf{longtable} version of |\hline|, is |
| 5234 |
% redefined to add pseudo row information to $R^{L/R}$ and to check mixed |
| 5235 |
% sequence of |\hline| and |\hdashline|\footnote{ |
| 5236 |
% |
| 5237 |
% In the original \textsf{longtable}, a sequence of three \cs{hline}-s are not |
| 5238 |
% recognized. This buggy feature is fixed in this implementation.}. |
| 5239 |
% |
| 5240 |
% We also define the macro |\adl@LTihdashline[|\meta{dash}|/|\meta{gap}|]| |
| 5241 |
% and its inactive counterpart |\adl@LTinactivehdl| as the |
| 5242 |
% \textsf{longtable} version of |\adl@ihdashline| and |\adl@inactivehdl|. |
| 5243 |
% These two macros, the main part of |\hdashline|, are redefined to make it |
| 5244 |
% possible that |\hdashline| can be broken into two part by \TeX's page |
| 5245 |
% breaker. |
| 5246 |
% |
| 5247 |
% These three macros call a common routine |\adl@LThdline| after defining |
| 5248 |
% |\adl@LThdlrow| which makes a row of horizontal (dash) line drawn by |
| 5249 |
% |\multispan| and |\leaders\hrule| or |
| 5250 |
% |\adl@hcline[|\meta{dash}|/|\meta{gap}|]|. |
| 5251 |
% |
| 5252 |
% Note that we define |\adl@LThdashline| to make |\adl@hdashline| |
| 5253 |
% \cs{let}-equal to it in \textsf{longtable} environments because its |
| 5254 |
% version without \textsf{longtable} performs a part of the job done by |
| 5255 |
% |\adl@LThdline| as shown soon. |
| 5256 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 5257 |
% |
| 5258 |
% \begin{macrocode} |
| 5259 |
|
| 5260 |
%% Compatibility with longtable: horizontal lines and p-boxes |
| 5261 |
|
| 5262 |
\def\LT@hline{\noalign{\ifnum0=`}\fi |
| 5263 |
\gdef\adl@LThdlrow{\multispan{\LT@cols}\unskip |
| 5264 |
\leaders\hrule\@height\arrayrulewidth\hfill\cr}% |
| 5265 |
\adl@LThdline} |
| 5266 |
\def\adl@LThdashline#1{\noalign{\ifnum0=`}\fi |
| 5267 |
\@ifnextchar[%] |
| 5268 |
{#1}% |
| 5269 |
{#1[\dashlinedash/\dashlinegap]}} |
| 5270 |
\def\adl@LTihdashline[#1/#2]{% |
| 5271 |
\gdef\adl@LThdlrow{\multispan{\LT@cols}\unskip |
| 5272 |
\adl@hcline\z@[#1/#2]}% |
| 5273 |
\adl@LThdline} |
| 5274 |
\def\adl@LTinactivehdl[#1/#2]{% |
| 5275 |
\gdef\adl@LThdlrow{\multispan{\LT@cols}\unskip |
| 5276 |
\leaders\hrule\@height\arrayrulewidth\hfill\cr}% |
| 5277 |
\adl@LThdline} |
| 5278 |
|
| 5279 |
% \end{macrocode} |
| 5280 |
% |
| 5281 |
% |
| 5282 |
% \begin{macro}{\adl@LThdline} |
| 5283 |
% \changes{v1.7-1}{2004/5/21} |
| 5284 |
% {Modified to shift up if null-wide.} |
| 5285 |
% \begin{macro}{\adl@LTxhline} |
| 5286 |
% \begin{macro}{\adl@LTixhline} |
| 5287 |
% \SpecialIndex{\@medpenalty} |
| 5288 |
% \SpecialIndex{\@lowpenalty} |
| 5289 |
% \SpecialIndex{\adl@hline} |
| 5290 |
% \SpecialIndex{\adl@connect} |
| 5291 |
% \SpecialIndex{\adl@discard} |
| 5292 |
% |
| 5293 |
% The macro |\adl@LThdline| called by above three macros first |
| 5294 |
% inserts a vertical penalty 10000 to inhibit page break between the |
| 5295 |
% horizontal line and preceding row. Then it inserts |
| 5296 |
% |\vskip-\arrayrulewidth| with another break inhibitor if |
| 5297 |
% |\ADLnullwidehline| is in effect, or adds the |
| 5298 |
% pseudo row information {\it connect}(|\arrayrulewidth|) to $R^{L/R}$ by |
| 5299 |
% |\adl@hline|\footnote{ |
| 5300 |
% |
| 5301 |
% Or do noting if inactive and thus it is \cs{let}-equal to \cs{@gobbletwo}.}. |
| 5302 |
% |
| 5303 |
% Next, it draw a horizontal (dash) line by |
| 5304 |
% |\adl@LThdlrow| and checks if the following control sequence is |\hline| |
| 5305 |
% or |\hdashline| by |\futurelet| and |\adl@LTxhline|. If |\hline| or |
| 5306 |
% |\hdashline| is the next token, |\adl@LTixhline| is called to insert a |
| 5307 |
% vertical penalty of $-$|\@medpenalty| and a vertical space of |
| 5308 |
% |\doublerulesep|. The macro |\adl@LTixhline| also adds {\it |
| 5309 |
% disconnect}(|\doublerulesep|) to $R^{L/R}$ and makes |\adl@LThdlrow| void. |
| 5310 |
% Otherwise, |\adl@LThdline| inserts a vertical penalty of $-$|\@lowpanalty| |
| 5311 |
% and a vertical space of $-$|\arrayrulewidth| and draws the horizontal |
| 5312 |
% (dash) line again by |\adl@LThdlrow|. Thus a page can be broken between |
| 5313 |
% two overlaid horizontal (dash) lines\footnote{ |
| 5314 |
% |
| 5315 |
% If the page is broken, the horizontal line at the beginning of the |
| 5316 |
% succeeding page has a width even if \cs{ADLnullwidehline} is in effect.}. |
| 5317 |
% |
| 5318 |
% Two pseudo row information, {\it |
| 5319 |
% discard}($-$|\arrayrulewidth|) for the negative vertical space which may |
| 5320 |
% be discarded and {\it connect}(|\arrayrulewidth|) for the second |
| 5321 |
% horizontal line, are also added to $R^{L/R}$. |
| 5322 |
% \end{macro}\end{macro}\end{macro} |
| 5323 |
% |
| 5324 |
% \begin{macrocode} |
| 5325 |
\def\adl@LThdline{\penalty\@M |
| 5326 |
\ifadl@zwhrule \vskip-\arrayrulewidth \penalty\@M |
| 5327 |
\else \adl@hline\adl@connect\arrayrulewidth \fi |
| 5328 |
\ifnum0=`{\fi}% |
| 5329 |
\adl@LThdlrow |
| 5330 |
\noalign{\ifnum0=`}\fi |
| 5331 |
\futurelet\@tempa\adl@LTxhline} |
| 5332 |
\def\adl@LTxhline{\ifx\@tempa\hline \adl@LTixhline |
| 5333 |
\else\ifx\@tempa\hdashline \adl@LTixhline |
| 5334 |
\else \penalty-\@lowpenalty \vskip-\arrayrulewidth |
| 5335 |
\adl@hline\adl@discard{-\arrayrulewidth}% |
| 5336 |
\adl@hline\adl@connect\arrayrulewidth |
| 5337 |
\fi\fi \ifnum0=`{\fi}% |
| 5338 |
\adl@LThdlrow \noalign{\penalty\@M}} |
| 5339 |
\def\adl@LTixhline{\penalty-\@medpenalty \vskip\doublerulesep |
| 5340 |
\adl@hline\relax\doublerulesep \global\let\adl@LThdlrow\@empty} |
| 5341 |
|
| 5342 |
% \end{macrocode} |
| 5343 |
% |
| 5344 |
% \begin{macro}{\adl@@LTstartpbox} |
| 5345 |
% \changes{v1.76}{2019/02/21} |
| 5346 |
% {Added for \texttt{p} columns without \textsf{array}.} |
| 5347 |
% \begin{macro}{\adl@LTstartpbox} |
| 5348 |
% \changes{v1.76}{2019/02/21} |
| 5349 |
% {Modified to invoke \cs{color@begingroup} always.} |
| 5350 |
% \begin{macro}{\adl@LTendpbox} |
| 5351 |
% \changes{v1.75}{2018/12/26} |
| 5352 |
% {Add description that the macro is used for both of \cs{@endpbox} |
| 5353 |
% and \cs{@@endpbox}.} |
| 5354 |
% \changes{v1.76}{2019/02/21} |
| 5355 |
% {Modified to invoke \cs{color@endroup} always.} |
| 5356 |
% \begin{macro}{\adl@LTendmbox} |
| 5357 |
% \changes{v1.72-1}{2016/03/19} |
| 5358 |
% {Added to process footnotes in \texttt{m}-type columns appropriately.} |
| 5359 |
% |
| 5360 |
% \SpecialIndex{\@startpbox} |
| 5361 |
% \SpecialIndex{\@@startpbox} |
| 5362 |
% \SpecialIndex{\adl@box} |
| 5363 |
% \SpecialIndex{\@@endpbox} |
| 5364 |
% \SpecialIndex{\LT@startpbox} |
| 5365 |
% \SpecialIndex{\adl@act@startpbox} |
| 5366 |
% \SpecialIndex{\adl@act@endpbox} |
| 5367 |
% |
| 5368 |
% Macros for opening/closing |p|-boxes are fairly simple. The macro |
| 5369 |
% |\adl@LTstartpbox{|\meta{w}|}| is |\let|-assigned to |\@startpbox| by |
| 5370 |
% |\LT@make@row| to open a |p|-box of $w$ wide by |
| 5371 |
% |\adl@act@startpbox| and performs a footnote related operation introduced |
| 5372 |
% by \textsf{longtable}, when \textsf{array} is in use. If not, this macro |
| 5373 |
% is invoked from |\adl@@LTstartpbox| which is |\let|-equal to |
| 5374 |
% |\@@startpbox| and is to assign the |p|-box to |\adl@box|. Since |
| 5375 |
% |\adl@act@startpbox| is for opening |p|-box with \textsf{array}, it has |
| 5376 |
% |\color@begingroup| in it and thus the color grouping is effective |
| 5377 |
% regardless the version of \textsf{longtable} or \textsf{array}. |
| 5378 |
% |
| 5379 |
% On the other hand, the closing macro |\adl@LTendpbox| for |p| (or |
| 5380 |
% |d|)-boxes is |\let|-equal to |\@endpbox| and |\@@endpbox| for the cases |
| 5381 |
% with\slash without \textsf{array}, and performs the footnote operations |
| 5382 |
% after doing our own ones by |\adl@act@endpbox|, which also has |
| 5383 |
% |\color@begingroup| for version-independent color grouping. |
| 5384 |
% |
| 5385 |
% As for |m|-boxes, the opening operation is done by |\adl@startmbox| in |
| 5386 |
% which $|\@startpbox|\allowbreak=|\adl@LTstartpbox|$ is invoked for the |
| 5387 |
% footnote-related operation. On the ohter hand, the closing operation is |
| 5388 |
% done by |\adl@LTendmbox|, which is made |\let|-equal to |\adl@endmbox| by |
| 5389 |
% our |\LT@make@row|, to perform our own operations by |\adl@@endmbox| in |
| 5390 |
% which the originnal definition of |\adl@enmbox| is kept by |\LT@make@row| |
| 5391 |
% too. Since |\adl@LTstartpbox| and |\adl@@endmbox| have |
| 5392 |
% |\color@begingroup| and |\color@endgroup|, the color-grouping is done |
| 5393 |
% regardless of the version of \textsf{longtable} and \textsf{array}. |
| 5394 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 5395 |
% |
| 5396 |
% \begin{macrocode} |
| 5397 |
\def\adl@@LTstartpbox{\setbox\adl@box\vtop\adl@LTstartpbox} |
| 5398 |
\def\adl@LTstartpbox#1{\adl@act@startpbox{#1}\let\@footnotetext\LT@p@ftntext} |
| 5399 |
\def\adl@LTendpbox{\adl@act@endpbox \the\LT@p@ftn \global\LT@p@ftn{}} |
| 5400 |
\def\adl@LTendmbox{\adl@@endmbox \the\LT@p@ftn \global\LT@p@ftn{}} |
| 5401 |
|
| 5402 |
%%^L |
| 5403 |
% \end{macrocode} |
| 5404 |
% |
| 5405 |
% |
| 5406 |
% |
| 5407 |
% \subsubsection{First Chunk} |
| 5408 |
% \label{sec:imp-lt-start} |
| 5409 |
% |
| 5410 |
% \begin{macro}{\LT@start} |
| 5411 |
% \SpecialIndex{\LT@firsthead} |
| 5412 |
% \SpecialIndex{\adl@LTpagetotal} |
| 5413 |
% |
| 5414 |
% The macro |\LT@start| which puts (first) head and controls the page break |
| 5415 |
% of the first page is modified for the following. |
| 5416 |
% |
| 5417 |
% \begin{itemize} |
| 5418 |
% \item |
| 5419 |
% After it inserts a vertical skip |\LTpre|, |\endgraf| is performed so that |
| 5420 |
% the skip contributes to |\pagetotal|\footnote{ |
| 5421 |
% |
| 5422 |
% This modification is necessary for the original \textsf{longtable}, or it |
| 5423 |
% underestimates the room of the first page and leaves head and foot only.}. |
| 5424 |
% |
| 5425 |
% \item |
| 5426 |
% When the |\box2| is |\vsplit| to get first item of the first chunk, |
| 5427 |
% |\vbadness| is saved into |\@tempcnta|, set to 10000 to avoid unnecessary |
| 5428 |
% |underfull| message\footnote{ |
| 5429 |
% |
| 5430 |
% This is also necessary for the original version.}, |
| 5431 |
% |
| 5432 |
% and restored from |\@tempcnta|. |
| 5433 |
% |
| 5434 |
% \item |
| 5435 |
% The |\dimen| register |\adl@LTpagetotal| is set to |\pagetotal| to know |
| 5436 |
% the total height of the items preceding |longtable|. Since the assignment |
| 5437 |
% is performed after the inserted |\endgraf| and the intentional page break, |
| 5438 |
% it should have real total height. |
| 5439 |
% |
| 5440 |
% \item |
| 5441 |
% The box |\LT@firsthead| is put by |\copy| rather than |\box| because it is |
| 5442 |
% referred to in the |\output| routine. |
| 5443 |
% \end{itemize} |
| 5444 |
% |
| 5445 |
% This macro does not have inactive counterpart because the modification |
| 5446 |
% shown above is desirable (first two) or not-harmful\footnote{ |
| 5447 |
% |
| 5448 |
% Logically, at least.} |
| 5449 |
% |
| 5450 |
% (last two) to the original version. |
| 5451 |
% \end{macro} |
| 5452 |
% |
| 5453 |
% \begin{macrocode} |
| 5454 |
|
| 5455 |
%% Compatibility with longtable: first chunk |
| 5456 |
|
| 5457 |
\def\LT@start{% |
| 5458 |
\let\LT@start\endgraf |
| 5459 |
\endgraf \penalty\z@ \vskip\LTpre \endgraf |
| 5460 |
\dimen@\pagetotal |
| 5461 |
\advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi |
| 5462 |
\advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi |
| 5463 |
\advance\dimen@ \ht\LT@foot |
| 5464 |
\dimen@ii\vfuzz \@tempcnta\vbadness |
| 5465 |
\vfuzz\maxdimen \vbadness\@M |
| 5466 |
\setbox\tw@\copy\z@ |
| 5467 |
\setbox\tw@\vsplit\tw@ to \ht\@arstrutbox |
| 5468 |
\setbox\tw@\vbox{\unvbox\tw@}% |
| 5469 |
\vfuzz\dimen@ii \vbadness\@tempcnta |
| 5470 |
\advance\dimen@\ht |
| 5471 |
\ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi |
| 5472 |
\advance\dimen@\dp |
| 5473 |
\ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi |
| 5474 |
\advance\dimen@ -\pagegoal |
| 5475 |
\ifdim \dimen@>\z@\vfil\break \fi |
| 5476 |
\global\adl@LTpagetotal\pagetotal |
| 5477 |
\global\@colroom\@colht |
| 5478 |
\ifvoid\LT@foot\else |
| 5479 |
\advance\vsize-\ht\LT@foot |
| 5480 |
\global\advance\@colroom-\ht\LT@foot |
| 5481 |
\dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@ |
| 5482 |
\maxdepth\z@ |
| 5483 |
\fi |
| 5484 |
\copy\ifvoid\LT@firsthead \LT@head \else \LT@firsthead \fi |
| 5485 |
\output{\LT@output}} |
| 5486 |
|
| 5487 |
%%^L |
| 5488 |
% \end{macrocode} |
| 5489 |
% |
| 5490 |
% |
| 5491 |
% |
| 5492 |
% \subsubsection{Output Routine} |
| 5493 |
% \label{sec:imp-lt-output} |
| 5494 |
% |
| 5495 |
% \begin{macro}{\adl@org@LT@output} |
| 5496 |
% \begin{macro}{\LT@output} |
| 5497 |
% \SpecialIndex{\LT@firsthead} |
| 5498 |
% \SpecialIndex{\LT@head} |
| 5499 |
% \SpecialIndex{\LT@lastfoot} |
| 5500 |
% \SpecialIndex{\LT@foot} |
| 5501 |
% |
| 5502 |
% The output routine is the heart of the \textsf{longtable} compatible |
| 5503 |
% implementation. The macro |\LT@output| which is set to |\output| by |
| 5504 |
% |\LT@start| is modified from its original (and thus inactive) version |
| 5505 |
% |\adl@org@LT@output| as follows. |
| 5506 |
% |
| 5507 |
% \begin{itemize} |
| 5508 |
% \item |
| 5509 |
% Three fractions of the original version to compile the final output image |
| 5510 |
% of the table portion into |\box255| or the main vertical list are modified |
| 5511 |
% to set the image into |\box255| unconditionally and to call |
| 5512 |
% |\adl@LTdraw|\meta{foot}\meta{tail} which is the real heart of the |
| 5513 |
% compatible implementation. The argument \meta{foot} is |\LT@foot| or |
| 5514 |
% |\LT@lastfoot| according to the portion of the |longtable| to be output. |
| 5515 |
% The argument \meta{tail} is |\vss| if the last item is it which is not |
| 5516 |
% included in |\box255| yet, or |\@empty| otherwise. Since |\adl@LTdraw| |
| 5517 |
% builds final output image drawing vertical (dash) lines in |\box255|, it is |
| 5518 |
% put to the main vertical list if the |longtable| portion is the last one. |
| 5519 |
% |
| 5520 |
% \item |
| 5521 |
% Since the boxes |\LT@head|, |\LT@foot| and |\LT@lastfoot| are referred to in |
| 5522 |
% |\adl@LTdraw|, they are put by |\copy| rather than |\box|. |
| 5523 |
% \end{itemize} |
| 5524 |
% \end{macro}\end{macro} |
| 5525 |
% |
| 5526 |
% \begin{macrocode} |
| 5527 |
|
| 5528 |
%% Compatibility with longtable: output routine |
| 5529 |
|
| 5530 |
\let\adl@org@LT@output\LT@output |
| 5531 |
\def\LT@output{% |
| 5532 |
\ifnum\outputpenalty <-\@Mi |
| 5533 |
\ifnum\outputpenalty > -\LT@end@pen |
| 5534 |
\LT@err{floats and marginpars not allowed in a longtable}\@ehc |
| 5535 |
\else |
| 5536 |
\setbox\z@\vbox{\unvbox\@cclv}% |
| 5537 |
\ifdim \ht\LT@lastfoot>\ht\LT@foot |
| 5538 |
\dimen@\pagegoal |
| 5539 |
\advance\dimen@-\ht\LT@lastfoot |
| 5540 |
\ifdim\dimen@<\ht\z@ |
| 5541 |
\setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot}% |
| 5542 |
\adl@LTdraw\LT@foot\vss |
| 5543 |
\@makecol |
| 5544 |
\@outputpage |
| 5545 |
\setbox\z@\vbox{\copy\LT@head}% |
| 5546 |
\fi |
| 5547 |
\fi |
| 5548 |
\global\@colroom\@colht |
| 5549 |
\global\vsize\@colht |
| 5550 |
\setbox\@cclv\vbox{\unvbox\z@ |
| 5551 |
\copy\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}% |
| 5552 |
\adl@LTdraw\LT@lastfoot\@empty \box\@cclv |
| 5553 |
\fi |
| 5554 |
\else |
| 5555 |
\setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot}% |
| 5556 |
\adl@LTdraw\LT@foot\vss |
| 5557 |
\@makecol |
| 5558 |
\@outputpage |
| 5559 |
\global\vsize\@colroom |
| 5560 |
\copy\LT@head |
| 5561 |
\fi} |
| 5562 |
|
| 5563 |
% \end{macrocode} |
| 5564 |
% |
| 5565 |
% |
| 5566 |
% \begin{macro}{\adl@LTdraw} |
| 5567 |
% \begin{macro}{\adl@LTinit} |
| 5568 |
% \begin{macro}{\adl@LTheadL} |
| 5569 |
% \begin{macro}{\adl@LTheadR} |
| 5570 |
% \begin{macro}{\adl@LTfootL} |
| 5571 |
% \begin{macro}{\adl@LTfootR} |
| 5572 |
% \SpecialIndex{\adl@LTpagetotal} |
| 5573 |
% \SpecialIndex{\ifadl@LTfirstpage} |
| 5574 |
% |
| 5575 |
% The macro |\adl@LTdraw|\meta{foot}\meta{tail} draws vertical |
| 5576 |
% (dash) lines onto the image in |\box255|. First it measures the total |
| 5577 |
% height $H$ (|\adl@totalheight|) of |longtable| rows in |\box255| and the |
| 5578 |
% total height $H_b$ (|\@tempdima|) of its {\em body} which consists of the |
| 5579 |
% rows without the header and footer, as follows where $H_{255}$, $H_h$ and |
| 5580 |
% $H_t$ are the height plus depth of |\box255| and the effective header and |
| 5581 |
% footer of the page respectively. |
| 5582 |
% |
| 5583 |
% \begin{eqnarray*} |
| 5584 |
% T&=&\cases{\hbox{\cs{adl@LTpagetotal}}&if \cs{ifadl@LTfirstpage}\cr |
| 5585 |
% 0&otherwise}\\ |
| 5586 |
% t&=&\cases{ |
| 5587 |
% \hbox{\cs{topskip} glue}& |
| 5588 |
% if \texttt{longtable} is the first item of the page\cr |
| 5589 |
% & ($\lnot(\hbox{\cs{ifadl@firstpage}}\land T{>}0)$)\cr |
| 5590 |
% 0& otherwise}\\ |
| 5591 |
% H&=&H_{255}-t-T\\ |
| 5592 |
% H_b&=&H-H_h-H_t |
| 5593 |
% \end{eqnarray*} |
| 5594 |
% |
| 5595 |
% The hard part is to measure $t$ because it is not |\topskip| but that |
| 5596 |
% minus the first box of |\box255|. Thus we do not measure $t$ but remove |
| 5597 |
% it from the box by the following tricky way. First we copy |\box255| |
| 5598 |
% items into |\box0| adding a |\hrule| of 1\,sp high as its first item. |
| 5599 |
% Then |\box0| is |\vsplit| to 1\,sp setting |\splittopskip| to 0. |
| 5600 |
% Since the |\topskip| glue is the first item of |\box255| and the |\vsplit| |
| 5601 |
% discards it at the breakpoint, |\box0| must have all the items in |
| 5602 |
% |\box255| lead by 0 (|\splittopskip|) glue rather than |\topskip| glue. |
| 5603 |
% Thus the height of |\box0| is $H_{255}-t$. |
| 5604 |
% |
| 5605 |
% \SpecialIndex{\LT@firsthead} |
| 5606 |
% \SpecialIndex{\LT@head} |
| 5607 |
% \SpecialIndex{\LT@lastfoot} |
| 5608 |
% \SpecialIndex{\LT@foot} |
| 5609 |
% \SpecialWeirdIndex{\\adl@LTth\LT@firsthead} |
| 5610 |
% \SpecialWeirdIndex{\\adl@LTth\LT@head} |
| 5611 |
% \SpecialWeirdIndex{\\adl@LTth\LT@lastfoot} |
| 5612 |
% \SpecialWeirdIndex{\\adl@LTth\LT@foot} |
| 5613 |
% \SpecialWeirdIndex{\\adl@rowsL\LT@firsthead} |
| 5614 |
% \SpecialWeirdIndex{\\adl@rowsL\LT@head} |
| 5615 |
% \SpecialWeirdIndex{\\adl@rowsL\LT@lastfoot} |
| 5616 |
% \SpecialWeirdIndex{\\adl@rowsL\LT@foot} |
| 5617 |
% \SpecialWeirdIndex{\\adl@rowsR\LT@firsthead} |
| 5618 |
% \SpecialWeirdIndex{\\adl@rowsR\LT@head} |
| 5619 |
% \SpecialWeirdIndex{\\adl@rowsR\LT@lastfoot} |
| 5620 |
% \SpecialWeirdIndex{\\adl@rowsR\LT@foot} |
| 5621 |
% |
| 5622 |
% Subtraction of $H_h$ and $H_t$ is done by the macro |
| 5623 |
% |\adl@LTinit{|\meta{hf}|}|\meta{box}, where \meta{hf} is |head| or |foot| |
| 5624 |
% and \meta{box} is one of |\LT@firsthead|, |\LT@head| and \meta{foot} |
| 5625 |
% (|\LT@lastfoot| or |\LT@foot|). This macro also copies the contents of |
| 5626 |
% weirdly named structure such as |\\adl@rowsL\LT@head| into |\adl@LTheadL| |
| 5627 |
% and so on\footnote{ |
| 5628 |
% |
| 5629 |
% Copying by \cs{edef} can be replaced by \cs{let} with many |
| 5630 |
% \cs{expandafter} but it is not comprehensible.} |
| 5631 |
% |
| 5632 |
% if \meta{box} is not void. Otherwise, |\adl@LTheadL| etc. is kept to |
| 5633 |
% their initial value, |\@empty|. |
| 5634 |
% |
| 5635 |
% \SpecialIndex{\adl@makevlrL} |
| 5636 |
% \SpecialIndex{\adl@makevlrL} |
| 5637 |
% \SpecialIndex{\adl@rows} |
| 5638 |
% \SpecialIndex{\adl@rowsL} |
| 5639 |
% \SpecialIndex{\adl@rowsR} |
| 5640 |
% \SpecialIndex{\adl@vlrow} |
| 5641 |
% \SpecialIndex{\adl@vlrowL} |
| 5642 |
% \SpecialIndex{\adl@vlrowR} |
| 5643 |
% \SpecialIndex{\adl@addvl} |
| 5644 |
% \SpecialIndex{\adl@addvlL} |
| 5645 |
% \SpecialIndex{\adl@addvlR} |
| 5646 |
% \SpecialIndex{\adl@currentcolumn} |
| 5647 |
% |
| 5648 |
% Next, we make rows for vertical lines by |\adl@makevlrL|\slash|R| after |
| 5649 |
% extracting the leading part of $R^{L/R}$ corresponding to the {\em body} |
| 5650 |
% by the macro |
| 5651 |
% |\adl@LTsplit|\meta{$R^{L/R}$}\meta{$R^{L/R}_h$}\meta{$R^{L/R}_f$}, where |
| 5652 |
% $R^{L/R}_h$ and $R^{L/R}_f$ are |\adl@LTheadL| and so on. Since the macro |
| 5653 |
% defines |\adl@rows| given to |\adl@makevlL|\slash|R| to the sequence of |
| 5654 |
% $R^{L/R}_h$, the extracted part of $R^{L/R}$ and $R^{L/R}_f$, the rows for |
| 5655 |
% vertical lines for all the rows including header and footer are build in |
| 5656 |
% |\adl@vlrowL| and |\adl@vlrowR| as in the ordinary case without |
| 5657 |
% |longtable|. |
| 5658 |
% |
| 5659 |
% \SpecialIndex{\LT@bchunk} |
| 5660 |
% \SpecialIndex{\LT@save@row} |
| 5661 |
% \SpecialIndex{\c@LT@chunks} |
| 5662 |
% \SpecialIndex{\LT@rows} |
| 5663 |
% \SpecialIndex{\adl@vl} |
| 5664 |
% \SpecialIndex{\adl@@vl} |
| 5665 |
% \SpecialIndex{\adl@drawvl} |
| 5666 |
% |
| 5667 |
% Then the rows are put into |\box0| by calling |\LT@bchunk| with |
| 5668 |
% |\adl@drawvl| (line drawing) and |\LT@save@row| (column widths |
| 5669 |
% adjustment), saving\slash restoring counters |\LT@rows| and |\c@LT@chunks| |
| 5670 |
% which |\LT@bchunk| globally updates. Since we refer to potentially |
| 5671 |
% immature |\LT@save@row| here, some weird looking vertical lines could be |
| 5672 |
% drawn but the result after convergence should be correct. Finally, the |
| 5673 |
% contents of |\box255| followed by the vertical lines in |\box0| are put |
| 5674 |
% back into |\box255| keeping its original depth and adding \meta{tail} |
| 5675 |
% (|\vss| or nothing) to its end. |
| 5676 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 5677 |
% |
| 5678 |
% \begin{macrocode} |
| 5679 |
\def\adl@LTdraw#1#2{% |
| 5680 |
\@tempswatrue |
| 5681 |
\ifadl@LTfirstpage\ifdim\adl@LTpagetotal>\z@\@tempswafalse \fi\fi |
| 5682 |
\if@tempswa |
| 5683 |
\setbox\z@\vbox{\hrule height1sp\unvcopy\@cclv} |
| 5684 |
\splittopskip\z@ |
| 5685 |
\setbox\@ne\vsplit\z@ to1sp\relax |
| 5686 |
\@tempdima\ht\z@ |
| 5687 |
\else \@tempdima\ht\@cclv \fi |
| 5688 |
\advance\@tempdima\dp\@cclv |
| 5689 |
\adl@totalheight\@tempdima |
| 5690 |
\let\adl@LTheadL\@empty \let\adl@LTheadR\@empty |
| 5691 |
\let\adl@LTfootL\@empty \let\adl@LTfootR\@empty |
| 5692 |
\ifadl@LTfirstpage |
| 5693 |
\global\adl@LTfirstpagefalse |
| 5694 |
\advance\@tempdima-\adl@LTpagetotal |
| 5695 |
\adl@totalheight\@tempdima |
| 5696 |
\ifvoid\LT@firsthead |
| 5697 |
\adl@LTinit{head}\LT@head |
| 5698 |
\else \adl@LTinit{head}\LT@firsthead |
| 5699 |
\fi |
| 5700 |
\else \adl@LTinit{head}\LT@head \fi |
| 5701 |
\ifvoid#1% |
| 5702 |
\adl@LTinit{foot}\LT@foot |
| 5703 |
\else \adl@LTinit{foot}#1\fi |
| 5704 |
\let\adl@vl\relax \def\adl@discard{\adl@connect}% |
| 5705 |
\def\adl@vlrow{}\adl@currentcolumn\@ne |
| 5706 |
\adl@LTsplit\adl@rowsL\adl@LTheadL\adl@LTfootL |
| 5707 |
\let\adl@addvl\adl@addvlL |
| 5708 |
\adl@makevlrL \let\adl@vlrowL\adl@vlrow |
| 5709 |
\def\adl@vlrow{}\adl@currentcolumn\adl@columns |
| 5710 |
\adl@LTsplit\adl@rowsR\adl@LTheadR\adl@LTfootR |
| 5711 |
\let\adl@addvl\adl@addvlR |
| 5712 |
\adl@makevlrR \let\adl@vlrowR\adl@vlrow |
| 5713 |
\let\adl@vl\adl@@vl |
| 5714 |
\@tempcnta\LT@rows |
| 5715 |
\LT@bchunk \adl@drawvl |
| 5716 |
\LT@save@row\cr \egroup \setbox\@ne\lastbox \unskip \egroup |
| 5717 |
\global\advance\c@LT@chunks\m@ne |
| 5718 |
\global\LT@rows\@tempcnta |
| 5719 |
\@tempdima\dp\@cclv |
| 5720 |
\setbox\@cclv\vbox{\unvbox\@cclv \box\z@ \vskip-\@tempdima |
| 5721 |
\hrule\@width\z@\@height\z@\@depth\@tempdima#2}} |
| 5722 |
\def\adl@LTinit#1#2{\ifvoid#2\else |
| 5723 |
\advance\@tempdima-\csname\string\adl@LTth\string#2\endcsname sp% |
| 5724 |
\expandafter\edef\csname adl@LT#1L\endcsname{% |
| 5725 |
\csname\string\adl@rowsL\string#2\endcsname}% |
| 5726 |
\expandafter\edef\csname adl@LT#1R\endcsname{% |
| 5727 |
\csname\string\adl@rowsR\string#2\endcsname}\fi} |
| 5728 |
|
| 5729 |
% \end{macrocode} |
| 5730 |
% |
| 5731 |
% \begin{macro}{\adl@LTsplit} |
| 5732 |
% \begin{macro}{\adl@LTxsplit} |
| 5733 |
% \begin{macro}{\adl@LTrowrelax} |
| 5734 |
% \begin{macro}{\adl@LTrowdiscard} |
| 5735 |
% \begin{macro}{\adl@LTysplit} |
| 5736 |
% \begin{macro}{\adl@LTisplit} |
| 5737 |
% \begin{macro}{\adl@LTiisplit} |
| 5738 |
% \begin{macro}{\adl@LTsplitend} |
| 5739 |
% \SpecialIndex{\adl@rows} |
| 5740 |
% \SpecialIndex{\adl@discard} |
| 5741 |
% |
| 5742 |
% The macro |
| 5743 |
% |\adl@LTsplit|\meta{$R^{L/R}$}\meta{$R^{L/R}_h$}\meta{$R^{L/R}_f$} moves |
| 5744 |
% leading elements in $R^{L/R}$ into $R'$ (|\adl@rows|) until total heights |
| 5745 |
% of the elements summed in $h$ (|\@tempdimb|) reaches to $H_b$ |
| 5746 |
% (|\@tempdima|)\footnote{ |
| 5747 |
% |
| 5748 |
% Although $h$ must become $H_b$ exactly in usual case, we stop the loop |
| 5749 |
% when $h\geq H_b$ to avoid accidental overrun in unusual cases.} |
| 5750 |
% |
| 5751 |
% by a straightforward loop with the macros |\adl@LTisplit| to fetch the |
| 5752 |
% $i$-th element and |\adl@LTiisplit| to get $h_i$. Before moving, however, |
| 5753 |
% we have to remove discardable item(s)\footnote{ |
| 5754 |
% |
| 5755 |
% Must be only one but the implementation allows two or more.} |
| 5756 |
% |
| 5757 |
% from the top of $R^{L/R}$. Since an element for a discardable item is |
| 5758 |
% {\it disconnect} (|\relax|) or {\it discard} (|\adl@discard|), we check |
| 5759 |
% the first part of the element by |\ifx|-comparison with |\adl@LTrowrelax| |
| 5760 |
% and |\adl@LTrowdiscard| whose bodies are |\relax| and |\adl@discard| if the |
| 5761 |
% |longtable| portion does not have a header ($R^{L/R}_h$ is |\@empty|). |
| 5762 |
% Otherwise, the discardable item was not discarded because the first |
| 5763 |
% item of the page is not it but the header. |
| 5764 |
% |
| 5765 |
% Note that since moving from $R^{L/R}$ to $R'$ is done by |\edef| and |
| 5766 |
% |\adl@discard| is |\def|-ined as |\adl@connect| in |\adl@LTdraw|, |
| 5767 |
% non-discarded {\it discard} transforms into {\it connect} in $R'$. Also |
| 5768 |
% note that since the remaining part of $R^{L/R}$ is |\def|-ined as the body |
| 5769 |
% of |\@tempb| which is globally |\let|-assigned to $R^{L/R}$ again, |
| 5770 |
% |\adl@discard| survives in the new $R^{L/R}$. |
| 5771 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 5772 |
% \end{macro}\end{macro}\end{macro} |
| 5773 |
% |
| 5774 |
% \begin{macrocode} |
| 5775 |
\def\adl@LTsplit#1#2#3{\def\adl@rows{}\@tempdimb\z@ |
| 5776 |
\expandafter\adl@LTxsplit#1\@nil;% |
| 5777 |
\edef\adl@rows{#2\adl@rows#3}% |
| 5778 |
\global\let#1\@tempb} |
| 5779 |
\def\adl@LTxsplit#1;{\def\@tempa{#1}% |
| 5780 |
\ifx\@tempa\@nnil \def\@tempb{}\let\next\relax |
| 5781 |
\else\ifx\adl@LTheadL\@empty \def\next{\adl@LTysplit#1}% |
| 5782 |
\else \def\next{\adl@LTisplit#1;}\fi \fi |
| 5783 |
\next} |
| 5784 |
\def\adl@LTrowrelax{\relax} |
| 5785 |
\def\adl@LTrowdiscard{\adl@discard} |
| 5786 |
\def\adl@LTysplit(#1/#2){\def\@tempa{#1}% |
| 5787 |
\ifx\@tempa\adl@LTrowrelax \let\next\adl@LTxsplit |
| 5788 |
\else\ifx\@tempa\adl@LTrowdiscard \let\next\adl@LTxsplit |
| 5789 |
\else \def\next{\adl@LTisplit(#1/#2);}\fi \fi |
| 5790 |
\next} |
| 5791 |
\def\adl@LTisplit#1;{\def\@tempa{#1}% |
| 5792 |
\ifx\@tempa\@nnil \def\@tempb{}\let\next\relax |
| 5793 |
\else\ifdim\@tempdimb<\@tempdima |
| 5794 |
\adl@LTiisplit#1\let\next\adl@LTisplit |
| 5795 |
\else \def\next{\adl@LTsplitend#1;}\fi \fi |
| 5796 |
\next} |
| 5797 |
\def\adl@LTiisplit(#1/#2){\edef\adl@rows{\adl@rows(#1/#2);}% |
| 5798 |
\advance\@tempdimb#2sp} |
| 5799 |
\def\adl@LTsplitend#1;\@nil;{\def\@tempb{#1;}} |
| 5800 |
\fi |
| 5801 |
|
| 5802 |
%%^L |
| 5803 |
% \end{macrocode} |
| 5804 |
% |
| 5805 |
% |
| 5806 |
% |
| 5807 |
% \subsection{Compatibility with \textsf{colortbl}} |
| 5808 |
% \label{sec:imp-colortbl} |
| 5809 |
% \changes{v1.7}{2003/05/21} |
| 5810 |
% {\S\ref{sec:imp-colortbl} is added.} |
| 5811 |
% |
| 5812 |
% The implementation to make \textsf{arydshln} compatible with |
| 5813 |
% \textsf{colortbl} consists of the following three (almost |
| 5814 |
% independent) issues. |
| 5815 |
% |
| 5816 |
% \begin{description} |
| 5817 |
% \item[Cell coloring] |
| 5818 |
% is the easiest part because it does not affect dash line drawing. Another |
| 5819 |
% reason of the easiness is that \textsf{colortbl} packs each cell in a box |
| 5820 |
% to measure its height for painting in the modified version of |\@classz|. |
| 5821 |
% Thus we do not need to code |\@classz| for both of \textsf{colortbl} and |
| 5822 |
% \textsf{arydshln}, but may sneak our own height\slash depth measurement |
| 5823 |
% into |\@classz| of \textsf{colortbl}. Almost everything we have to pay |
| 5824 |
% attention to is the compatibility of the initialization and finalization |
| 5825 |
% of \textsf{colortbl} and \textsf{arydshln}. |
| 5826 |
% |
| 5827 |
% \item[Horizontal line coloring] |
| 5828 |
% is relatively easy because it is almost enough to insert coloring macro |
| 5829 |
% |\CT@arc@| before the line drawing. A little bit complicated part is the |
| 5830 |
% gap coloring which is done by drawing a solid line of gap color before |
| 5831 |
% dash line is drawn. |
| 5832 |
% |
| 5833 |
% \item[Vertical line coloring] |
| 5834 |
% is the hardest part but almost everything is done in previous sections to |
| 5835 |
% attach dash\slash gap color to each vertical line segment $e^i_j$ in the |
| 5836 |
% list $C_i^L$ and $C_i^R$ of the $i$-th row information $r_i$. What we do |
| 5837 |
% here is to fix the bugs of |\arrayrulecolor| and |\doublerulesepcolor| in |
| 5838 |
% \textsf{colortbl} implementation and to add |\dashgapcolor|. If you put |
| 5839 |
% |\arrayrulecolor| in |>{...}| construct to specify the color |
| 5840 |
% of the vertical lines following the construct as the manual of |
| 5841 |
% \textsf{colortbl} says, you will have an error message ``Misplaced |
| 5842 |
% |\noalign|'' because the macro is expanded with |\noalign| in a column |
| 5843 |
% body. Even if you somehow remove |\noalign| to avoid the error, you will |
| 5844 |
% have a mysterious line coloring as follows: |
| 5845 |
% |
| 5846 |
% \begin{itemize} |
| 5847 |
% \item |
| 5848 |
% If you have |\arrayrulecolor| before the |\array|\slash|\tabular| starts, |
| 5849 |
% |\arrayrule#color| in the preamble has no effect to vertical lines but |
| 5850 |
% decides the color of horizontal lines except for those at the top of the |
| 5851 |
% environment. Additional |\arrayrulecolor| at the beginning of a row has |
| 5852 |
% no effect to vertical lines (as expected) but decides horizontal lines |
| 5853 |
% following it (also as expected). The effect of |\doublerulesepcolor| is |
| 5854 |
% same as |\arrayrulecolor|. |
| 5855 |
% |
| 5856 |
% \item |
| 5857 |
% Otherwise, i.e. without |\arrayrulecolor| outside the environment, |
| 5858 |
% |\arrayrule#color| in the preamble decides the color of vertical and |
| 5859 |
% horizontal lines except for verticals preceding columns in the first row |
| 5860 |
% and horizontals at the top of the environment. Additional |
| 5861 |
% |\arrayrulecolor| at the beginning of a row decides all the vertical and |
| 5862 |
% horizontal lines following it. On the other hand, |\doublerulesepcolor| |
| 5863 |
% acts as if |\doublerulesepcolor{white}| is done outside the environment. |
| 5864 |
% \end{itemize} |
| 5865 |
% |
| 5866 |
% The reason of the mysterious behavior is as follows. An |
| 5867 |
% |\arrayrulecolor|, which globally |\def|-ines a macro |\CT@arc@| with a |
| 5868 |
% body containing |\color|, in the preamble is not expanded nor evaluated in |
| 5869 |
% the preamble construction phase but done when the first (and succeeding) |
| 5870 |
% row is build. On the other hand, |\CT@arc@| attached to vertical line |
| 5871 |
% drawing is expanded in the preamble construction phase. Thus if |
| 5872 |
% |\CT@arc@| has been defined before the environment starts, vertical lines |
| 5873 |
% are colored following the outside definition. Otherwise, since |\CT@arc@| |
| 5874 |
% is |\let|-equal to |\relax|, it remains unchanged in the preamble |
| 5875 |
% construction phase and expanded when each row is build referring to its |
| 5876 |
% definition that |\arrayrulecolor| modifies in the row building phase. |
| 5877 |
% Since the macro |\CT@drsc@| defined by |\doublerulesepcolor| is examined |
| 5878 |
% if it is |\relax| or not in the preamble construction phase, |
| 5879 |
% |\doublerulesepcolor| in the preamble has no effect regardless the |
| 5880 |
% existence of the outside definition. |
| 5881 |
% |
| 5882 |
% Thus we have to expand and evaluate |\arrayrulecolor| and |
| 5883 |
% |\doublerulecolor| in the preamble construction phase to define |\CT@arc@| |
| 5884 |
% and |\CT@drsc@|. We also have to initialize |\CT@arc@| as an expandable |
| 5885 |
% but non-operative token (e.g. a macro with a body of |\relax| as we do) to |
| 5886 |
% make it is expanded in the preamble construction phase rather than the row |
| 5887 |
% building. |
| 5888 |
% \end{description} |
| 5889 |
% |
| 5890 |
% |
| 5891 |
% |
| 5892 |
% \subsubsection{Initialization, Cell Coloring and Finalization} |
| 5893 |
% \label{sec:impl-colortbl-init} |
| 5894 |
% |
| 5895 |
% \begin{macro}{\CT@arc@} |
| 5896 |
% \begin{macro}{\adl@dashgapcolor} |
| 5897 |
% First of all, we initialize the macro |\CT@arc@|, which will be |
| 5898 |
% |\def|-ined as |\color| to specify the color of solid lines and dash |
| 5899 |
% segments by |\arrayrulecolor|, with a body of |\relax| because it will be |
| 5900 |
% referred to by the vertical line drawing process even if \textsf{colortbl} is |
| 5901 |
% not in use. We also initialize the macro |\adl@dashgapcolor| for the |
| 5902 |
% color of gaps of dash lines similarly. Note that these macros are not |
| 5903 |
% |\let|-equal to |\relax| but have bodies of |\relax| so that they are |
| 5904 |
% replaced with |\relax| in the preamble construction phase rather than |
| 5905 |
% surviving with their own name. |
| 5906 |
% \end{macro}\end{macro} |
| 5907 |
% |
| 5908 |
% \begin{macrocode} |
| 5909 |
|
| 5910 |
%% Compatibility with colortbl |
| 5911 |
|
| 5912 |
\def\CT@arc@{\relax} |
| 5913 |
\def\adl@dashgapcolor{\relax} |
| 5914 |
% \end{macrocode} |
| 5915 |
% |
| 5916 |
% \SpecialIndex{\@ifpackageloaded} |
| 5917 |
% Next we examine if \textsf{colortbl} is in use by |\@ifpackageloaded|, and |
| 5918 |
% skip everything if not, or we have some errors especially when |
| 5919 |
% \textsf{array} is not in use. |
| 5920 |
% |
| 5921 |
% \begin{macrocode} |
| 5922 |
\@ifpackageloaded{colortbl}\@tempswatrue\@tempswafalse |
| 5923 |
\if@tempswa |
| 5924 |
% \end{macrocode} |
| 5925 |
% |
| 5926 |
% \begin{macro}{\adl@org@inactivate} |
| 5927 |
% \begin{macro}{\adl@org@activate} |
| 5928 |
% \begin{macro}{\adl@inactivate} |
| 5929 |
% \begin{macro}{\adl@activate} |
| 5930 |
% \changes{v1.75}{2018/12/26} |
| 5931 |
% {Add inactivation of \cs{@startpbox}.} |
| 5932 |
% \begin{macro}{\CT@setup} |
| 5933 |
% \begin{macro}{\@endpbox} |
| 5934 |
% Then we redefine |\adl@inactivate| and |\adl@activate| referring their |
| 5935 |
% original version |\adl@org@inactivate| and |\adl@org@activate| so that |
| 5936 |
% they make |\CT@setup| |\let|-equal to its original version |\adl@CT@setup| |
| 5937 |
% if |\ADLinactivate| is in effect, or to our own version |
| 5938 |
% |\adl@act@CT@setup| which will be defined soon. New |\adl@activate| also |
| 5939 |
% {\em inactivates} \hbox{|\@startpbox|} and \hbox{|\@endpbox|} because our |
| 5940 |
% own ones for column height\slash depth measuremnt is inappropriate with |
| 5941 |
% \textsf{colortbl} as explained soon. |
| 5942 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 5943 |
% |
| 5944 |
% \begin{macrocode} |
| 5945 |
\let\adl@org@inactivate\adl@inactivate |
| 5946 |
\let\adl@org@activate\adl@activate |
| 5947 |
\def\adl@inactivate{\adl@org@inactivate \let\CT@setup\adl@CT@setup} |
| 5948 |
\def\adl@activate{\adl@org@activate \let\CT@setup\adl@act@CT@setup |
| 5949 |
\let\@startpbox\adl@org@startpbox \let\@endpbox\adl@org@endpbox} |
| 5950 |
|
| 5951 |
% \end{macrocode} |
| 5952 |
% |
| 5953 |
% \begin{macro}{\adl@CT@setup} |
| 5954 |
% \begin{macro}{\CT@setup} |
| 5955 |
% \begin{macro}{\adl@act@CT@setup} |
| 5956 |
% \SpecialIndex{\adl@@colhtdp} |
| 5957 |
% Cell coloring is done by |\@classz| preamble of \textsf{colortbl} in which |
| 5958 |
% a column is packed in |\box0|. On the other hand, our own |\@classz| one |
| 5959 |
% with \textsf{array} packs the column in |\adl@box| so that we measure its |
| 5960 |
% height |
| 5961 |
% and depth. Thus we have choices; to insert height\slash depth measurement |
| 5962 |
% into \textsf{colrotbl}'s version; or to insert coloring into our own version. |
| 5963 |
% Since the code of height\slash depth measurement is much simpler than the |
| 5964 |
% coloring, we choose the first way. Thus the macro |\adl@act@CT@setup|, |
| 5965 |
% which is |\let|-equal to |\CT@setup| and is invoked from |\@classz| |
| 5966 |
% preamble after the column is packed into |\box0|, measures the height and |
| 5967 |
% depth of |\box0| and sets |\adl@height| and/or |\adl@depth| to them if |
| 5968 |
% they break the records as |\adl@@colhtdp| does with |\adl@box|, after it |
| 5969 |
% invokes its original version |\adl@CT@setup|. Note that we compare |
| 5970 |
% |\adl@height| with the height of |\box0| plus |\minrowclearance| because |
| 5971 |
% it is the real height. Also note that we could insert the measurement |
| 5972 |
% code into the modified version of \textsf{colortbls}'s |\@classz| placing |
| 5973 |
% it just before the |\box0| is put where |\ht0| plus |\minrowclearance| is |
| 5974 |
% caluculated, but did not because the author wished to make it clear that |
| 5975 |
% |\@classz| is modified only for the bug fix of |\arrayrulecolor| and |
| 5976 |
% |\doublerulesepcolor| (and to introduce |\dashgapcolor|). |
| 5977 |
% \end{macro}\end{macro}\end{macro} |
| 5978 |
% |
| 5979 |
% \begin{macrocode} |
| 5980 |
\let\adl@CT@setup\CT@setup |
| 5981 |
\def\CT@setup{\adl@CT@setup |
| 5982 |
\@tempdima\ht\z@ \advance\@tempdima\minrowclearance |
| 5983 |
\ifdim\adl@height<\@tempdima \global\adl@height\@tempdima \fi |
| 5984 |
\ifdim\adl@depth<\dp\z@ \global\adl@depth\dp\z@\fi} |
| 5985 |
\let\adl@act@CT@setup\CT@setup |
| 5986 |
|
| 5987 |
% \end{macrocode} |
| 5988 |
% |
| 5989 |
% \begin{macro}{\adl@activatepbox} |
| 5990 |
% \SpecialIndex{\CT@cell@color} |
| 5991 |
% \SpecialIndex{\CT@row@color} |
| 5992 |
% \SpecialIndex{\CT@column@color} |
| 5993 |
% \SpecialIndex{\CT@do@color} |
| 5994 |
% \SpecialIndex{\multicolumn} |
| 5995 |
% Another job for cell coloring is to make |\CT@|$x$|@color| |
| 5996 |
% ($x\in\{\texttt{cell},\texttt{column},\texttt{do}\}$) |
| 5997 |
% |\let|-equal to |\relax| before the body of |\multicolumn| is put so that |
| 5998 |
% the |\columncolor| in the environment preamble does not affect the |
| 5999 |
% |\span|-ned column. Note that resetting |\CT@cell@color| will be |
| 6000 |
% unnecessary (but safe) because it is always reset after its invocation. |
| 6001 |
% Also note that resetting |\CT@row@color| in \textsf{colortbl}'s |
| 6002 |
% |\multicolumn| is a buggy feature because it should be effective, and thus |
| 6003 |
% we remove it. Although we have our own |\multicolumn| for dash lines, we |
| 6004 |
% keep it unchanged. Instead we redefine |\adl@activatepbox|, which is |
| 6005 |
% usually |\relax| with \textsf{array}, to do the color resetting to |
| 6006 |
% minimize recoding. |
| 6007 |
% \end{macro} |
| 6008 |
% |
| 6009 |
% \begin{macrocode} |
| 6010 |
\def\adl@activatepbox{\let\CT@cell@color\relax |
| 6011 |
\let\CT@column@color\relax |
| 6012 |
\let\CT@do@color\relax} |
| 6013 |
|
| 6014 |
% \end{macrocode} |
| 6015 |
% |
| 6016 |
% \begin{macro}{\adl@CT@start} |
| 6017 |
% \begin{macro}{\CT@start} |
| 6018 |
% \begin{macro}{\adl@dashgapcolor@save} |
| 6019 |
% \begin{macro}{\adl@CT@end} |
| 6020 |
% \begin{macro}{\CT@end} |
| 6021 |
% \begin{macro}{\endarray} |
| 6022 |
% \changes{v1.74}{2018/09/26} |
| 6023 |
% {Add conditional invokation of \cs{@arrayright}.} |
| 6024 |
% \begin{macro}{\endArray} |
| 6025 |
% Yet another job is the save\slash restore of color information at the |
| 6026 |
% beginning and end of the environment. Since this is done by |\CT@start| and |
| 6027 |
% |\CT@end|, we modify them to save\slash restore |\adl@dashgapcolor| |
| 6028 |
% to/from |\adl@dashgapcolor@save| referring their original version |
| 6029 |
% |\adl@CT@start| and |\adl@CT@end|. We also modify our own |\endarray| and |
| 6030 |
% its shorthand active version |\endArray| so that |\CT@end| is invoked at |
| 6031 |
% the end of environment together with |\@arrayright| if it is defined. |
| 6032 |
% Note that we may not modify |\endtabular| because it refers |\endarray|. |
| 6033 |
% Also note that |\CT@start| is invoked from |\@tabarray| which we keep |
| 6034 |
% unchanged. |
| 6035 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 6036 |
% |
| 6037 |
% \begin{macrocode} |
| 6038 |
\let\adl@CT@start\CT@start |
| 6039 |
\def\CT@start{\adl@CT@start \let\adl@dashgapcolor@save\adl@dashgapcolor} |
| 6040 |
\let\adl@CT@end\CT@end |
| 6041 |
\def\CT@end{\adl@CT@end \global\let\adl@dashgapcolor\adl@dashgapcolor@save} |
| 6042 |
\def\endarray{\adl@endarray \egroup \adl@arrayrestore \CT@end \egroup |
| 6043 |
\csname @arrayright\endcsname} |
| 6044 |
\ifx\adl@notdefinable\undefined \let\endArray\endarray \fi |
| 6045 |
|
| 6046 |
% \end{macrocode} |
| 6047 |
% |
| 6048 |
% \subsubsection{Horizontal Line Coloring} |
| 6049 |
% \label{sec:impl-colortbl-hline} |
| 6050 |
% |
| 6051 |
% \begin{macro}{\hline} |
| 6052 |
% \begin{macro}{\adl@inactivehdl} |
| 6053 |
% \begin{macro}{\adl@ixhline} |
| 6054 |
% \SpecialIndex{\CT@arc@} |
| 6055 |
% \SpecialIndex{\CT@drsc@} |
| 6056 |
% \SpecialIndex{\cline} |
| 6057 |
% To color |\hline| and inactivated |\hdashline|, we modify our own |\hline| |
| 6058 |
% and |\adl@inactivehdl| inserting the line coloring macro |\CT@arc@| before |
| 6059 |
% drawing by |\hrule| and pushing the coloring\slash drawing into a group. |
| 6060 |
% We also modify |\adl@ixhline| to draw a colored horizontal rule of |
| 6061 |
% |\doublerulesep| wide with the color defined in |\CT@drsc@| if it is not |
| 6062 |
% |\relax|, rather than to insert a vertical skip. Note that the |\cline| |
| 6063 |
% coloring is done by \textsf{colortbl}'s |\cline| renamed as |
| 6064 |
% |\adl@org@cline| and invoked from our own one. |
| 6065 |
% \end{macro}\end{macro}\end{macro} |
| 6066 |
% |
| 6067 |
% \begin{macrocode} |
| 6068 |
\def\hline{\noalign{\ifnum0=`}\fi |
| 6069 |
\ifadl@zwhrule \vskip-\arrayrulewidth |
| 6070 |
\else \adl@hline\adl@connect\arrayrulewidth \fi |
| 6071 |
{\CT@arc@ \hrule\@height\arrayrulewidth}% |
| 6072 |
\global\adl@finaldepth\z@ |
| 6073 |
\futurelet\@tempa\adl@xhline} |
| 6074 |
\def\adl@inactivehdl[#1/#2]{\ifadl@zwhrule \vskip-\arrayrulewidth \fi |
| 6075 |
{\CT@arc@ \hrule\@height\arrayrulewidth}% |
| 6076 |
\futurelet\@tempa\adl@xhline} |
| 6077 |
\def\adl@ixhline{{\ifx\CT@drsc@\relax \vskip \else |
| 6078 |
\CT@drsc@\hrule\@height \fi \doublerulesep}% |
| 6079 |
\adl@hline\relax\doublerulesep} |
| 6080 |
% \end{macrocode} |
| 6081 |
% |
| 6082 |
% \begin{macro}{\adl@ihdashline} |
| 6083 |
% \begin{macro}{\adl@act@ihdashline} |
| 6084 |
% \begin{macro}{\adl@cdline} |
| 6085 |
% \begin{macro}{\adl@act@cdline} |
| 6086 |
% To draw a horizontal dash line with colored dashes and also colored gaps, |
| 6087 |
% we drastically modified |\adl@ihdashline| for |\hdashline| and |
| 6088 |
% |\adl@cdline| for |\cdashline|. First, they invoke |\adl@hclinesetup| |
| 6089 |
% that makes the prefix of a |\multispan|-ned row from the first to last |
| 6090 |
% columns for |\hdashline| or given columns for |\cdashline|. Then the line |
| 6091 |
% is drawn by the modified version of |\adl@hcline|. We have to declare |
| 6092 |
% these macros are active ones again. |
| 6093 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 6094 |
% |
| 6095 |
% \begin{macrocode} |
| 6096 |
\def\adl@ihdashline[#1/#2]{\adl@hclinesetup\@ne\adl@columns |
| 6097 |
\adl@hcline\z@[#1/#2]% |
| 6098 |
\noalign{\ifnum0=`}\fi |
| 6099 |
\futurelet\@tempa\adl@xhline} |
| 6100 |
\let\adl@act@ihdashline\adl@ihdashline |
| 6101 |
\def\adl@cdline[#1-#2]{\ifadl@zwhrule \vskip-\arrayrulewidth \fi |
| 6102 |
\adl@hclinesetup{#1}{#2}% |
| 6103 |
\adl@hcline{-\arrayrulewidth}} |
| 6104 |
\let\adl@act@cdline\adl@cdline |
| 6105 |
% \end{macrocode} |
| 6106 |
% |
| 6107 |
% \begin{macro}{\adl@hclinesetup} |
| 6108 |
% \begin{macro}{\adl@cdlinea} |
| 6109 |
% \begin{macro}{\adl@cdlineb} |
| 6110 |
% The macro |\adl@hclinesetup|\meta{f}\meta{t} makes the prefix of a |
| 6111 |
% |\multispan|-ned row from the column $f$ to $t$ and |\global|-ly defines |
| 6112 |
% it as |\@gtempa|. This is done by a code very similar to original |
| 6113 |
% |\adl@cdline| (and thus \LaTeX-2.09's |\cline|) but the invocation of |
| 6114 |
% |\adl@hcline| is removed from |\adl@cdliena| and |\adl@cdlineb|, one of |
| 6115 |
% which is |\@gtempa|. |
| 6116 |
% \end{macro}\end{macro}\end{macro} |
| 6117 |
% |
| 6118 |
% \begin{macrocode} |
| 6119 |
\def\adl@hclinesetup#1#2{\global\adl@cla#1\relax |
| 6120 |
\global\advance\adl@cla\m@ne |
| 6121 |
\ifnum\adl@cla>\z@ \global\let\@gtempa\adl@cdlinea |
| 6122 |
\else \global\let\@gtempa\adl@cdlineb\fi |
| 6123 |
\global\adl@clb#2\relax |
| 6124 |
\global\advance\adl@clb-\adl@cla \ifnum0=`{\fi}} |
| 6125 |
\def\adl@cdlinea{\multispan\adl@cla &\multispan\adl@clb \unskip} |
| 6126 |
\def\adl@cdlineb{\multispan\adl@clb \unskip} |
| 6127 |
% \end{macrocode} |
| 6128 |
% |
| 6129 |
% \begin{macro}{\adl@hcline} |
| 6130 |
% \begin{macro}{\adl@paintdashgap} |
| 6131 |
% \SpecialIndex{\adl@draw} |
| 6132 |
% The modified version of |\adl@hcline|\meta{w}|[|\meta{d}|/|\meta{g}|]| |
| 6133 |
% draws a colored horizontal dash line of dash size $d$ and gap size $g$ and |
| 6134 |
% insert vertical skip of $w$. First it |\span|-s columns by |\@gtempa| and |
| 6135 |
% checks if the body of |\adl@dashgapcolor| is something other than |
| 6136 |
% |\relax|. If so, i.e.\ it has |\color|, |
| 6137 |
% |\adl@paintdashgap| is invoked to |
| 6138 |
% draw a horizontal rule of |\color| by |\leaders| as the background |
| 6139 |
% of the dash line, to insert |\nobreak| (for \textsf{longtable}) and a |
| 6140 |
% negative space for canceling the width of the |
| 6141 |
% rule, and to |\span| the columns again. Then |\adl@hcline| draws the |
| 6142 |
% colored dash line, over the background if the gaps are colored, by |
| 6143 |
% inserting |\CT@arc@| before the invocation of |\adl@draw|. |
| 6144 |
% \end{macro}\end{macro} |
| 6145 |
% |
| 6146 |
% \begin{macrocode} |
| 6147 |
\def\adl@hcline#1[#2/#3]{\@gtempa |
| 6148 |
\ifx\adl@dashgapcolor\adl@nocolor \else \adl@paintdashgap \fi |
| 6149 |
{\@tempdima#2\relax \@tempdimb#3\relax |
| 6150 |
\CT@arc@ \adl@draw\adl@vrule\hskip\hbox}\cr |
| 6151 |
\noalign{\global\adl@finaldepth\z@ \ifdim#1=\z@\else |
| 6152 |
\ifadl@zwhrule\else \vskip#1\fi\fi}} |
| 6153 |
\def\adl@paintdashgap{{\adl@dashgapcolor |
| 6154 |
\leaders\hrule\@height\arrayrulewidth\hfill}\cr |
| 6155 |
\noalign{\penalty\@M \vskip-\arrayrulewidth}\@gtempa} |
| 6156 |
|
| 6157 |
% \end{macrocode} |
| 6158 |
% |
| 6159 |
% \subsubsection{Vertical Line Coloring} |
| 6160 |
% \label{sec:impl-colortbl-vline} |
| 6161 |
% |
| 6162 |
% \begin{macro}{\arrayrulecolor} |
| 6163 |
% \begin{macro}{\CT@arc@} |
| 6164 |
% \begin{macro}{\doublerulesepcolor} |
| 6165 |
% \begin{macro}{\CT@drsc@} |
| 6166 |
% \begin{macro}{\dashgapcolor} |
| 6167 |
% \begin{macro}{\adl@dashgapcolor} |
| 6168 |
% \begin{macro}{\adl@defcolor} |
| 6169 |
% \begin{macro}{\adl@idefcolor} |
| 6170 |
% \begin{macro}{\adl@noalign} |
| 6171 |
% \begin{macro}{\nodashgapcolor} |
| 6172 |
% \SpecialIndex{\@array} |
| 6173 |
% A bug of \textsf{colortbl}'s |\arrayrulecolor| and |\doublerulesepcolor| |
| 6174 |
% is that they are defined like; |
| 6175 |
% |
| 6176 |
% \begin{quote} |
| 6177 |
% |\ifdim\baselineskip=\z@ \noalign \fi{\gdef\CT@arc@{\color...}}| |
| 6178 |
% \end{quote} |
| 6179 |
% |
| 6180 |
% This aims to do |\noalign{\gdef...}| in \textsf{array}\slash |
| 6181 |
% \textsf{tabular} and do |{\gdef...}| outside but has two problems: First, |
| 6182 |
% if they are in |>{...}| construct, they are expanded with |\noalign| |
| 6183 |
% inappropriately when the argument of |>| is expanded. Second, they may |
| 6184 |
% appear at a place where |\baselineskip| is 0 but is outside of |
| 6185 |
% \textsf{array}\slash\textsf{tabular} and will cause the misplaced |
| 6186 |
% |\noalign| error. To solve the second problem, we introduced |
| 6187 |
% |\adl@noalign| which is set to |\noalign| in the environment by our own |
| 6188 |
% |\@array|, and |\relax| outside. We also introduced |
| 6189 |
% |\adl@defcolor|\meta{cs}\meta{opt} for the common job to define \meta{cs} |
| 6190 |
% as |\color| with \meta{opt}, in |\noalign| if necessary, by |
| 6191 |
% |\adl@idefcolor|. Thus |\arrayrulecolor| and |\doublerulesepcolor| are |
| 6192 |
% modified to define |\CT@arc@| and |\CT@drsc@| using |\adl@defcolor|, and |
| 6193 |
% our own |\dashgapcolor| is defined |
| 6194 |
% similarly to define |\adl@dashgapcolor|. Another macro |\nodashgapcolor| |
| 6195 |
% to nullify |\dashgapcolor| is also defined with |\adl@noalign| to reset |
| 6196 |
% |\adl@dashgapcolor| to |\relax|. |
| 6197 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 6198 |
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} |
| 6199 |
% |
| 6200 |
% \begin{macrocode} |
| 6201 |
\def\arrayrulecolor{\adl@defcolor\CT@arc@} |
| 6202 |
\def\doublerulesepcolor{\adl@defcolor\CT@drsc@} |
| 6203 |
\def\dashgapcolor{\adl@defcolor\adl@dashgapcolor} |
| 6204 |
\def\adl@defcolor#1#2#{\adl@idefcolor{#1}{#2}} |
| 6205 |
\def\adl@idefcolor#1#2#3{\adl@noalign{\gdef#1{\color#2{#3}}}} |
| 6206 |
\let\adl@noalign\relax |
| 6207 |
\def\nodashgapcolor{\adl@noalign{\gdef\adl@dashgapcolor{\relax}}} |
| 6208 |
|
| 6209 |
% \end{macrocode} |
| 6210 |
% |
| 6211 |
% \begin{macro}{\@classz} |
| 6212 |
% \begin{macro}{\adl@act@classz} |
| 6213 |
% \begin{macro}{\adl@org@classz} |
| 6214 |
% The tougher bug of \textsf{colortbl} is the expansion timing of |
| 6215 |
% |\arrayrulecolor| and |\dobule#rule#sep#color| in a |>|-argument. We |
| 6216 |
% have to modify |\@classz| to extract them from |
| 6217 |
% |\toks|\break|\@tempcnta| as its |
| 6218 |
% original version does for |\columncolor|. Thus we inserted the invocation |
| 6219 |
% of |\adl@extract@arc| for |\arrayrulecolor|, |\adl@extract@drsc| for |
| 6220 |
% |\doublerulesep#color|, and |\adl@extract@dgc| for |\dashgapcolor| just |
| 6221 |
% after the invocation of |\CT@extract|. Note that the other part of |
| 6222 |
% |\@classz| is not modified logically, but done for author's preference of |
| 6223 |
% indentation. Also note that both |\adl@act@classz| and |\adl@org@classz| |
| 6224 |
% are |\let|-equal to the modified |\@classz| because we have to be bug free |
| 6225 |
% even if |\ADLinactive| is in effect. |
| 6226 |
% \end{macro}\end{macro}\end{macro} |
| 6227 |
% |
| 6228 |
% \begin{macrocode} |
| 6229 |
\def\@classz{\@classx |
| 6230 |
\@tempcnta\count@ \prepnext@tok |
| 6231 |
\expandafter\CT@extract\the\toks\@tempcnta\columncolor!\@nil |
| 6232 |
\expandafter\adl@extract@arc\the\toks\@tempcnta\arrayrulecolor!\@nil |
| 6233 |
\expandafter\adl@extract@drsc |
| 6234 |
\the\toks\@tempcnta\doublerulesepcolor!\@nil |
| 6235 |
\expandafter\adl@extract@dgc\the\toks\@tempcnta\dashgapcolor!\@nil |
| 6236 |
\@addtopreamble{% |
| 6237 |
\setbox\z@\hbox\bgroup\bgroup |
| 6238 |
\ifcase \@chnum |
| 6239 |
\hskip\stretch{.5}\kern\z@ |
| 6240 |
\d@llarbegin |
| 6241 |
\insert@column |
| 6242 |
\d@llarend\hskip\stretch{.5}% |
| 6243 |
\or \d@llarbegin \insert@column \d@llarend \hfill |
| 6244 |
\or \hfill \kern\z@ \d@llarbegin \insert@column \d@llarend |
| 6245 |
\or $\vcenter |
| 6246 |
\@startpbox{\@nextchar}\insert@column \@endpbox $% |
| 6247 |
\or \vtop \@startpbox{\@nextchar}\insert@column \@endpbox |
| 6248 |
\or \vbox \@startpbox{\@nextchar}\insert@column \@endpbox |
| 6249 |
\fi |
| 6250 |
\egroup\egroup |
| 6251 |
\begingroup |
| 6252 |
\CT@setup |
| 6253 |
\CT@column@color |
| 6254 |
\CT@row@color |
| 6255 |
\CT@cell@color |
| 6256 |
\CT@do@color |
| 6257 |
\endgroup |
| 6258 |
\@tempdima\ht\z@ |
| 6259 |
\advance\@tempdima\minrowclearance |
| 6260 |
\vrule\@height\@tempdima\@width\z@ |
| 6261 |
\unhbox\z@}% |
| 6262 |
\prepnext@tok} |
| 6263 |
\let\adl@act@classz\@classz |
| 6264 |
\let\adl@org@classz\@classz |
| 6265 |
|
| 6266 |
% \end{macrocode} |
| 6267 |
% |
| 6268 |
% \begin{macro}{\adl@def@extract} |
| 6269 |
% \begin{macro}{\adl@extract@arc} |
| 6270 |
% \begin{macro}{\adl@extract@arc@b} |
| 6271 |
% \begin{macro}{\CT@arc@} |
| 6272 |
% \begin{macro}{\adl@extract@drsc} |
| 6273 |
% \begin{macro}{\adl@extract@drsc@b} |
| 6274 |
% \begin{macro}{\CT@drsc@} |
| 6275 |
% \begin{macro}{\adl@extract@dgc} |
| 6276 |
% \begin{macro}{\adl@extract@dgc@b} |
| 6277 |
% \begin{macro}{\adl@dashgapcolor} |
| 6278 |
% The definitions of |\adl@extract@|$x$ ($x\in\{\texttt{arc}, \texttt{drsc}, |
| 6279 |
% \texttt{dgc}\}$) are quite similar to each other. For example |
| 6280 |
% |\adl@extract@arc| is defined as follows. |
| 6281 |
% |
| 6282 |
%\begin{verbatim} |
| 6283 |
%\def\adl@extract@arc#1\arrayrulecolor#2#3\@nil{% |
| 6284 |
% \if!#2\toks\@tempcnta{#1}\let\@tempa\relax% |
| 6285 |
% \else\if[#2%] |
| 6286 |
% \def\@tempa{\adl@extract@arc@b{#1}#3\@nil}% |
| 6287 |
% \else \def\CT@arc@{\color{#2}}% |
| 6288 |
% \def\@tempa{\adl@extract@arc#1#3\@nil}% |
| 6289 |
% \fi\fi \@tempa} |
| 6290 |
%\def\adl@extract@arc@b#1#2]#3{% |
| 6291 |
% \def\CT@arc@{\color[#2]{#3}}% |
| 6292 |
% \adl@extract@arc#1} |
| 6293 |
%\end{verbatim} |
| 6294 |
% |
| 6295 |
% This code extracts {\em all the} occurrences of |
| 6296 |
% |\arrayrulecolor[|\meta{m}|]|\Meta{c} from the token register and |
| 6297 |
% |\def|-ines |\CT@arc@| as |\color[|\meta{m}|]|\Meta{c}. Note that |
| 6298 |
% |\CT@extract| does a similar job for |\columncolor| but it mistakingly |
| 6299 |
% ignores the possibility that the token register has two or more |
| 6300 |
% |\columncolor|\footnote{ |
| 6301 |
% |
| 6302 |
% Fixing this bug is not our business.}. |
| 6303 |
% |
| 6304 |
% Anyway, if we copy the code above and replace |
| 6305 |
% `|@arc|' with `|@drsc|', |\arrayrulecolor| with |\doublerulesepcolor|, and |
| 6306 |
% |\CT@arc@| with \hbox{|\CT@drsc@|}, we will have |\adl@extract@drsc|(|@b|) |
| 6307 |
% for |
| 6308 |
% |\doublerulesepcolor|. The code for |\adl@extract@dgc|(|@b|) will be also |
| 6309 |
% obtained similarly. However, having three relatives for a almost common |
| 6310 |
% job is too awful. Thus we introduce; |
| 6311 |
% |
| 6312 |
% \begin{quote} |
| 6313 |
% |\adl@def@extract|\meta{key}\meta{umac}\meta{cmac} |
| 6314 |
% \end{quote} |
| 6315 |
% |
| 6316 |
% to define the macros |\adl@extract@|\textit{key} and |
| 6317 |
% |\adl@extract@|\textit{key}|@b| for the user interface macro \meta{umac} |
| 6318 |
% in which a color macro \meta{cmac} is defined with |\color|. For example, |
| 6319 |
% we will obtain |\adl@extract@arc|(|@b|) shown above by; |
| 6320 |
% |
| 6321 |
% \begin{quote} |
| 6322 |
% |\adl@def@extract{arc}\arrayrulecolor\CT@arc@| |
| 6323 |
% \end{quote} |
| 6324 |
% |
| 6325 |
% Note that |\color| is made |\relax| in the preamble construction phase |
| 6326 |
% by \textsf{colortbl}'s \break |\@mkpream| and regain its proper meaning |
| 6327 |
% after the phase. |
| 6328 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 6329 |
% \end{macro}\end{macro}\end{macro} |
| 6330 |
% \end{macro}\end{macro}\end{macro} |
| 6331 |
% |
| 6332 |
% \begin{macrocode} |
| 6333 |
\def\adl@def@extract#1#2#3{% |
| 6334 |
\expandafter\def\csname adl@extract@#1\endcsname##1#2##2##3\@nil{% |
| 6335 |
\if!##2\toks\@tempcnta{##1}\let\@tempa\relax |
| 6336 |
\else\if[##2%] |
| 6337 |
\def\@tempa{\@nameuse{adl@extract@#1@b}{##1}##3\@nil}% |
| 6338 |
\else \def#3{\color{##2}}% |
| 6339 |
\def\@tempa{\@nameuse{adl@extract@#1}##1##3\@nil}% |
| 6340 |
\fi\fi \@tempa} |
| 6341 |
\expandafter\def\csname adl@extract@#1@b\endcsname##1##2]##3{% |
| 6342 |
\def#3{\color[##2]{##3}}% |
| 6343 |
\@nameuse{adl@extract@#1}##1}} |
| 6344 |
\adl@def@extract{arc}\arrayrulecolor\CT@arc@ |
| 6345 |
\adl@def@extract{drsc}\doublerulesepcolor\CT@drsc@ |
| 6346 |
\adl@def@extract{dgc}\dashgapcolor\adl@dashgapcolor |
| 6347 |
|
| 6348 |
% \end{macrocode} |
| 6349 |
% |
| 6350 |
% |
| 6351 |
% |
| 6352 |
% \subsubsection{Compatibility with \textsf{longtable}} |
| 6353 |
% \label{sec:impl-colortbl-longtable} |
| 6354 |
% |
| 6355 |
% \begin{macro}{\LT@hline} |
| 6356 |
% \begin{macro}{\adl@LTihdashline} |
| 6357 |
% \begin{macro}{\adl@LTinactivehdl} |
| 6358 |
% \begin{macro}{\adl@LTixhline} |
| 6359 |
% Yet another compatiblity issue is to cope with both \textsf{longtable} and |
| 6360 |
% \textsf{colortbl}. We redefine |\LT@hline| and |\LT@inactivehdl| in order |
| 6361 |
% to put |\CT@arc@| before line drawing and to push them in a group. |
| 6362 |
% Modified |\adl@LTidashline| first |
| 6363 |
% invokes |\adl@hclinesetup| and open |\noalign| because it is closed by |
| 6364 |
% |\adl@hclinesetup|. The contents of |\adl@LThdlrow| for |
| 6365 |
% |\adl@LTidashline| is simply |\adl@hcline| because it does |\multispan| |
| 6366 |
% now. The macro |\adl@LTixhline| is modified to paint the |\doublerulesep| |
| 6367 |
% gap by |\leaders\hrule| with color of |\CT@drsc@| if it is not |\relax|. |
| 6368 |
% \end{macro}\end{macro}\end{macro}\end{macro} |
| 6369 |
% |
| 6370 |
% |
| 6371 |
% \begin{macrocode} |
| 6372 |
\ifx\longtable\undefined\else |
| 6373 |
\def\LT@hline{\noalign{\ifnum0=`}\fi |
| 6374 |
\gdef\adl@LThdlrow{\multispan{\LT@cols}\unskip{\CT@arc@ |
| 6375 |
\leaders\hrule\@height\arrayrulewidth\hfill}\cr}% |
| 6376 |
\adl@LThdline} |
| 6377 |
\def\adl@LTihdashline[#1/#2]{\adl@hclinesetup\@ne\adl@columns |
| 6378 |
\noalign{\ifnum0=`}\fi |
| 6379 |
\gdef\adl@LThdlrow{\adl@hcline\z@[#1/#2]}% |
| 6380 |
\adl@LThdline} |
| 6381 |
\def\adl@LTinactivehdl[#1/#2]{% |
| 6382 |
\gdef\adl@LThdlrow{\multispan{\LT@cols}\unskip{\CT@arc@ |
| 6383 |
\leaders\hrule\@height\arrayrulewidth\hfill}\cr}% |
| 6384 |
\adl@LThdline} |
| 6385 |
\def\adl@LTixhline{% |
| 6386 |
\ifx\CT@drsc@\relax \gdef\adl@LThdlrow{\noalign{ |
| 6387 |
\penalty-\@medpenalty \vskip\doublerulesep}} |
| 6388 |
\else \gdef\adl@LThdlrow{\noalign{\penalty\@M}% |
| 6389 |
\multispan{\LT@cols}\unskip{\CT@drsc@ |
| 6390 |
\leaders\hrule\@height\doublerulesep\hfill}\cr}\fi |
| 6391 |
\ifnum0=`{\fi}\adl@LThdlrow \noalign{\ifnum0=`}\fi |
| 6392 |
\adl@hline\relax\doublerulesep \global\let\adl@LThdlrow\@empty} |
| 6393 |
\fi |
| 6394 |
\fi |
| 6395 |
% \end{macrocode} |
| 6396 |
% |
| 6397 |
% \iffalse |
| 6398 |
%</package> |
| 6399 |
% \fi |
| 6400 |
% |
| 6401 |
% |
| 6402 |
% |
| 6403 |
% \IndexPrologue{\newpage\section*{Index} |
| 6404 |
% Italicized number refers to the page where the specification and usage of |
| 6405 |
% corresponding entry are described, while underlined is for the |
| 6406 |
% implementation of the entry. |
| 6407 |
% |
| 6408 |
% To find a control sequence, remove prefixes \cs{@}, \cs{adl@} and |
| 6409 |
% \cs{ifadl@} from its name if it has one of them.} |
| 6410 |
% \Finale |
| 6411 |
% \newpage |
| 6412 |
% \def\EQ{=} \def\GT{>} \def\BAR{|} \def\NEQ{\neq} |
| 6413 |
% \PrintChanges |
| 6414 |
\endinput |