% \iffalse %% Style file `arydshln' %% Copyright (C) 1993,1998-2004 %% Hiroshi Nakashima %% (Kyoto Univ. / Toyohashi Univ. of Tech.) %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN %% archives in directory macros/latex/base/lppl.txt; either %% version 1 of the License, or any later version. % \fi % % \CheckSum{3605} %% \CharacterTable %% {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 %% 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 %% Digits \0\1\2\3\4\5\6\7\8\9 %% Exclamation \! Double quote \" Hash (number) \# %% Dollar \$ Percent \% Ampersand \& %% Acute accent \' Left paren \( Right paren \) %% Asterisk \* Plus \+ Comma \, %% Minus \- Point \. Solidus \/ %% Colon \: Semicolon \; Less than \< %% Equals \= Greater than \> Question mark \? %% Commercial at \@ Left bracket \[ Backslash \\ %% Right bracket \] Circumflex \^ Underscore \_ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} %% % \iffalse %% %<*dtx> \ProvidesFile{arydshln.dtx} % %\def\next{LaTeX2e} %\ifx\fmtname\next\def\next{ %\NeedsTeXFormat{LaTeX2e}[1994/12/01] %\ProvidesPackage{arydshln}} %\else\def\next[#1]{}\fi\next %\ProvidesFile{arydshln-man.tex} % \fi % \ProvidesFile{arydshln.dtx} [2004/08/31 v1.71 ] % % \iffalse %<*driver> \documentclass{ltxdoc} \usepackage{arydshln} \DisableCrossrefs \PageIndex \CodelineNumbered \RecordChanges % %\OnlyDescription %\def\ONLYDESCRIPTION{} %<*driver> \advance\textwidth4em \begin{document} \DocInput{arydshln.dtx} \end{document} % % \fi % \MakeShortVerb{\|} % \GetFileInfo{arydshln.dtx} % \IndexPrologue{\section*{Index}} % \setcounter{IndexColumns}{2} % \def\th{^{\it th}} % \def\LOR{{\ {\lor}\ }} % \def\LAND{{\ {\land}\ }} % \let\togets\leftrightarrow % \let\epsilon\varepsilon % \def\cs#1{\hbox{\tt\char\escapechar#1}} % % \makeatletter % \def\Meta#1{\penalty\@highpenalty \hbox{{\tt\char`\{}\meta{#1}{\tt\char`\}}}} % % \def\eqnarray{\stepcounter{equation}\let\@currentlabel=\theequation % \global\@eqnswtrue % \global\@eqcnt\z@\tabskip\@centering\let\\=\@eqncr % $$\halign to \displaywidth\bgroup\hskip\@centering % $\displaystyle\tabskip\z@{##}$\@eqnsel&\global\@eqcnt\@ne % \hfil$\;{##}\;$\hfil % &\global\@eqcnt\tw@ $\displaystyle\tabskip\z@{##}$\hfil % \tabskip\@centering&\llap{##}\tabskip\z@\cr} % % \let\latex@addmarginpar\@addmarginpar % \let\latex@latex@warning@no@line\@latex@warning@no@line % \def\@addmarginpar{\let\@latex@warning@no@line\@gobble % \latex@addmarginpar % \let\@latex@warning@no@line\latex@latex@warning@no@line} % \let\@font@warning\@gobble % % \long\def\m@cro@#1#2{\endgroup \topsep\MacroTopsep \trivlist % \edef\saved@macroname{\string#2} % \def\makelabel##1{\llap{##1\hskip\@totalleftmargin}} % \if@inlabel % \let\@tempa\@empty \count@\macro@cnt % \loop \ifnum\count@>\z@ % \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m@ne \repeat % \edef\makelabel##1{\llap{\vtop to\baselineskip % {\@tempa\hbox{##1}\vss} % \hskip\@totalleftmargin}} % \advance \macro@cnt \@ne % \else \macro@cnt\@ne \fi % \edef\@tempa{\noexpand\item[ % #1 % \noexpand\PrintMacroName % \else % \noexpand\PrintEnvName % \fi % {\string#2}]} % \@tempa % \global\advance\c@CodelineNo\@ne % #1 % \SpecialMainIndex{#2}\nobreak % \DoNotIndex{#2} % \else % \SpecialMainEnvIndex{#2}\nobreak % \fi % \global\advance\c@CodelineNo\m@ne % \ignorespaces} % % \def\DescribeOpt{\leavevmode\@bsphack\begingroup\MakePrivateLetters % \Describe@Opt} % \def\Describe@Opt#1{\endgroup \Describe@pt{#1}} % \def\Describe@pt#1#2{ % \marginpar{\raggedleft\PrintDescribeMacro{#1}} % \SpecialOptUsageIndex{#1}{#2}} % \def\SpecialOptUsageIndex#1#2{ % \index{#1\actualchar{\protect\ttfamily#1} (#2)\encapchar usage} % \index{#2s:\levelchar{\protect\ttfamily#1}\encapchar usage} % \@esphack\ignorespaces} % \def\SpecialOptMainIndex#1#2{ % \index{#1\actualchar{\protect\ttfamily#1} (#2)\encapchar main} % \index{#2s:\levelchar{\protect\ttfamily#1}\encapchar main} % \@esphack\ignorespaces} % \def\SpecialOptIndex#1#2{ % \index{#1\actualchar{\protect\ttfamily#1} (#2)} % \index{#2s:\levelchar{\protect\ttfamily#1}} % \@esphack\ignorespaces} % \def\SpecialOptIndexS#1#2{ % \index{#1\actualchar{\protect\ttfamily#1} (#2)} % \index{#2es:\levelchar{\protect\ttfamily#1}} % \@esphack\ignorespaces} % % \def\SpecialMainIndex#1{\@bsphack % \RemoveAtFromCS{#1} % \protected@edef\@tempa{\noexpand\special@index{\RAFCtempa % \actualchar \string\verb % \quotechar*\verbatimchar\string#1\verbatimchar % \encapchar main}}\@tempa % \@esphack} % % \def\SpecialIndex#1{\@bsphack % \RemoveAtFromCS{#1} % \protected@edef\@tempa{\noexpand\special@index{\RAFCtempa % \actualchar \string\verb % \quotechar*\verbatimchar\string#1\verbatimchar}}\@tempa % \@esphack} % % \def\Macro{\begingroup \@sanitize \iMacro} % \def\iMacro#1{\endgroup % \def\SpecialMainIndex##1{\SWiIndex{##1}{\encapchar main}} % \macro{#1}} % \let\endMacro\endmacro % % \def\SpecialWeirdIndex{\@bsphack \begingroup \@sanitize \SWIndex{}} % \def\SWIndex#1#2{\endgroup \SWiIndex{#2}{#1}} % \def\SWiIndex#1#2{% % \protected@edef\@tempa{\noexpand\special@index{ % #1\actualchar \string\verb % \quotechar*\verbatimchar#1\verbatimchar#2}}\@tempa % \@esphack} % % \let\RAFCempty\@empty % \let\RAFCgobble\@gobble % \makeatother % \def\RemoveAtFromCS#1{\edef\RAFCtempa{\expandafter\RAFCgobble\string#1} % \edef\RAFCtempa{\expandafter\string\csname\RAFCtempa\endcsname} % \expandafter\iRemoveAtFromCS\RAFCtempa@\NIL} % \def\iRemoveAtFromCS#1#2@#3\NIL{\def\RAFCtempb{#3} % \ifx\RAFCtempb\RAFCempty \def\RAFCtempa{#2}\let\next\relax % \else \def\RAFCtempa{#2@}\def\next{\iiRemoveAtFromCS#3\NIL} % \def\RAFCtempb{#2} % \ifx\RAFCtempb\RAFCempty % \else\ifx\RAFCtempb\CommonCSPrefix % \else\ifx\RAFCtempb\CommonIfPrefix % \else \def\RAFCtempa{}\def\next{\xRemoveAtFromCS#2@#3\NIL}\fi\fi\fi\fi % \next} % \def\iiRemoveAtFromCS#1{\ifx#1@\edef\RAFCtempa{\RAFCtempa@} % \let\next\iiRemoveAtFromCS % \else \def\next{\xRemoveAtFromCS#1}\fi % \next} % \def\xRemoveAtFromCS#1@\NIL{\edef\RAFCtempa{#1\RAFCtempa}} % \makeatletter % % \begingroup % \gdef\@sverbcat{\catcode`\@\active\catcode`\#\active} % \catcode`\@\active \gdef@{\char`\@\penalty\exhyphenpenalty} % \catcode`\#\active \gdef#{\penalty\exhyphenpenalty} % \endgroup % \let\latex@sverb\@sverb % \def\@sverb{\@sverbcat\latex@sverb} % % \newcount\ChangesCounter \ChangesCounter10000 % \def\changes@#1#2#3{\global\advance\ChangesCounter\@ne % \protected@edef\@tempa{\noexpand\glossary{#1\levelchar % x\number\ChangesCounter % \ifx\saved@macroname\@empty % \actualchar\generalname % \else % \expandafter\@gobble\saved@macroname % \actualchar \string\verb % \quotechar*\verbatimchar \saved@macroname % \verbatimchar % \fi % :\levelchar #3}}\@tempa\endgroup\@esphack} % \def\theglossary{\onecolumn \glossary@prologue % \GlossaryParms \let\item\@idxitem \ignorespaces} % \def\endtheglossary{\relax} % % \makeatother % \errorcontextlines1000 % % % % \changes{v1.0}{1993/04/01} % {The style was born on a good day \ldots} % \changes{v1.05}{1993/06/18} % {Cope with \texttt{\char`\\\char`\\} with negative optional % vertical space.} % \changes{v1.1}{1993/06/24} % {Save and restore the \texttt{\char`\\catcode} for % `\texttt{@}'.} % \changes{v1.2-1}{1998/07/16} % {Add this document.} % \changes{v1.2-2}{1998/07/16} % {Cope with \protect\LaTeXe.} % \changes{v1.2-3}{1998/07/16} % {Allow mixture of vertical solid- and dash-lines.} % \changes{v1.2-4}{1998/07/16} % {Add the feature of explicit dash/gap specification.} % \changes{v1.2-5}{1998/07/16} % {Fix some bugs and change codes.} % \changes{v1.4-1}{1999/06/25} % {Make compatible with array package and add new features.} % % \changes{v1.4-2}{1999/06/25} % {The following are changes of this document.} % % \changes{v1.4-3-1}{1999/06/25} % {The following are for the general compatibility with \textsf{array}.} % \changes{v1.4-3-2}{1999/06/25} % {The following are to control the effective width of vertical lines.} % \changes{v1.4-3-3}{1999/06/25} % {The following are for inactivation of dash-line functions.} % \changes{v1.4-3-4}{1999/06/25} % {The following are for drawing mode to cope with the bug of % \cs{xlearders}.} % \changes{v1.4-3-5}{1999/06/25} % {The following are to implement dashed version of \cs{firsthline} % and \cs{lasthline} of \textsf{array}.} % \changes{v1.4-3-6}{1999/06/25} % {The following are to fix the bug by which the depth of % \texttt{array}\slash\texttt{tabular} was always zero.} % \changes{v1.4-3-7}{1999/06/25} % {The following are to rename macros for \cs{cdashline}.} % \changes{v1.4-3-8}{1999/06/25} % {The following are to cope with very narrow or negative wide columns.} % \changes{v1.4-4}{2000/07/04} % {Released to CTAN.} % % \changes{v1.5-1}{2000/07/12} % {The following are for the compatibility with \textsf{colortab}.} % \changes{v1.5-2}{2002/06/26} % {The following are for bug fix of \cs{adl@putlrc}.} % \changes{v1.5-3}{2003/07/11} % {The following are for bug fix of \cs{adl@inactivate}.} % \changes{v1.54-1}{2003/08/25} % {The following are for bug fix of \cs{adl@@vl}.} % \changes{v1.54-2}{2003/08/25} % {The following are for bug fix of activation.} % \changes{v1.54-3}{2003/08/25} % {The following are miscellaneous modifications.} % % \changes{v1.6-1}{2003/08/25} % {The following are for the compatibility with \textsf{longtable}.} % % \changes{v1.7}{2003/05/21} % {The following are for the compatibility with \textsf{colortbl}.} % \changes{v1.7-1}{2004/5/21} % {The following are for null-wide horizontal lines.} % \changes{v1.7-2}{2004/5/21} % {The following are to fix the bug of \cs{arrayrulecolor} etc. in % \textsf{colortbl}.} % \changes{v1.7-3}{2004/5/21} % {The following are for vertical line coloring.} % % \changes{v1.71-1}{2004/7/31} % {The following are for bug fix for \textsf{array}'s % \texttt{m}-columns.} % % % \def\EXCLAMATION{\texttt{!}} % \def\VERTBAR{\texttt{\char`\|}} % \edef\CommonCSPrefix{\expandafter\RAFCgobble\string\adl} % \edef\CommonIfPrefix{\expandafter\RAFCgobble\string\ifadl} % % \title{The \textsf{arydshln} package\thanks{ % This file has version number \fileversion, last revised \filedate.}} % \author{Hiroshi Nakashima\\(Toyohashi Univ. of Tech.)} % \date{\filedate} % \maketitle % % \begin{abstract} % This file gives \LaTeX's |array| and |tabular| environments the capability % to draw horizontal\slash vertical dash-lines. % \end{abstract} % % \tableofcontents % \newpage % % % % \section{Introduction} % \label{sec:intro} % % In January 1993, Weimin Zhang kindly posted a style \textsf{hvdashln} % written by the author, which draws horizontal\slash vertical dash-lines in % \LaTeX's |array| and |tabular| environments, to the news group % \textsf{comp.text.tex}. The style, unfortunately, has a known problem % that vertical lines are broken when an array contains tall rows. % % In March of the year, Monty Hayes complained of this problem encouraging % the author to make a new version \textsf{arydshln} to solve the problem. % The new style also has new features, such as allowing `|:|' to specify % vertical dash-line in preamble, and |\cdashline| being a counterpart of % |\cline|. % % \changes{v1.4-2}{1999/06/25} % {The history on the compatibility with \textsf{array} package.} % In March 1999, Sebastian Rahtz kindly invited the style, which had been % improved following the bug report from Takahiro Kubota, to be included in % \TeX{} CTAN and also in the online catalogue compiled by Graham Williams. % This invitation gave the style new users including Peter Ehrbar who wished % to use it with \textsf{array} style in Standard \LaTeX{} Tools Bundle and % had trouble because these styles were incompatible with each other. % Therefore, the style became compatible with \textsf{array} and got % additional new features. % % \changes{v1.5-1}{2000/7/12} % {The history on the compatibility with \textsf{colortab} package.} % In February 2000, Zsuzsanna Nagy reported that \textsf{arydshln} is not % compatible with \textsf{colortab} style to let the author work on the % compatibility issue again. % % \changes{v1.6-1}{2003/8/25} % {The history on the compatibility with \textsf{longtable} package.} % In Feburary 2001, Craig Leech reported another compatibility problem with % \textsf{longtable}. Although the author promised that the problem would % be attacked some day, the issue had left long time\footnote{ % % Two years and a half! Sorry Craig.} % % until three other complaints. Then the author attacked the problem hoping % it is the last compatibility issue\footnote{ % % But his hope was dashed as described below.}. % % \changes{v1.7}{2004/5/21} % {The history on the compatibility with \textsf{colortbl} package.} % In May 2004, Klaus Dalinghaus found another incompatibility with % \textsf{colortbl}. Although he was satisfied by a quick hack for cell % painting, the author attacked a harder problem for line % coloring to solve the problem\footnote{ % % Without dreaming it is the last compatibility issue.}. % % % % \section{Usage} % \label{sec:usage} % \subsection{Loading Package} % \label{sec:usage-load} % % \changes{v1.4-2}{1999/06/25} % {Explanation of package loading is added.} % % The package is usable to both \LaTeXe{} and \LaTeX-2.09 users with their % standard package loading declaration. If you use \LaTeXe, simply do the % following. % \begin{quote} % \SpecialUsageIndex{\usepackage} % |\usepackage{arydshln}| % \end{quote} % If you still love \LaTeX-2.09, the following is what you have to do. % \begin{quote} % \SpecialUsageIndex{\documentstyle} % |\documentstyle[..,arydshln,...]|\Meta{style} % \end{quote} % % \changes{v1.5-1}{2000/7/12} % {Caution about loading order of \textsf{colortab} is added.} % \changes{v1.6-1}{2003/8/25} % {Caution about loading order of \textsf{longtable} is added.} % \changes{v1.7}{2004/5/21} % {Caution about loading order of \textsf{colortbl} is added.} % \SpecialOptIndex{array}{package} % \SpecialOptIndex{colortab}{package} % \SpecialOptIndex{longtable}{package} % \SpecialOptIndex{colortbl}{package} % % Only one caution given to users of \textsf{array} (v2.3m or later) and % \textsf{longtable} (v4.10 or later) packages, included in Standard \LaTeX{} % Tools Bundle, and \textsf{colortab} and \textsf{colortbl} package is that % \textsf{arydshln} has to be loaded {\em after} \textsf{array}, % \textsf{longtable}, \textsf{colortab} and/or \textsf{colortbl} done. That % is, the following is correct but reversing the order of |\usepackage| will % cause some mysterious error. % % \begin{quote} % |\usepackage{array} % and/or|\\ % |\usepackage{longtable} % and/or|\\ % |\usepackage{colortab} % or|\\ % |\usepackage{colortbl}|\\ % |\usepackage{arydshln}| % \end{quote} % % % % \subsection{Basic Usage} % \label{sec:usage-basic} % % \DescribeEnv{array}\DescribeEnv{tabular} % \SpecialIndex{\hline} % \SpecialIndex{\cline} % \SpecialIndex{\multicolumn} % You can simply use |array| or |tabular(*)| environments with standard % preamble, such as \verb!{r|c|ll}!, and standard commands |\\|, |\hline|, % |\cline| and |\multicolumn|. % % \leavevmode\marginpar{\raggedleft\PrintDescribeMacro{:}} % \index{:={\protect\ttfamily:}|usage} % Drawing a vertical dash-line is quite simple. Use `|:|' in the preamble % as the separator of columns separated by the dash-line, just like using % `\verb!|!' to draw a vertical solid-line. The {\em preamble} means not % only that of the environment, but also the first argument of % |\multicolumn|. % % \DescribeMacro{\hdashline}\DescribeMacro{\cdashline} % \changes{v1.4-2}{1999/06/25} % {Description of \cs{first}\slash\texttt{lasthdashline} is added.} % It is also simple to draw a horizontal dash-line. Use |\hdashline| and % |\cdashline| as the counterparts of |\hline| and |\cline|. % % For example; % %\begin{quote} %\begin{verbatim} %\begin{tabular}{|l::c:r|}\hline %A&B&C\\\hdashline %AAA&BBB&CCC\\\cdashline{1-2} %\multicolumn{2}{|l:}{AB}&C\\\hdashline\hdashline %\end{tabular} %\end{verbatim} %\end{quote} % % will produce the following result. % %\begin{quote} %\catcode`\|12 %\begin{tabular}{|l::c:r|}\hline %A&B&C\\\hdashline %AAA&BBB&CCC\\\cdashline{1-2} %\multicolumn{2}{|l:}{AB}&C\\\hdashline\hdashline %\end{tabular} %\end{quote} % % \DescribeMacro{\firsthdashline}\DescribeMacro{\lasthdashline} % If you use \textsf{array}, the dashed version of |\firsthline| and % |\lasthline| named |\first#hdash#line| and |\lasthdashline| are available. % % % % \subsection{Style Parameters} % \label{sec:usage-par} % % \DescribeMacro{\dashlinedash}\DescribeMacro{\dashlinegap} % You have two style parameters to control the shape of dash-lines: % |\dashlinedash| is for the length of each dash segment in a dash line; % |\dashlinegap| controls the amount of each gap between dash segments. % Both parameters have a common default value, 4\,pt. % % % % \subsection{Fine Tuning} % \label{sec:usage-fine} % % \leavevmode\marginpar{\raggedleft\PrintDescribeMacro{;}} % \index{;={\protect\ttfamily;}|usage} % Although you can control the shape of dash-lines in an % |array|\slash|tabular| environment as described in \S\ref{sec:usage-par}, % you might want to draw a dash-line of a shape different from others. To % specify the shape of a vertical dash-line explicitly, you may use; % % \begin{quote} % |;{|\meta{dash}|/|\meta{gap}|}| % \end{quote} % % instead of ordinary `|:|' and will have a dash-line with dash segments of % \meta{dash} long separated by spaces of \meta{gap}. % % \DescribeMacro{\hdashline}\DescribeMacro{\cdashline} % As for horizontal dash-lines, explicit shape specifications may be given % through optional arguments of |\hdashline| and |\cdashline| as follows. % % \begin{quote} % |\hdashline[|\meta{dash}|/|\meta{gap}|]|\\ % |\cdashline{|\meta{col1}|-|\meta{col2}|}[|\meta{dash}|/|\meta{gap}|]| % \end{quote} % % % For example; % %\begin{quote} %\begin{verbatim} %\begin{tabular}{|l::c;{2pt/2pt}r|}\hline %A&B&C\\\hdashline[1pt/1pt] %AAA&BBB&CCC\\\cdashline{1-2}[.4pt/1pt] %\multicolumn{2}{|l;{2pt/2pt}}{AB}&C\\\hdashline\hdashline %\end{tabular} %\end{verbatim} %\end{quote} % % will produce the following result. % %\begin{quote} %\catcode`\|12 %\begin{tabular}{|l::c;{2pt/2pt}r|}\hline %A&B&C\\\hdashline[1pt/1pt] %AAA&BBB&CCC\\\cdashline{1-2}[.4pt/1pt] %\multicolumn{2}{|l;{2pt/2pt}}{AB}&C\\\hdashline\hdashline %\end{tabular} %\end{quote} % % \changes{v1.4-2}{1999/06/25} % {Description of the real width of vertical lines is added.} % % \DescribeMacro{\ADLnullwide} % \DescribeMacro{\ADLsomewide} % \SpecialIndex{\arrayrulewidth} % % The vertical solid and dashed lines are drawn as if their width is zero, as % standard \LaTeX's |array| and |tabular| do, if you don't use % \textsf{array} package. Otherwise, they have {\em real} width of % |\arrayrulewidth| as the authors of \textsf{array} prefers. However, you % may explicitly tell \textsf{arydshln} to follow your own preference by % |\ADLnullwide| if you love \LaTeX{} standard, or |\ADLsomewide| if % you second the preference of \textsf{array} authors. % % % % \subsection{Finer Tuning} % \label{sec:usage-finer} % % \changes{v1.4-2}{1999/06/25} % {Description of drawing mode is added.} % To draw dash-lines, we use a powerful primitive of \TeX{} called |\xleaders|. % It replicates a segment that consist of a dash and gap so that a dash-line % has as many segments as possible and distributes {\it remainder} space to % make the spaces between adjacent dash segments (almost) equal to each % other. Therefore, you will have dash-lines with consistent steps of gaps % and spaces as the left and upper lines in Figure~\ref{fig:mode}(1) are. % % \begin{figure}[b] % \catcode`\|12 % \tabcolsep0pt \setbox\strutbox\hbox{\vrule height14pt depth6pt width0pt} % \def\mb{\makebox[20pt]} % \dashlinedash3.01pt \dashlinegap3.01pt % \def\example#1{\begin{tabular}[b]{|c:c;{2pt/2pt}c|} % \hline\noalign{\vskip-\arrayrulewidth} % \mb{A}&\mb{A}&\mb{A}\\[-\arrayrulewidth]\hdashline % \mb{B}&\mb{B}&\mb{B}\\[-\arrayrulewidth]\hdashline[2pt/2pt] % \mb{C}&\mb{C}&\mb{C}\\[-\arrayrulewidth]\hline % \multicolumn3c{(#1)} % \end{tabular}} % % \centerline{\example1\qquad % \ADLdrawingmode{2}\example2\qquad % \ADLdrawingmode{3}\example3} % \caption{Drawing mode controlled by \cs{ADLdrawingmode}} % \label{fig:mode} % \end{figure} % % However, because of a bug (or buggy feature) of |\xleaders|, there is a % small possibility that a dash segment near the right\slash bottom end % drops as right and lower lines in (1) of the figure shows. To cope with this % problem, you may change the {\it drawing mode} by % |\ADLdrawingmode|\Meta{$m$} as follows. % % \begin{itemize} % \item $m=1$ % \DescribeMacro{\ADLdrawingmode}\\ % As shown in Figure~\ref{fig:mode}(1), most beautiful in almost all cases % as the left/upper lines, but has a small possibility to produce an ugly % result as right/lower lines. This is default. % % \item $m=2$\\ % As shown in (2) of the figure, beautiful if dash-lines are not so sparse % as right/lower lines, but dash segments near the both ends may be a little % bit too long as left/upper lines. % % \item $m=3$\\ % As shown in (3) of the figure, beautiful if dash-lines are not so sparse % as right/lower lines, but gaps near the both ends may be considerably too % large as left/upper lines. % \end{itemize} % % It is recommended to use default mode 1 unless you have an ugly result % in the final version of your manuscript, because the correctness of mode 1 % is very sensitive to the length of dash-lines. % % % % \subsection{Performance Tuning} % \label{sec:usage-performance} % % \changes{v1.4-2}{1999/06/25} % {Description of (in)activation is added.} % % Since drawing dash-lines is a hard job, you have to be patient with the % fact that the performance of typesetting |array|\slash|tabular| with % dash-lines is poorer than that of ordinary ones. In fact, according to % author's small performance evaluation with a |tabular| having nine % vertical and ten horizontal dash-lines, typesetting the |tabular| is % approximately ten times as slow as its ordinary counterpart with solid % lines. % % However, this is not a really bad news, unfortunately. The real one is % that loading \textsf{arydshln} makes typesetting |array|\slash|tabular| % slower even if they only have solid lines which the package treats as % special ones of dash-lines. The evaluation result shows the degradation % factor is about nine. Therefore, if your document has many % |array|\slash|tabular| with solid lines, \LaTeX{} will run slowly even % with quite few (or no) |array|\slash|tabular| with dash-lines, % % \DescribeMacro{\ADLinactivate} % To cope with this problem, you may inactivate dash-line functions by the % command |\ADLinactivate| that replaces dash-lines with solid % lines drawn by a faster (i.e. ordinary) mechanism. Although the % inactivation does not completely solve the performance problem, the % degradation factor will become much smaller and acceptable, approximately % 1.5 in the author's evaluation. For example, the draft version of your % document will have the command in its preamble, which you will remove from % your final version. % % \DescribeMacro{\ADLactivate} % Alternatively, you may do |\ADLinactivate| in the preamble, switch on by % |\ADLactivate| before you really need dash-lines, and switch off again % afterword. A wiser way could be surrounding |array|\slash|tabular| by % |\begin{ADLactivate}| and |\end{ADLactivate}|. % % \DescribeEnv{Array} % \DescribeEnv{Tabular} % If you feel it tiresome to type the long command\slash environment name for % the activation, you may use |Array| and |Tabular(*)| environment in which % dash-line functions are always active. Note that, however, since these % environment names are too natural to keep them from being used by authors % of other packages or yourself, name conflict could occur. If |Array| % and/or |Tabular| have already been defined when \textsf{arydshln} is % loaded, you will get a warning to show you have to define new % environments, say |dlarray| and |dltabular|, as follows. % % \begin{itemize}\item[] % |\newenvironment{dlarray}{\ADLactivate\begin{array}}%|\\ % | {\end{array}}|\\ % |\newenvironment{dltabular}{\ADLactivate\begin{tabular}}%|\\ % | {\end{tabular}}|\\ % |\newenvironment{dltabular*}{\ADLactivate\begin{tabular*}}%|\\ % | {\end{tabular*}}| % \end{itemize} % % \begingroup % \let\PDM\PrintDescribeMacro % \def\PrintDescribeMacro#1{\leavevmode\llap{\PDM{#1}}} % \DescribeMacro{\ADLnoshorthanded} % On the other hand, if they are defined after \textsf{arydshln} is loaded, % their definitions are silently replaced or \LaTeX{} complains of multiple % definitions. The error in the latter case will be avoided by putting % |\ADLnoshorthanded| just after |\usepackage{arydshln}|. % \par % \endgroup % % % % \subsection{Compatibility with Other Packages} % \label{sec:usage-compat} % % \changes{v1.5-1}{2000/07/12} % {Section 2.7 is added.} % \changes{v1.4-2}{1999/06/25} % {Description of characters and commands of \textsf{array} package is % added.} % \SpecialOptIndex{array}{package} % \SpecialIndex{\extrarowheight} % \SpecialIndex{\firsthline} % \SpecialIndex{\lasthline} % \SpecialIndex{\newcolumntype} % % Users of \textsf{array} package may use all of newly introduced % preamble characters, such as `|>|', `|<|', `|m|', `|b|', and all the % commands such as |\extrarowheight|, |\firsthilne| and |\lasthline|. The % preamble characters given by \textsf{arydshln} may be included in the % second argument of |\newcolumntype|. % % \changes{v1.5-1}{2000/07/12} % {Description of \textsf{colortab} commands is added.} % \SpecialOptIndex{colortab}{package} % \SpecialIndex{\LCC} % \SpecialIndex{\NAC} % \SpecialIndex{\ENAC} % \SpecialIndex{\AC} % \SpecialIndex{\EAC} % % Also users of \textsf{colortab} package may use |\LCC|\slash |\ECC| % construct to color columns. A horizontal solid\slash dash line may be % colored by, e.g.\ |\NAC\hdashline\ENAC|\@. The pair of |\AC| and |\EAC| may % be used to color everything between them {\em but}, unfortunately, % vertical lines are not. There are no ways to color vertical lines in a % table having dash lines. You may color vertical lines of a ordinary table % inactivating dash line functions by |\ADLinactivate|. % % \changes{v1.7}{2004/5/21} % {Description of \textsf{colortbl} and related commands is added.} % \SpecialOptIndex{colortbl}{package} % \SpecialIndex{\rowcolor} % \SpecialIndex{\columncolor} % \SpecialIndex{\cellcolor} % \SpecialIndex{\arrayrulecolor} % \SpecialIndex{\doublerulesepcolor} % % Another (and more convenient) table coloring tool \textsf{colortbl} may be % also used simply by loading it before \textsf{arydshln}. Not only the % painting commands |\rowcolor|, |\columncolor| and |\cellcolor| work well, % but both solid and dash lines are also colored by the command % |\arrayrulecolor| of \textsf{colortbl}\footnote{ % % The \textsf{colortbl} manual says \cs{arrayrulecolor} and % \cs{doublerulesepcolor} may be in \texttt{>\char`\{\ldots\char`\}} % in a preamble but they cause an error with the original implementation. % This bug is fixed in \textsf{arydshln} and they are now usable to specify % the color of the vertical (dash) lines whose specifications occur after % the commands.}. % % One caution is that |\arrayrulecolor| defines the color of the dash-part % of dash lines and thus gap-part has no color (i.e. color of the paper on % which the line drawn). Therefore, if you have a \textsf{tabular} like; % %\begin{quote} %\begin{verbatim} %\begin{tabular}{|>{\columncolor{red}}l:>{\colomncolor{green}}r|} %... %\end{tabular} %\end{verbatim} %\end{quote} % % you will find the vertical dash line is a sequence of black (or the color of % |\arrayrulecolor|) and white segments. This problem is partly solved by % declaring |\ADLnullwide|\footnote{ % % Since \textsf{colortbl} automatically loads \textsf{array}, the default is % \cs{ADLsomewide}} % % to conjunct the red and blue columns and to draw the dash line on their % border. % % \DescribeMacro{\ADLnullwidehline} % \DescribeMacro{\ADLsomewidehline} % Unfortunately, however, |\ADLnullwide| does not affect the real % width of horizontal (dash) lines and thus you will still see white gaps % in |\hdashline| and |\cdashline|. A solution is to put % |\ADLnullwidehline| before you start a % \texttt{array}\slash\texttt{tabular}\footnote{ % % This command also makes \cs{cline} and \cs{cdashline} visisble even if the % row below is painted.}. % % With this command, a horizontal (dash) line is drawn adjusting its bottom % edge to that of the row above. The command |\ADLsomewidehline| turns the % switch to default and the top edge of a horizontal (dash) line will be % adjusted to the bottom edge of the row above. % % \DescribeMacro{\dashgapcolor} % \DescribeMacro{\nodashgapcolor} % \SpecialIndex{\color} % Another method to avoid white gaps is to give a color to gaps by % |\dashgapcolor| with arguments same as |\color|. For example; % % \begin{quote} % |\arrayrulecolor{green}\dashgapcolor[rgb]{1,1,0}| % \end{quote} % % makes colorful dash lines with green dashes and yellow gaps. The command % can be placed outside of \texttt{array}\slash\texttt{tabular} for dash % lines in the environment, in the argument of preamble character |>| % for vertical dash lines following them, or at the beginning of a row for % horizontal dash lines following the command. The commmand % |\nodashgapcolor| (no arguments) nullifies the effect of |\dashgapcolor|. % Note that |\nodashgapcolor| is different from |\dashgapcolor{white}| % because the former makes gaps {\it transparent} while the later whiten them. % % \DescribeEnv{longtable} % \DescribeEnv{Longtable} % \changes{v1.6-1}{2003/8/25} % {Description of \textsf{longtable} is added.} % \SpecialOptIndex{longtable}{package} % Usage of \textsf{longtable} with \textsf{arydshln} is quite simple. Just % loading \textsf{arydshln} after \textsf{longtable} is enough to make the % |longtable| environment able to draw dash-lines. A shorthand activation % of dash-line functions is also available by |Longtable| environment. One % caution to \textsf{longtable} users is that the temporary results before % the {\em convergence} of the column widths may be different from those % without \textsf{arydshln}. For example, the following is the first pass % result of the example shown in Table~3 of the \textsf{longtable} manual. % % \begin{quote} % \catcode`\|12 % \leavevmode\vtop{\offinterlineskip % \hbox{\begin{tabular}{|c|c|c|}\hline 1&2&3\end{tabular}} % \hbox{\begin{tabular}{|c|}wide multicolumn spanning 1--3\end{tabular}} % \hbox{\begin{tabular}{|c|c|}\omit& % \omit\vrule height0pt width116.66695pt\cr % multicolumn 1--2&3\end{tabular}} % \hbox{\begin{tabular}{|c|c|c|}\omit& % \omit\vrule height0pt width68.05573pt& % \omit\vrule height0pt width116.66695pt\cr % wide 1&2&3\\\hline\end{tabular}}} % \end{quote} % % \SpecialOptIndex{LTchunksize}{counter} % Since |LTchunksize| is one in the example, columns of each row has their own % widths and thus has vertical lines drawn at the edges of the columns. On % the other hand, you will have the following as the first pass result with % \textsf{arydshln}. % % \begin{quote} % \catcode`\|12 % \settowidth\unitlength{\begin{tabular}{|c|c|c|}\hline 1&2&3\end{tabular}} % \begin{tabular}[t]{|l|c|c|} % \multispan3\relax % \leaders\hrule height\arrayrulewidth\hskip\unitlength\cr % \hbox to0pt{1\hskip2\tabcolsep 2\hskip2\tabcolsep 3\hss}&&\\ % \multicolumn3{|l|}{wide multicolumn spanning 1--3}\\ % \multicolumn2{|l|}{\hbox to0pt{multicolumn 1--2\hskip\tabcolsep % \hbox to116.66695pt{\hss3\hss}\hss}}&\\ % wide 1&2&3\\\hline % \omit& % \omit\vrule height0pt width68.05573pt& % \omit\vrule height0pt width116.66695pt\cr % \end{tabular} % \end{quote} % % As you see, the vertical lines are drawn at the column edges of the last % row\footnote{ % % More precisely, drawn according to the column widths established by all % the chunks preceding page output.} % % because \textsf{arydshln} draws them when it see the last row. Anyway, % you may ignore temporary results and will have a compatible result when % the column widths are converged like the following. % % \begin{quote} % \catcode`\|12 % \begin{tabular}[t]{|c|c|c|}\hline % 1&2&3\\ % \multicolumn{3}{|c|}{wide multicolumn spanning 1--3}\\ % \multicolumn{2}{|c|}{multicolumn 1--2}&3\\ % wide 1&2&3\\\hline % \end{tabular} % \end{quote} % % % % \section{Known Problems} % \label{sec:prob} % % There are following known problems. % % \begin{enumerate} % \item % The new preamble specifiers `|:|' and `|;{|\meta{dash}|/|\meta{gap}|}|' % cannot be followed or preceded by `|@{|\meta{text}|}|', or you will have % an ugly result. More specifically, a specifier to draw a dash-line at the % left edge of a column cannot be preceded by `|@{|\meta{text}|}|', while % that to draw at the right edge cannot be followed by `|@{|\meta{text}|}|'. % % \item\leavevmode % \changes{v1.4-2}{1999/06/25} % {Description about `\protect\EXCLAMATION' of array package is added.} % % If you use \textsf{array} package, the restriction of `|@|' shown above is % also applied to `|!|'. % % \item % In order to make it sure that a dash-line always {\em touches} its both % end, i.e. a dash-line always begins and ends with a dash segment, the % amount of a gap will slightly vary depending on the dash-line length. % % \item % \changes{v1.4-2}{1999/06/25} % {Reference to the section for drawing mode is added.} % % As described in \S\ref{sec:usage-finer}, dash-lines drawn in the default % mode 1 may lack a dash segment near its right\slash bottom end. % % \item % \changes{v1.4-2}{1999/06/25} % {Description on minimum length is added.} % % If a dash-line is too short, you will have an ugly result without overfull % message. More specifically, in mode 1 or 3, a line will look to protrude % beyond its column\slash row borders if it is shorter than a half of % |\dashlinedash|. In mode 2, the minimum length to avoid the protrusion is % $1.5\times|\dashlinedash|+ |\dashlinegap|$. % % \item % \changes{v1.4-2}{1999/06/25} % {Reference to the performance tuning section is added.} % % As described in \S\ref{sec:usage-performance}, % the processing speed for |array| and |tabular| environment will become % slower even if dash-lines are not included. % % \item % \changes{v1.5-1}{2000/07/12} % {Caution about \cs{AC}/\cs{EAC} pair for vertical line coloring is % added.} % \changes{v1.7}{2004/5/21} % {Comment on vertical line coloring with \textsf{colortbl} is added.} % % % As described in \S\ref{sec:usage-compat}, |\AC| and |\EAC| pair of % \textsf{colortab} such as |\AC&\EAC| cannot color the vertical line at % |&|. Use |\ADLinactivate| if you want to have a ordinary table with % colored vertical lines. Note that you may color vertical lines with % \textsf{colortbl} package. % \end{enumerate} % % % % \IndexPrologue{\newpage\section*{Index} % Italicized number refers to the page where the specification of % corresponding entry is described.} % \StopEventually{ % \section*{Acknowledgments} % % \changes{v1.4-2}{1999/06/25} % {Thank to more people.} % \changes{v1.5-3}{2003/07/11} % {Thank to Yaxin Liu.} % \changes{v1.6-1}{2003/08/25} % {Thank to people for \textsf{longtable}.} % \changes{v1.7}{2004/5/21} % {Thank to Klaus Dalinghaus and refer orignal \textsf{colortbl}.} % \changes{v1.71-1}{2004/8/31} % {Thank to Morten H\o gholm.} % % The author thanks to Monty Hayes who gave the author the opportunity to % make this style, and Weimin Zhang and Takahiro Kubota who pointed out bugs % in early versions. He also thanks to the following people; Sebastian % Rahtz and Graham Williams who kindly invited the style to \TeX{} CTAN and % online catalogue compiled by Graham; Peter Ehrbar who showed the style was % incompatible with \textsf{array} and kindly accepted the offer to be an % alpha-user of v1.4 alone; Zsuzsanna Nagy who reported another % incompatibility problem with \textsf{colortab}; Ralf Heydenreich who % reported the bug causing that glues in a column have no effect; Yaxin % Liu who reported the incompatibility bug of \textsf{array} and % \cs{ADLinactivate}; Craig Leech who reported the incompatibility % problem with \textsf{longtable}, which was also reported by Uwe Jehmlich, % Torge Thielemann and % Florian Weig, and have waited for two years and a half (!) for the % solution; and Klaus Dalinghaus who reported yet another incompatibility % with \textsf{colortbl}; Morten H\o gholm who reported the bug of |m|-type % columns of \textsf{array} which had not manifested in five (!!) years % since the author realesed the first \textsf{array}-compatible version. % % The base implementation of \texttt{array} and \texttt{tabular} % environments, part of which the author gives new definitions referring % original ones, are written by Leslie Lamport as a part of \LaTeX-2.09 and % \LaTeXe{} (1997/12/01) to which Johannes Braams and other authors also % contributed. The author also refers \textsf{array} package (v2.3m) % written by Frank Mittelbach and David Carlisle; \textsf{colortab} package % (v0.9) written by Timothy van Zandt; and \textsf{longtable} (v4.10) and % \textsf{colortbl} (v0.1j) packages % written by David Carlisle; to make the style compatible with those % packages. % % \PrintIndex} % % % % \newpage % \section{Implementation} % \label{sec:imp} % \subsection{Problems and Solutions} % \label{sec:imp-ps1} % % \changes{v1.4-2}{1999/06/25} % {The title of section 4.1 is changed.} % \changes{v1.4-2}{1999/06/25} % {\cs{hfil} is replaced with \cs{hss} taking the possibility of % negative wide columns into account.} % \changes{v1.7}{2004/5/21} % {Add notes for dash line coloring.} % % We have two different problems to solve; how to draw horizontal dash-lines % and how to draw vertical dash-lines. The former problem is relatively % easy because the technique for drawing |\cline|-s can be used. That is, if % we know the number of columns, we can draw a dash-line across the % |\multispan|-ed columns by |\xleaders| of dash. Modifying a preamble of % |array|\slash|tabular| to count the number of columns is not hard. Since % |\cdashline| is given beginning and ending columns, its implementation is % also easy. % % \SpecialIndex{\@arstrutbox} % % The latter problem, however, is much harder. Remember that % |array|\slash|tabular| draws vertical solid lines by |\vrule|-s in each row % without height\slash depth specification exploiting \TeX's sophisticated % mechanism of the rule extension in the surrounding box. Since \TeX{} does % not have such a mechanism for |\xleaders| unfortunately, we at least have % to know the height and depth of a row which includes vertical dash-lines. % Although the height and depth are often same as those of |\@arstrutbox|, we % will have an exceptionally tall and/or deep row that makes dash-lines {\em % broken} if we assume every row has the standard height and depth. % % Moreover, even if we can measure the height\slash depth of each row (in % fact we will do as describe later), drawing dash-lines in each row will % not produce a good result. Look at the following two examples closely. % %\begin{quote} %\makeatletter %\begin{tabular}{c:c}\hline %A&B\\\hline %\noalign{\xdef\adl@rowsL{\adl@rowsL(\relax/0);} % \xdef\adl@rowsR{\adl@rowsR(\relax/0);}} %{\vrule height2\ht\strutbox depth2\dp\strutbox width\z@\LARGE A}&B\\\hline %\end{tabular}\qquad %\begin{tabular}{c:c}\hline %A&B\\\hline %{\vrule height2\ht\strutbox depth2\dp\strutbox width\z@\LARGE A}&B\\\hline %\end{tabular} %\end{quote} % % In the left example, two dash-lines are individually drawn in two rows. % Since the first row is not so tall and deep (8.4\,pt\slash % 3.6\,pt) as to contain enough number of default dash segments (4\,pt dash and % 4\,pt gap) to keep |\xleaders| from inserting a large space, the dash-line % in the first row is {\em sparse}. On the other hand, the second row is % enough tall and deep (16.8\,pt\slash 7.2\,pt) and thus the dash-line in the % row looks better. Thus the resulting dash-line is awful because it does % not have a continuous dash/gap sequence. % % The right example, which we wish to produce, is much better than the left. % In this example, the dash line is draw across two rows keeping continuous % steps of dashes and gaps. In order to have this result, we have to draw % the dash-line {\em after} two rows are built because it is necessary to % know the total hight and depth of two rows. In general, if we know the % total hight and depth of rows and whether a column has a dash-line, we can % draw dash-lines by adding an extra row containing dash-lines. For % example, the result shown above is obtained by the following row. % % \begin{quote} % |\omit\hss|\meta{dash-line of 36\,pt high}|&\omit\cr| % \end{quote} % % Note that \meta{dash-line of 36\,pt high} have to be |\smash|-ed. % % In addition to this basic scheme, we have to take the following points % into account. % % \begin{itemize} % \item % A dash-line drawn by the preamble character `|;|' will have non-default % dash\slash gap specification. % % \item % A column may have two or more dash-lines separated by spaces of % |\doublerulesep|. Mixed sequence of solid- and dash-lines also have to be % allowed. % % \item % The first column may have dash-lines at both ends, while those of others % will appear at right ends only. An exception of this rule is brought by % |\multicolumn| that may have leading sequence of solid- and/or dash-line % specifiers in its preamble. % % \item % A |\multicolumn| may break or add a dash-line, or may change the % dash\slash gap specification of a dash-line. A sequence of % |\h(dash)line|-s also break dash-lines. % % \item % If \textsf{colortbl} is in use, coloring dash\slash gap by % |\arrayrulecolor| and |\dashgapcolor| gives another possibility of the % variation of dash\slash gap specification. % \end{itemize} % % In order to cope with them, the following data structure is constructed % during rows are built. % % \begin{enumerate} % \item % The list of row information $R=\langle r_1,r_2,\ldots,r_N\rangle$. % % \item % The $i\th$ element of $R$, $r_i$, is one of the following\footnote{ % % In the real implementation, the structure of $r_i$ is slightly different.}. % % \begin{enumerate} % \item % A triple $\langle C^L_i,C^R_i,h_i\rangle$, where $C^L_i$ and $C^R_i$ are % the lists of solid- or dash-line segments drawn at the left and right edge % of columns respectively, and $h_i$ is the height plus depth of the $i\th$ % row. % % \item % ${\it connect}(h_i)$ for a |\h(dash)line| of $h_i$ wide meaning that $r_i$ % is an empty pseudo row of $h_i$ high and dash-lines are not broken at the % row. % % \item % \changes{v1.6-1}{2003/8/25} % {Description of \textit{discard} is added.} % In |longtable| environment, ${\it discard}(h_i)$ for a negative vertical % space inserted by |\\[|\meta{$h_i$}|]| or |\h(dash)line| meaning $r_i$ % is an empty pseudo row of $h_i$ high and dash-lines are not broken but may % be discarded by the page break at the row. % % \item % ${\it disconnect}(h_i)$ for a vertical gap generated by a sequence of % |\h(dash)line| meaning that $r_i$ is an empty pseudo row of $h_i$ high and % dash-lines are broken at the row. % \end{enumerate} % % \item % $C^L_i=\langle e^i_1,e^i_2,\ldots,e^i_m\rangle$ where $e^i_j$ corresponds % to the $j\th$ (leftmost is first) solid- or dash-line segment. $C^R_i$ is % similar but its elements are ordered in reverse, i.e. the rightmost segment % is the first element. % % \item % \changes{v1.7}{2004/5/21} % {A dash/gap specification $d^i_j/g^i_j$ now has color.} % The $j\th$ element of $C^L_i$ or $C^R_i$, $e^i_j$, is a triple $\langle % c^i_j,d^i_j,g^i_j\rangle$ where $c^i_j$ is the column number in which the % segment appears, and $d^i_j$ and $g^i_j$ are dash\slash gap specification, % length and color, of the segment. For a solid line segment, the length % attributes of both $d^i_j$ and $g^i_j$ are 0. % \end{enumerate} % % Then this data structure is processed to draw solid- and dash-lines at the % end of the |array|\slash|tabular| as follows. Let $e^i_j=\langle c^i_j, % d^i_j, g^i_j\rangle$ be the $j\th$ element of $C^L_i$ of $r_i$. The {\em % position} $p^i_j$ of $e^i_j$ in the column $c^i_j$ is defined as follows. %$$ % p^i_j = \cases{1& if $j=1 \LOR c^i_j\neq c^i_{j-1}$\cr % p^i_{j-1}+1& otherwise}. %$$ % The following defines whether two elements $e^i_j$ and $e^{i'}_{j'}$ are % {\em connected}, or $e^i_j\sim e^{i'}_{j'}$. % % \begin{eqnarray*} % e^i_j\sim e^{i'}_{j'}& % \togets&ip^{i'}_{j'})\LOR\\ % && \PH (c^i_j=c^{i'}_{j'}\LAND p^i_j=p^{i'}_{j'}\LAND i1}&=& % \cases{ \cs{null}& % if $\gamma_{k-1}=\gamma_k\LAND \pi_{k-1}=\pi_k$\cr % \cs{hskip}\cs{doublerulesep}& % if $\gamma_{k-1}=\gamma_k\LAND \pi_{k-1}\neq\pi_k$\cr % [\amp\cs{omit}\cs{hss}]^{\gamma_k-\gamma_{k-1}}& % if $\gamma_{k-1}\neq\gamma_k$\cr}\\[1ex] % \sigma_{n+1}&=& % [\amp\cs{omit}\cs{hss}]^{{\mit\Gamma}-\gamma_n-1} % \end{eqnarray*} % % % % \subsection{Another Problem and Imperfect Solutions} % \label{sec:imp-ps2} % % In the default mode 1, we draw a dash line of dash size $d$ and gap size % $g$ as follows. Let $W$ be the length of the line plus 10\,|sp|\footnote{ % % This small amount is added by \cs{xleaders} in order to, according to the % comment in \texttt{tex.web}, compensate floating point rounding error.}, % % which is unknown for us if horizontal but known for \TeX, and assume % $W\geq d/2$ (or the line protrude to the column\slash row boarder.) At % the both ends of the columns, dashes of $d/2$ long are drawn to make the % dash-line {\em touched} to the ends. Then $n=\lfloor(W-d-g)/(d+g)\rfloor$ % dashes are equally distributed in the remaining space. Thus we will have; % $$ % D_0(d/2)G_0(g+\epsilon')D_1(d)G_1(g+\epsilon)\ldots % G_{n-1}(g+\epsilon)D_n(d)G_n(g+\epsilon')D_{n+1}(d/2) % $$ % where $D_i(l)$ and $G_i(l)$ are dash and gap of $l$ long, % $\epsilon=(W-(n+1)(d+g))/(n+1)$ (rounded), and % $\epsilon'=(W-(n+1)(d+g)-(n-1)\epsilon)/2$ to compensate the rounding % error on the calculation of $\epsilon$. For a horizontal line, this % result will be obtained by |\xleaders| as follows where $G^m_i(\epsilon)$ % and $G^m_i(\epsilon')$ are the spaces inserted by |\xleaders|. % % \begin{eqnarray*} % \rlap{$\displaystyle D_0(d/2)G^l_0(g/2) % \hbox{\cs{xleaders}\cs{hbox}{\tt\char`\{}} % G^r(g/2)D(d)G^l(g/2)\hbox{\tt\char`\}\cs{hss}\ } % G^r_n(g)D_{n+1}(d/2)$}\qquad\\ % &=&D_0(d/2)G^l_0(g/2)G^m_0(\epsilon') % \left(G^r_0(g/2)D_1(d)G^l_1(g/2)\right)G^m_1(\epsilon)\\ % && \phantom{D_0(d/2)G^l_0(g/2)G^m_0(\epsilon)} % \left(G^r_1(g/2)D_2(d)G^l_2(g/2)\right)G^m_2(\epsilon)\\ % && \phantom{D_0(d/2)G^l_0(g/2)G^m_0(\epsilon)}\ldots\\ % && \phantom{D_0(d/2)G^l_0(g/2)G^m_0(\epsilon)} % \llap{$\displaystyle G^m_{n-1}(\epsilon)$} % \left(G^r_{n-1}(g/2)D_n(d)G^l_n(g/2)\right) % G^m_n(\epsilon')G^r_n(g/2)D_{n+1}(d/2)\\ % &=&D_0(d/2)G_0(g+\epsilon')D_1(d)G_1(g+\epsilon)\ldots % G_{n-1}(g+\epsilon)D_n(d)G_n(g+\epsilon')D_{n+1}(d/2) % \end{eqnarray*} % % The problem is that $\epsilon'$ could be negative and \TeX{} mistakingly % ignores this possibility. That is, since \TeX{} does not put |\hbox| % beyond the right edge of |\xleaders|, the rightmost |\hbox| is omitted if % $\epsilon'$ is negative as described in \S\ref{sec:usage-finer}. % % Since it is (almost) impossible to know the length of a horizontal line, % we cannot cope with this problem by adding or subtracting its length. % Thus we introduced {\em drawing mode} to have imperfect solutions. In the % mode 2, we draw a line by the following sequence. % % \begin{eqnarray*} % \rlap{$\displaystyle D_0(d/2)G^l_0(g/2)G^r_{0'}(g/2)D_{1'}(d)G^l_{1'}(g/2) % G(-d-g)$}\qquad\\ % && \hbox{\cs{xleaders}\cs{hbox}{\tt\char`\{}} % G^r(g/2)D(d)G^l(g/2)\hbox{\tt\char`\}\cs{hss}\ }\\ % && 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) % \end{eqnarray*} % % That is, $n\th$ |\hbox| that could be disappeared is put twice and the % first one is also overlaid for symmetrization. Therefore the length of the % first and $n\th$ dashes is $d+\vert\epsilon'\vert$ and thus could be a % little bit longer than others. % % On the other hand, we replace |\xleaders| of mode 1 with |\cleaders| for % the drawing in mode 3. The result will be; % $$ % D_0(d/2)G_0(g+R)D_1(d)G_1(g)\ldots % G_{n-1}(g)D_n(d)G_n(g+R)D_{n+1}(d/2) % $$ % where $R=(W-(n+1)(d+g))/2$ to make the first and last gaps considerably wider % than others. % % % % \iffalse %<*package> % \fi % % \subsection{Register Declaration} % \label{sec:imp-decl} % % Here registers and switches are declared. % % \begin{macro}{\dashlinedash} % \begin{macro}{\dashlinegap} % \begin{macro}{\hdashlinewidth} % \begin{macro}{\hdashlinegap} % First of all, two |\dimen| registers |\dashlinedash| and |\dashlinegap| % to control the shape of dash-lines are declared, and their default values, % 4\,pt for both, are assigned to them. They have aliases, % |\hdashlinewidth| and |\hdashlinegap| respectively, for the backward % compatibility. % \end{macro}\end{macro}\end{macro}\end{macro} % % \begin{macrocode} %% Register Declaration \newdimen\dashlinedash \dashlinedash4pt % \newdimen\dashlinegap \dashlinegap4pt % \let\hdashlinewidth\dashlinedash \let\hdashlinegap\dashlinegap % \end{macrocode} % % Next, the following six switches are declared. % \begin{itemize} % \item % \begin{macro}{\ifadl@leftrule} % |\ifadl@leftrule| is used in the preamble analysis macro |\@mkpream| and % is true during it processes leading characters for solid- and dash-lines, % i.e.\ `\verb!|!', `|:|', and `|;|'. % \end{macro} % % \item % \begin{macro}{\ifadl@connected} % |\ifadl@connected| is used to indicate the {\em connection} $e^i_j\sim % e^{i'}_{j'}$. When we process $e^{i'}_{j'}$, the switch is true iff % $^\exists e^i_j(e^i_j\sim e^{i'}_{j'})$. % \end{macro} % % \item % \begin{macro}{\ifadl@doublerule} % |\ifadl@doublerule| is used to make $\sigma_k$. When we are to make % $\sigma_k L_k$, it is true iff $\gamma_{k-1}=\gamma_k\LAND\pi_{k-1}\neq % \pi_k$. % \end{macro} % % \item % \begin{macro}{\ifadl@zwvrule} % \changes{v1.4-3-2}{1999/06/25} % {Introduced to indicate vertical lines have null width.} % |\ifadl@zwvrule| controls the {\em real} width of vertical lines. If it % is true, lines are drawn as if their width is zero following \LaTeX's % standard. Otherwise, their width |\arrayrulewidth| contribute to the % width of columns as \textsf{array} does. % \end{macro} % % \item % \begin{macro}{\ifadl@zwhrule} % \changes{v1.7-1}{2004/5/21} % {Introduced to indicate horizontal lines have null width.} % |\ifadl@zwhrule| controls the {\em real} width of horizontal lines. If it % is true, a line is drawn as if its width is zero and its bottom edge is % adjusted to that of the row above by inserting |\vskip-\arrayulewidth| % before the drawing. Thus a horizontal dash line is included in the row % above and its gaps look colored properly if the row is painted. If it is % false, the width |\arrayrulewidth| contribute to the height of % \texttt{array}\slash\texttt{tabular} as usual. % \end{macro} % % \item % \begin{macro}{\ifadl@usingarypkg} % \changes{v1.4-3-1}{1999/06/25} % {Introduced to know if \textsf{array} is loaded.} % |\ifadl@usingarypkg| is true iff \textsf{array} has been loaded prior to % \textsf{arydshln}. This switch shows us which definitions, by \LaTeX{} or % \textsf{array}, we have to modify. Its value is set by examining if % |\extrarowheight|, which is introduced by \textsf{array}, is defined. % \end{macro} % % \item % \begin{macro}{\ifadl@inactive} % \changes{v1.4-3-3}{1999/06/25} % {Introduced to indicate dash-line functions are inactive.} % |\ifadl@inactive| inactivates dash-line functions if it is true. Its % default value is false. % \end{macro} % \end{itemize} % % \SpecialIndex{\@tempswa} % We also use a working switch |\@tempswa|. % % \begin{macrocode} \newif\ifadl@leftrule \newif\ifadl@connected \newif\ifadl@doublerule \newif\ifadl@zwvrule \newif\ifadl@zwhrule \newif\ifadl@usingarypkg \ifx\extrarowheight\undefined \adl@usingarypkgfalse \else \adl@usingarypkgtrue \fi \newif\ifadl@inactive \adl@inactivefalse % \end{macrocode} % % \begin{macro}{\ADLnullwide} % \changes{v1.7-1}{2004/5/21} % {Introduced to make horizontal lines null wide.} % \begin{macro}{\ADLsomewide} % \changes{v1.7-1}{2004/5/21} % {Introduced to make horizontal lines \cs{arraydashline} wide.} % The switch |\ifadl@hwvrule| is turned on/off by user interface macros % |\ADLnullwide| and |\ADLsomewide|. Its initial value is the complement of % |\adl@usingarypkg|. % \end{macro}\end{macro} % % \begin{macro}{\ADLnullwidehline} % \changes{v1.4-3-2}{1999/06/25} % {Introduced to make vertical lines null wide.} % \begin{macro}{\ADLsomewidehline} % \changes{v1.4-3-2}{1999/06/25} % {Introduced to make vertical lines \cs{arraydashline} wide.} % The switch |\ifadl@zwvrule| is turned on/off by user interface macros % |\ADLnullwidehline| and |\ADLsomewidehline|. Its initial value is false. % \end{macro}\end{macro} % % \begin{macro}{\ADLactivate} % \begin{macro}{\ADLinactivate} % The switch |\ifadl@inactive| is also turned on/off by user interface macros % |\ADL#inactivate| and |\ADLactivate|. % \end{macro}\end{macro} % % \begin{macrocode} \def\ADLnullwide{\adl@zwvruletrue} \def\ADLsomewide{\adl@zwvrulefalse} \ifadl@usingarypkg \ADLsomewide \else \ADLnullwide \fi \def\ADLnullwidehline{\adl@zwhruletrue} \def\ADLsomewidehline{\adl@zwhrulefalse} \ADLsomewidehline \def\ADLactivate{\adl@inactivefalse} \def\ADLinactivate{\adl@inactivetrue} % \end{macrocode} % % The following |\box| register and three |\dimen| registers are used to % measure the height and depth of a row. % % \begin{itemize} % \item % \begin{macro}{\adl@box} % The contents of a column is packed into the |\box| register |\adl@box| to % measure its height and depth. % \end{macro} % % \item % \begin{macro}{\adl@height} % \begin{macro}{\adl@depth} % The |\dimen| registers |\adl@height| and |\adl@depth| contain the % height\slash depth of the tallest\slash deepest column in a row. When a % column is processed, they are compared to the height and depth of % |\adl@box| and are updated if they are less. % \end{macro}\end{macro} % % \begin{macro}{\adl@heightsave} % \begin{macro}{\adl@depthsave} % Since we have to update these register |\global|-ly to pass their value % across |&| and we may have a column containing |array|\slash|tabular|, % they are saved into |\adl@heightsave|\slash|\adl@depthsave| at the % beginning of the environment and are restored at its end. % \end{macro}\end{macro} % % \begin{macro}{\adl@finaldepth} % \changes{v1.4-3-6}{1999/06/25} % {Introduced to measure the depth of the last row.} % The other |\dimen| register |\adl@finaldepth| is set to the depth of the % last row, or zero if the last vertical item is a horizontal line. This % value is used to shift |array|\slash|tabular| down because we add extra % two |\smash|-ed rows which make the depth of |array|\slash|tabular| zero. % \end{macro} % \end{itemize} % % \SpecialIndex{\@tempdima} % \SpecialIndex{\@tempdimb} % We also use working |\dimen| registers |\@tempdima| and |\@tempdimb|. % % \begin{macrocode} \newbox\adl@box \newdimen\adl@height \newdimen\adl@heightsave \newdimen\adl@depth \newdimen\adl@depthsave \newdimen\adl@finaldepth % \end{macrocode} % % Then the following |\count| registers are declared. Note that some of % them contain dimensions measured by the unit |sp|. % % \begin{itemize} % \item % \begin{macro}{\adl@columns} % \begin{macro}{\adl@ncol} % \changes{v1.4-3-1}{1999/06/25} % {Introduced for new column counting in preamble construction.} % |\adl@columns| has the number of columns specified in the preamble of the % environment. Because of a complicated reason related to the compatibility % with \textsf{array}, we cannot count up |\adl@columns| directly but % increment |\adl@ncol| when each column of preamble is built and move its % value to |\adl@columns| after the preamble is constructed. % \end{macro}\end{macro} % % \item % \begin{macro}{\adl@currentcolumn} % \begin{macro}{\adl@currentcolumnsave} % To process |\multicolumn|, we have to know the column number where it % appears. Thus we have a column counter |\adl@currentcolumn| which is % |\global|-ly incremented when each column is built. Because of the % |\global| assignment, the counter has to be saved\slash restored % into\slash from |\adl@currentcolumnsave|. % \end{macro}\end{macro} % % \item % \begin{macro}{\adl@totalheight} % In the real implementation, $\tau_k$ and $\beta_k$ are calculated by the % following equations rather than those shown in \S\ref{sec:imp-ps1}. %$$ % H=\sum_{l=1}^N h_l,\quad % \tau_k=H-\sum_{l=1}^{i-1} h_l,\quad % \beta_k=\tau_k-\sum_{l=i'}^i h_l. %$$ % |\adl@totalheight| contains $\sum_{l=1}^i h_l$ when the $i\th$ row is % built and thus its final value is $H$. Since the data structure $R$ are % represented by a text, we have to pay attention to the precision of its % dimensional elements, such as $h_i$. That is, if we append $h_i$ to $R$ % by expanding |\the\dimen|$n$ which has the height plus depth of $i\th$ % row, $h_i$ will be an approximation of |\dimen|$n$ represented by a % decimal fraction with |pt|. Although the error of the approximation is % quite small and may be negligible, the error must be avoided because it is % avoidable by simply using |\number\dimen|$n$. Therefore, $h_i$ is an % integer and thus |\adl@totalheight| is too. % \end{macro} % % \begin{macro}{\adl@totalheightsave} % Because of the |\global| assignment to |\adl@totalheight| to pass its value % across rows, it has to be saved\slash restored into\slash from % |\adl@totalheightsave|. % \end{macro} % % \item % \begin{macro}{\adl@dash} % \begin{macro}{\adl@gap} % In order to check $e^i_j\sim e^{i'}_{j'}$, the size attributes of $d^i_j$ % and $g^i_j$ are kept in % the registers |\adl@dash| and |\adl@gap| when we process $e^{i'}_{j'}$. % As explained above, $d^i_j$ and $g^i_j$ are integers and thus |\adl@dash| % and |\adl@gap| are |\count| registers. % \end{macro}\end{macro} % % \item % \begin{macro}{\adl@cla} % \begin{macro}{\adl@clb} % \SpecialIndex{\@cla} % \SpecialIndex{\@clb} % The coding of |\cdashline| is similar to that of |\cline| in \LaTeX-2.09 % which uses two global |\count| registers |\@cla| and |\@clb|. These % registers are omitted from \LaTeXe{} because its |\cline| is completely % recoded. We could adopt new coding but it requires some other macro % definitions that \LaTeX-2.09 does not have. Thus we simply introduce new % global counters |\adl@cla| and |\adl@clb| for |\cdashline| in order to % make |\cdashline| work in both \LaTeX-2.09 and \LaTeXe. % \end{macro}\end{macro} % \end{itemize} % % \SpecialIndex{\@tempcnta} % \SpecialIndex{\@tempcnta} % We also use working |\count| registers |\@tempcnta| and |\@tempcntb|. % % \begin{macrocode} \newcount\adl@columns \newcount\adl@ncol \newcount\adl@currentcolumn \newcount\adl@currentcolumnsave \newcount\adl@totalheight \newcount\adl@totalheightsave \newcount\adl@dash \newcount\adl@gap \newcount\adl@cla \newcount\adl@clb % \end{macrocode} % % \begin{macro}{\adl@everyvbox} % \changes{v1.4-3-1}{1999/06/25} % {Introduced for a tricky modification of \cs{@array}.} % The last register declaration is for a |\toks| register named % |\adl@everyvbox|. In order to minimize the copy-and-modify of the codes % in \LaTeX{} and \textsf{array}, we need to use |\everyvbox| in our own % definition of |\@array|. The register is used to save the contents of % |\everyvbox|. % \end{macro} % % \begin{macrocode} \newtoks\adl@everyvbox % \end{macrocode} % % \begin{macro}{\adl@org@arrayclassz} % \changes{v1.4-3-3}{1999/06/25} % {Introduced to restore \cs{@arrayclassz}.} % \begin{macro}{\adl@org@tabclassz} % \changes{v1.4-3-3}{1999/06/25} % {Introduced to restore \cs{@tabclassz}.} % \begin{macro}{\adl@org@classz} % \changes{v1.4-3-3}{1999/06/25} % {Introduced to restore \cs{@classz}.} % \begin{macro}{\adl@org@@startpbox} % \changes{v1.4-3-3}{1999/06/25} % {Introduced to restore \cs{@@startpbox}.} % \begin{macro}{\adl@org@@endpbox} % \changes{v1.4-3-3}{1999/06/25} % {Introduced to restore \cs{@@endpbox}.} % \begin{macro}{\adl@org@endpbox} % \changes{v1.4-3-3}{1999/06/25} % {Introduced to restore \cs{@endpbox}.} % \begin{macro}{\adl@org@cline} % \changes{v1.4-3-3}{1999/06/25} % {Introduced to restore \cs{cline}.} % \changes{v1.4-3-6}{1999/06/25} % {Introduced to refer original version in modified \cs{cline}.} % The other declarative stuffs are the sequence of |\let| to capture the % original definitions of macros that we will modify afterword. The main % purpose of them is to nullify the modification when dash-line functions % are inactive, while |\adl@org@cline| is also referred in its modified % version. % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro} % % \begin{macrocode} \let\adl@org@arrayclassz\@arrayclassz \let\adl@org@tabclassz\@tabclassz \let\adl@org@classz\@classz \let\adl@org@@startpbox\@@startpbox \let\adl@org@@endpbox\@@endpbox \let\adl@org@endpbox\@endpbox \let\adl@org@cline\cline %%^L % \end{macrocode} % % % % \subsection{Initialization} % \label{sec:imp-init} % % \begin{macro}{\adl@array} % \changes{v1.4-3-1}{1999/06/25} % {Introduced to save original definition of \cs{@array}.} % \begin{macro}{\@array} % \changes{v1.4-3-1}{1999/06/25} % {Drastically modified to avoid copy-and-modify.} % \begin{macro}{\adl@noalign} % \changes{v1.7-2}{2004/5/21} % {Introduced to fix a bug of \textsf{colortbl}.} % % \LaTeX's macro |\@array| is modified to save and initialize registers and % data structures which are |\global|-ly updated in order to allow nested % |array|\slash|tabular|. This saving and initializing are performed by % |\adl@arrayinit| as explained below. The problem in the modification is % that the code of |\@array| in \textsf{array} is completely different from % that of \LaTeX{} original. % % The main difference is that \LaTeX{} builds |\@preamble| locally, while % \textsf{array} does globally exploiting the fact that the lifetime of % |\@preamble| ends before another |array|\slash|tabular| appears in a % column. The latter implementation will work well unless the building % process in |\@mkpream| produces something referred after |\@preamble| is % thrown into \TeX's {\em stomach}. In our implementation, unfortunately, % the number of columns has to be counted in \break|\@mkpream| and will be % referred by |\hdashline| and the vertical line drawing procedure. % % Thus we have to change the column counting mechanism depending on whether % or not \textsf{array} is in use. The simplest way could be to copy the codes % of \LaTeX{} and \textsf{array} and modify them appropriately examining the % value of |\ifadl@usingarypkg|. However this solution is vulnerable to the % modification of the original version and thus we wish to refuse it as far % as possible. % % \SpecialIndex{\everyvbox} % \SpecialIndex{\adl@everyvbox} % Therefore, we use a trick with |\everyvbox| in which |\adl@arrayinit| is % temporarily included to initialize registers and locally set % |\adl@columns| to the number of columns |\global|-ly counted by % |\adl@ncol|. This trick work well so far because; % % \begin{itemize} % \item % the first |\vbox|, |\vtop| or |\vcenter| made by |\@array| is the vertical % box surrounding |\halign|, and; % % \item % in |\@array| of \textsf{array} the box is opened {\em after} the preamble % is constructed; % \end{itemize} % % and will hopefully work in future. % % \changes{v1.5-3}{2003/07/11} % {Move \cs{adl@inactivate} to \cs{@array} from \cs{adl@arrayinit}.} % \changes{v1.54-2}{2003/08/25} % {Invoke \cs{adl@activate} if not \cs{ifadl@inactive}.} % \changes{v1.7-2}{2004/5/21} % {Make \cs{adl@noalign} \cs{let}-equal to \cs{noalign}.} % \SpecialIndex{\arrayrulecolor} % \SpecialIndex{\doublerulesepcolor} % \SpecialIndex{\dashgapcolor} % Next, if |\ifadl@inactive| is true, |\adl@inactivate| is invoked to % inactivate dash-line functions. Otherwise, |\adl@activate| is invoked to % activate them because an inactivated |array|\slash|tabular| % may have active children in it. Finally, |\adl@noalign| is made % |\let|-equal to |\noalign| so that |\arrayrulecolor|, % |\doublerulesepcolor| and |\dashgapcolor| are expanded with |\noalign| in % the environment. % \end{macro}\end{macro}\end{macro} % % \begin{macro}{\@@array} % \changes{v1.4-3-1}{1999/06/25} % {Introduced because \textsf{array} uses it.} % % \SpecialIndex{\@tabarray} % Another stuff for the compatibility with \textsf{array} is to |\let| a % control sequence |\@@array| be equal to |\@array| because it is referred % in |\@tabarray| in \textsf{array}. % \end{macro} % % \begin{macrocode} %% Initialization \let\adl@array\@array \def\@array{\adl@everyvbox\everyvbox \everyvbox{\adl@arrayinit \the\adl@everyvbox \everyvbox\adl@everyvbox}% \ifadl@inactive \adl@inactivate \else \adl@activate \fi \let\adl@noalign\noalign \adl@array} \let\@@array\@array % \end{macrocode} % % \begin{macro}{\adl@arrayinit} % \changes{v1.4-3-9}{1999/06/25} % {The bug of saving \cs{adl@colsR} is fixed.} % \changes{v1.5-1}{2000/07/12} % {Use new macro \cs{adl@arraysave} to save registers/structures.} % \begin{macro}{\adl@arraysave} % \changes{v1.5-1}{2000/07/12} % {Introduced to use in modified \cs{CC@} of \textsf{colortab}.} % \SpecialIndex{\adl@height} % \SpecialIndex{\adl@depth} % \SpecialIndex{\adl@currentcolumn} % \SpecialIndex{\adl@totalheight} % % As described in \S\ref{sec:imp-decl}, registers updated |\global|-ly, % which are |\adl@height|, |\adl@depth|, |\adl@currentcolumn| and % |\adl@totalheight|, are saved in |\adl@arrayinit| by calling % |\adl@arraysave|, and also given initial values. The macro also saves the % following data structures and initializes them to empty lists. % \end{macro} % % \begin{macro}{\adl@rowsL} % \begin{macro}{\adl@rowsR} % \begin{macro}{\adl@rowsLsave} % \begin{macro}{\adl@rowsRsave} % \begin{macro}{\adl@colsL} % \begin{macro}{\adl@colsR} % \begin{macro}{\adl@colsLsave} % \begin{macro}{\adl@colsRsave} % \begin{itemize} % \item % In the real implementation, the data structure $R$ is split into two % lists; % % \begin{eqnarray*} % \cs{adl@rowsL}&=&R^L=\langle\langle C^L_1,h_1\rangle,\ldots\rangle\\ % \cs{adl@rowsR}&=&R^R=\langle\langle C^R_1,h_1\rangle,\ldots\rangle % \end{eqnarray*} % % and they are saved into |\adl@rowsLsave| and |\adl@rowsRsave|. % % \item % When the $i\th$ row is building, $C^L_i$ and $C^R_i$ are constructed in % the macros |\adl@colsL| and |\adl@colsR|. They are saved % into |\adl@colsLsave| and |\adl@colsRsave|. % \end{itemize} % \end{macro}\end{macro}\end{macro}\end{macro} % \end{macro}\end{macro}\end{macro}\end{macro} % % \begin{macro}{\adl@connect} % \begin{macro}{\adl@discard} % \changes{v1.6-1}{2003/8/25} % {Add initializetion of \cs{adl@discard}.} % \SpecialIndex{\@elt} % \SpecialOptIndex{longtable}{environment} % % In the real implementation, $e^i_j$ is represented by a control sequence % |\@elt|, and ${\it connect}(i)$ by |\adl@connect|. They are made % |\let|-equal to |\relax| to keep them from expansion during $R$ is % constructed. In |longtable| environment, ${\it connect}(i)$ for negative % vertical space inserted by |\\[|\meta{h}|]| or a horizontal line has % another representation |\adl@discard| to indicate it corresponds to a % discardable item of page breaking. Since this representation, however, is % nonsense in usural |array|\slash|tabular| even if they are included in % |\longtable|, we define |\adl@discard| as |\adl@connect| so that it % transforms itself into |\adl@connect| when it is added to % |\adl@rowsL|\slash|R| by |\xdef|. Note that |\adl@discard| is made % |\let|-equal to |\relax| to inhibit the transformation at the beginning of % |longtable| environment. % \end{macro}\end{macro} % % \changes{v1.4-3-1}{1999/06/25} % {Modified for new column counting in preamble construction.} % % Then, we set to |\adl@columns| to the value of |\adl@ncol| {\em locally}. % As explained above, this has an effect with \textsf{array} because % |\adl@arrayinit| is called {\em after} the preamble is generated. Without % \textsf{array}, on the other hand, this assignment has no effect but safe % because it is included in a group of |\vbox| etc. % % \changes{v1.4-3-3}{1999/06/25} % {Modified to call \cs{adl@inactivate}.} % \changes{v1.5-3}{2003/07/11} % {Move \cs{adl@inactivate} from \cs{adl@arrayinit} to \cs{@array}.} % % \end{macro} % \SpecialIndex{\adl@height} % \SpecialIndex{\adl@depth} % \SpecialIndex{\adl@currentcolumn} % \SpecialIndex{\adl@totalheight} % \SpecialIndex{\adl@heightsave} % \SpecialIndex{\adl@depthsave} % \SpecialIndex{\adl@currentcolumnsave} % \SpecialIndex{\adl@totalheightsave} % % \begin{macrocode} \def\adl@arrayinit{% \adl@arraysave \global\adl@height\z@ \global\adl@depth\z@ \global\adl@currentcolumn\@ne \global\adl@totalheight\z@ \gdef\adl@rowsL{}\gdef\adl@rowsR{}\gdef\adl@colsL{}\gdef\adl@colsR{}% \let\@elt\relax \let\adl@connect\relax \def\adl@discard{\adl@connect}% \adl@columns\adl@ncol} \def\adl@arraysave{% \adl@heightsave\adl@height \adl@depthsave\adl@depth \adl@currentcolumnsave\adl@currentcolumn \adl@totalheightsave\adl@totalheight \let\adl@rowsLsave\adl@rowsL \let\adl@rowsRsave\adl@rowsR \let\adl@colsLsave\adl@colsL \let\adl@colsRsave\adl@colsR} % \end{macrocode} % % \begin{macro}{\adl@inactivate} % \changes{v1.4-3-3}{1999/06/25} % {Introduced to inactivate \cs{@arrayclassz} etc.} % \changes{v1.5-3}{2003/07/11} % {Change \cs{adl@inactivate} caller to \cs{@array}.} % \changes{v1.7-1}{2004/5/21} % {Remove \cs{cline} because our own version is needed for null-wide.} % If |\ADLinactivate| has effect and thus |\ifadl@inactive| is true, the % macro |\adl@inactivate| is called from |\@array|\footnote{ % % Before v1.53, \cs{adl@inactivate} was called from \cs{adl@arrayinit} and % thus invokded {\em after} the preamble of \textsf{array} is built. This % was incorrect of course and made inactive version of \texttt{p}, % \texttt{m} and \texttt{b} produce nothing.}. % % This |\let|-s the following control sequences be equal to their % counterparts in \LaTeX{} and/or \textsf{array} package. % % \changes{v1.54-2}{2003/08/25} % {Add \cs{adl@argcr} to inactivation.} % % \begin{itemize}\item[] % \SpecialIndex{\@arrayclassz} % \SpecialIndex{\@tabclassz} % \SpecialIndex{\@classz} % \SpecialIndex{\@@startpbox} % \SpecialIndex{\@@endpbox} % \SpecialIndex{\@endpbox} % \SpecialIndex{\adl@cr} % \SpecialIndex{\adl@argcr} % \SpecialIndex{\adl@endarray} % |\@arrayclassz|\quad % |\@tabclassz|\quad % |\@classz|\quad % |\@@startpbox|\quad % |\@@endpbox|\\ % |\@endpbox|\quad % |\adl@cr|\quad % |\adl@argcr|\quad % |\adl@endarray| % \end{itemize} % % Note that we have to inactivate both |\@@endpbox| for \LaTeX{} and % |\@endpbox| for \textsf{array}, while |\@startpbox| for \textsf{array} is % not necessary because it is unmodified. Also note that \break|\@classz| % has to % be |\let|-equal to |\adl@org@classz| only if \textsf{array} is in use, % because \LaTeX{} does not define |\@classz| but refers it which is either % |\@arrayclassz| or |\@tabclassz|. Yet another remark is that we have to % conceal |\cr| for |\adl@cr|\slash|\adl@argcr| and |\crcr| for % |\adl@endarray| by bracing them from \TeX's |\halign| mechanism that % searches them when an |array|\slash|tabular| has an nested % |array|\slash|tabular|. This could be done by a tricky |\let|-assignment % such as; % % \begin{quote} % |\iffalse{\let\adl@cr\cr \iffalse}\fi| % \end{quote} % % but we simply use |\def| instead of |\let| because of clarity. % % We also |\let| the following be {\it no-operation} or their inactive % versions. % % \begin{itemize}\item[] % \SpecialIndex{\adl@hline} % \SpecialIndex{\adl@ihdashline} % \SpecialIndex{\adl@cdline} % \SpecialIndex{\adl@@vlineL} % \SpecialIndex{\adl@@vlineR} % \SpecialIndex{\adl@vlineL} % \SpecialIndex{\adl@vlineR} % |\adl@hline|\quad % |\adl@ihdashline|\quad % |\adl@cdline|\quad % |\adl@@vlineL|\quad % |\adl@@vlineR|\\ % |\adl@vlineL|\quad % |\adl@vlineR| % \end{itemize} % Note that we have to inactivate both |\adl@@vlineL| and |\adl@vlineL|, % because the latter is referred when \textsf{array} is in use while the % former is referred otherwise. Their |R| relatives are also inactivated by % the same reason. % \end{macro} % % \SpecialIndex{\@arrayclassz} % \SpecialIndex{\@tabclassz} % \SpecialIndex{\@classz} % \SpecialIndex{\@@startpbox} % \SpecialIndex{\@@endpbox} % \SpecialIndex{\@endpbox} % \SpecialIndex{\adl@cr} % \SpecialIndex{\adl@argcr} % \SpecialIndex{\adl@endarray} % \SpecialIndex{\adl@hline} % \SpecialIndex{\adl@ihdashline} % \SpecialIndex{\adl@cdline} % \SpecialIndex{\adl@@vlineL} % \SpecialIndex{\adl@@vlineR} % \SpecialIndex{\adl@vlineL} % \SpecialIndex{\adl@vlineR} % \SpecialIndex{\adl@org@arrayclassz} % \SpecialIndex{\adl@org@tabclassz} % \SpecialIndex{\adl@org@classz} % \SpecialIndex{\adl@org@@startpbox} % \SpecialIndex{\adl@org@@endpbox} % \SpecialIndex{\adl@org@endpbox} % \SpecialIndex{\adl@cr} % \SpecialIndex{\adl@argcr} % \SpecialIndex{\adl@org@cline} % \SpecialIndex{\adl@inactivehdl} % \SpecialIndex{\adl@inactivecdl} % \SpecialIndex{\adl@inactivevl} % \begin{macrocode} \def\adl@inactivate{% \let\@arrayclassz\adl@org@arrayclassz \let\@tabclassz\adl@org@tabclassz \ifadl@usingarypkg \let\@classz\adl@org@classz \fi \let\@@startpbox\adl@org@@startpbox \let\@@endpbox\adl@org@@endpbox \let\@endpbox\adl@org@endpbox \def\adl@cr{\cr}% \def\adl@argcr##1{\cr}% \def\adl@endarray{\crcr}% \let\adl@hline\@gobbletwo \let\adl@ihdashline\adl@inactivehdl \let\adl@cdline\adl@inactivecdl \let\adl@@vlineL\adl@inactivevl \let\adl@@vlineR\adl@inactivevl \let\adl@vlineL\adl@inactivevl \let\adl@vlineR\adl@inactivevl} % \end{macrocode} % % \begin{macro}{\adl@activate} % \changes{v1.54-2}{2003/08/25} % {Introduced to activate \cs{@arrayclassz} etc.\ again.} % % On the other hand, if |\ifadl@inactive| is false, the macro |\adl@activate| % is called from |\@array| to make inactivated macros active again in order % to cope with the case in which an inactive \textsf{array}\slash % \textsf{tabular} has active children in it\footnote{ % % Before v1.54, an active \textsf{array}\slash\textsf{tabular} in an % inactive parent was not activated.}. % % To do that, |\adl@activate| makes |\@arrayclassz| etc.\ |\let|-equal to % their active version |\adl@act@arrayclassz| etc.\ which will be defined % (|\let|-equal to) as our own |\@arrayclassz| etc.\ in \S\ref{sec:imp-sh}. % \end{macro} % % \SpecialIndex{\@arrayclassz} % \SpecialIndex{\@tabclassz} % \SpecialIndex{\@classz} % \SpecialIndex{\@@startpbox} % \SpecialIndex{\@@endpbox} % \SpecialIndex{\@endpbox} % \SpecialIndex{\adl@cr} % \SpecialIndex{\adl@argcr} % \SpecialIndex{\adl@endarray} % \SpecialIndex{\adl@hline} % \SpecialIndex{\adl@ihdashline} % \SpecialIndex{\adl@cdline} % \SpecialIndex{\adl@@vlineL} % \SpecialIndex{\adl@@vlineR} % \SpecialIndex{\adl@vlineL} % \SpecialIndex{\adl@vlineR} % \SpecialIndex{\adl@act@arrayclassz} % \SpecialIndex{\adl@act@tabclassz} % \SpecialIndex{\adl@act@classz} % \SpecialIndex{\adl@act@@startpbox} % \SpecialIndex{\adl@act@@endpbox} % \SpecialIndex{\adl@act@endpbox} % \SpecialIndex{\adl@act@cr} % \SpecialIndex{\adl@act@argcr} % \SpecialIndex{\adl@act@cline} % \SpecialIndex{\adl@act@endarray} % \SpecialIndex{\adl@act@hline} % \SpecialIndex{\adl@act@ihdashline} % \SpecialIndex{\adl@act@cdline} % \SpecialIndex{\adl@act@@vlineL} % \SpecialIndex{\adl@act@@vlineR} % \begin{macrocode} \def\adl@activate{% \let\@arrayclassz\adl@act@arrayclassz \let\@tabclassz\adl@act@tabclassz \ifadl@usingarypkg \let\@classz\adl@act@classz \fi \let\@@startpbox\adl@act@@startpbox \let\@@endpbox\adl@act@@endpbox \let\@endpbox\adl@act@endpbox \let\adl@cr\adl@act@cr \let\adl@argcr\adl@act@argcr \let\adl@endarray\adl@act@endarray \let\adl@hline\adl@act@hline \let\adl@ihdashline\adl@act@ihdashline \let\adl@cdline\adl@act@cdline \let\adl@@vlineL\adl@act@@vlineL \let\adl@@vlineR\adl@act@@vlineR \let\adl@vlineL\adl@act@@vlineL \let\adl@vlineR\adl@act@@vlineR} %%^L % \end{macrocode} % % \changes{v1.6-1}{2003/8/25} % {Add a summary of activation/inactivation.} % The summary of the activation and inactivation is shown in % Table~\ref{tab:act}. % % % % \begin{table} % \catcode`\|12 % \caption{Active and Inactive Operations}\label{tab:act} % \def\!{\texttt{\char`\\\char`\\}} % \centerline{\begin{tabular}[t]{|l||l|l|}\hline % command&active&inactive\\\hline\hline % \tt l c r&&\\ % \qquad with \textsf{array}& \cs{adl@act@classz}& % \cs{adl@org@classz}\\ % \qquad without \textsf{array}&\cs{adl@act@tabclassz}& % \cs{adl@org@tabclassz}\\ % & \cs{adl@act@arrayclassz}& % \cs{adl@org@arrayclassz}\\\hline % {\tt p m b} (open)&&\\ % \qquad with \textsf{array}& \cs{adl@act@classz}& % \cs{adl@org@classz}\\ % \qquad without \textsf{array}&\cs{adl@act@@startpbox}& % \cs{adl@org@@startpbox}\\\hline % {\tt p m b} (close)& \cs{adl@act@@endpbox}& % \cs{adl@org@@endpbox}\\\hline % \tt \char`\|/:/;& \cs{adl@act@@vlineL/R}& % \cs{adl@inactivevl}\\\hline % \!& $\to$\cs{adl@act@(arg)cr}& % $\to$\cs{cr}\\\hline % \cs{hline}& $\to$\cs{adl@act@hline}& % $\to$\cs{@gobbletwo}\\\hline % \cs{hdashline}& $\to$\cs{adl@act@ihdashline}& % $\to$\cs{adl@inactivehdl}\\\hline % \cs{cdashline}& $\to$\cs{adl@act@cdline}& % $\to$\cs{adl@inactivecdl}\\\hline % \end{tabular}} % \end{table} % % % % \subsection{Making Preamble} % \label{sec:imp-pream} % % Each preamble character is converted to a part of |\halign|'s preamble as % follows. % % \begin{itemize} % \item % \begin{macro}{\adl@colhtdp} % \changes{v1.5-2}{2002/06/26} % {The pseudo-formal description of $\langle\hbox{\it put-lrc}\rangle$ % is modified.} % \SpecialIndex{\adl@box} % \SpecialIndex{\adl@height} % \SpecialIndex{\adl@depth} % `|l|', `|r|' and `|c|' are converted to the following \meta{lrc}. % % \begingroup \catcode`\|12 % \begin{eqnarray*} % \meta{lrc}&::=& % [\cs{hfil}]\meta{put-lrc}[\cs{hfil}]\\ % \meta{put-lrc}&::=& % \cs{setbox}\cs{adl@box}\cs{hbox}\Meta{lrc-contents}\\ % && \cs{adl@colhtdp }\cs{unhbox}\cs{adl@box}\\ % \meta{lrc-contents}&::=& % \hbox{\texttt{\$\cs{relax}\#\$}}\ |\\ % && \hbox{\texttt{\#\cs{unskip}}}\\ % \end{eqnarray*} % \endgroup % % That is, the content of a column is at first packed into the |\box| % register |\adl@box|, then its height and depth are compared to % |\adl@height| and |\adl@depth| by the macro |\adl@colhtdp|, and finally % the box is put with leading and/or trailing |\hfil|. % \end{macro} % % \item % \begin{macro}{\adl@vlineL} % \begin{macro}{\adl@vlineR} % \def\G{{\mit\Gamma}} % `\verb!|!', `|:|' and |;{|\meta{dash}|/|\meta{gap}|}| are converted to the % following \meta{vline}. % % \begingroup \catcode`\|12 % \begin{eqnarray*} % \meta{vline}&::=& % [\cs{hskip}\cs{doublerulesep}]\meta{vline-LR}\\ % \meta{vline-LR}&::=& % \cs{adl@vlineL}\Meta{$\G_d$}\Meta{$\G_g$}Meta{c} % \hbox{{\tt\char`\{}\meta{d}/\meta{g}{\tt\char`\}}}\ |\\ % && \cs{adl@vlineR}\Meta{$\G_d$}\Meta{$\G_g$}Meta{c} % \hbox{{\tt\char`\{}\meta{d}/\meta{g}{\tt\char`\}}}\\ % \meta{d}&::=& % 0\ |&\hbox to.3\textwidth{\ldots\ for `\texttt{|}'\hfil}\cr % && \cs{dashlinedash}\ |& % \hbox to.3\textwidth{\ldots\ for `\texttt{:}'\hfil}\cr % && \meta{dash}& % \hbox to.3\textwidth{\ldots\ for `\texttt{;}'\hfil}\cr % \meta{g}&::=& % 0\ |&\hbox to.3\textwidth{\ldots\ for `\texttt{|}'\hfil}\cr % && \cs{dashlinegap}\ |& % \hbox to.3\textwidth{\ldots\ for `\texttt{:}'\hfil}\cr % && \meta{gap}& % \hbox to.3\textwidth{\ldots\ for `\texttt{;}'\hfil}\cr % \end{eqnarray*} % \endgroup % % \SpecialIndex{\CT@arc@} % \SpecialIndex{\adl@dashgapcolor} % Note that \meta{c} is the column number (leftmost is 1) where the % character appears, and \meta{$\G_d$} and \meta{$\G_g$} is the % color of dashs and gaps specified in |\CT@arc@| and |\adl@dashgapcolor|. % \end{macro}\end{macro} % \end{itemize} % % \SpecialIndex{\adl@currentcolumn} % Additionally, each column except for the last one has; % % \begin{quote} % |\global\advance\adl@currentcolumn\@ne| % \end{quote} % % just before |&| to increment |\adl@currentcolumn|. Other features, such % as inserting spaces of |\arraycolsep|\slash|\tabcolsep|, are as same as % original scheme. This means that |@|\Meta{text} and |!|\Meta{text} of % \textsf{array} are {\em not} handled specially although it could interfere % with drawing vertical lines. Therefore, we have the problem 1 shown in % \S\ref{sec:prob}, which is very hard to solve. Note that the measurement % of the column of `|p|' of \LaTeX{} original is done by (modified) % |\@@startpbox| and |\@@endpbox| and thus the preamble for `|p|' is not % modified. In case with \textsf{array}, however, the preambles for `|p|' % and its relatives `|m|' and `|b|' are modified to set |\adl@box| to the % box for them. % % \begin{macro}{\adl@mkpream} % \begin{macro}{\@mkpream} % \changes{v1.4-3-1}{1999/06/25} % {Modified for new column counting and control sequence redefinition.} % \changes{v1.71-1}{2004/08/31} % {Modified to nullify \cs{adl@startmbox} and \cs{adl@endmbox} for % \textsf{array's} \texttt{m}-columns.} % \SpecialIndex{\adl@colhtdp} % \SpecialIndex{\adl@vlineL} % \SpecialIndex{\adl@vlineR} % \SpecialIndex{\adl@startmbox} % \SpecialIndex{\adl@endmbox} % \SpecialIndex{\adl@preaminit} % \SpecialIndex{\afterassignment} % % To make the preamble shown above, |\@mkpream| is modified to |\let| % control sequences |\adl@colhtpd|, |\adl@vlineL| and |\adl@vlineR| be % |\relax| in order to keep them from being expanded by |\edef|\slash % |\xdef| for the preamble construction. The control sequences % |\adl@startmbox| and |\adl@endmbox| for \texttt{m}-columns of % \textsf{array} are also made |\let|-equal to |\relax|. % % Giving them their own definition is done by |\adl@preaminit| that is % called using |\afterassignment| after |\@preamble| is made by % |\adl@mkpream|, the original version of |\@mkpream|. If \textsf{array} is % not in use, |\@mkpream| is followed by an |\edef| of |\@preamble| to add % |\ialign| etc.\ and thus |\adl@preaminit| is properly called {\em after} % this final {\em assignment} to make |\@preamble|. % % With \textsf{array}, on the other hand, calling |\adl@preaminit| is safe % because |\@mkpream| is followed by |\xdef| for |\@preamble| too, but has % no effect because it is in the group for |\@mkpream|. This grouping, % however, gives us an easier way to give those control sequences their own % definition. That is, we simply initiate them with the definitions that % will be regained when the group is closed. % % \SpecialIndex{\adl@ncol} % \SpecialIndex{\adl@columns} % \SpecialIndex{\ifadl@leftrule} % The modified |\@mkpream| also initializes |\adl@ncol| and % |\ifadl@leftrule|, and set |\adl@columns| to the value of |\adl@ncol| % locally after the preamble is made. This has an effect in case without % \textsf{array} because the body of |array|\slash|tabular| is in the same % grouping context of |\@mkpream|. With \textsf{array}, on the other hand, % this assignment has no effect but safe because it is included in a group % of |\@mkpream|'s own. % \end{macro}\end{macro} % % \begin{macrocode} %% Making Preamble \let\adl@mkpream\@mkpream \def\@mkpream#1{\let\adl@colhtdp\relax \let\adl@vlineL\relax \let\adl@vlineR\relax \let\adl@startmbox\relax \let\adl@endmbox\relax \global\adl@ncol\@ne \adl@leftruletrue \adl@mkpream{#1}\adl@columns\adl@ncol \afterassignment\adl@preaminit} % \end{macrocode} % % \begin{macro}{\@addamp} % \changes{v1.4-3-1}{1999/06/25} % {Modified for new column counting in preamble construction.} % \SpecialIndex{\adl@currentcolumn} % \SpecialIndex{\adl@ncol} % % The macro |\@addamp| is also modified to add the code for incrementing the % counter |\adl@currentcolumn| to |\@preamble| with |&|. The counter % |\adl@ncol| is also incremented by |\@addamp| so that we can refer its % value as \meta{c} of |\adl@vlineL|\slash|R|\@. This increment is done % |\global|-ly in order that we locally set |\adl@columns| to the counting % result outside of the group for |\@mkpream| of \textsf{array}. Therefore, % whether or not \textsf{array} is in use, |\adl@columns| will have a % correct value and will be correctly referred by |\hdashline| to know how % many columns are specified in the preamble. Note that this |\global| % assignment is safe because the life time of |\adl@ncol| is same as that of % |\@preamble|. % \end{macro} % % \begin{macrocode} \def\@addamp{\if@firstamp\@firstampfalse \else \@addtopreamble{\global\advance\adl@currentcolumn\@ne &}% \global\advance\adl@ncol\@ne \fi} % \end{macrocode} % % \SpecialIndex{\ifadl@usingarypkg} % Since the implementation of |\@testpach| and macros for class-0 characters % (i.e. |l|, |r| and |c|) is completely different between \LaTeX{} and % \textsf{array}, we have to have two versions switched by % |\adl@usingarypkg|. % % \subsubsection*{With \textsf{array}} % % \begin{macro}{\@testpach} % \changes{v1.4-3-1}{1999/06/25} % {The version for \textsf{array} is introduced.} % \SpecialIndex{\@arrayrule} % \SpecialIndex{\adl@arrayrule} % \SpecialIndex{\adl@arraydashrule} % \SpecialIndex{\adl@argarraydashrule} % % Although we introduced two preamble characters `|:|' and `|;|', we did not % introduce new character {\em class} because we want to minimize the % modification of original codes. Therefore, `|:|' and `|;|' is classified % into class-1 together with `\verb!|!'\@. Since these characters obviously % have their own appropriate operations, |\@testpach| is modified so that % |\@arrayrule|, which is invoked from |\@mkpream| in the case of class-1 % character, is |\let|-equal to the macro corresponding to each character. % \end{macro} % % \begin{macrocode} \ifadl@usingarypkg \def\@testpach{\@chclass \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else \ifnum \@lastchclass=7 5 \else \ifnum \@lastchclass=8 \tw@ \else \ifnum \@lastchclass=9 \thr@@ \else \z@ \ifnum \@lastchclass = 10 \else \edef\@nextchar{\expandafter\string\@nextchar}% \@chnum \if \@nextchar c\z@ \else \if \@nextchar l\@ne \else \if \@nextchar r\tw@ \else \z@ \@chclass \if\@nextchar |\@ne \let\@arrayrule\adl@arrayrule \else \if\@nextchar :\@ne \let\@arrayrule\adl@arraydashrule \else \if\@nextchar ;\@ne \let\@arrayrule\adl@argarraydashrule \else \if \@nextchar !6 \else \if \@nextchar @7 \else \if \@nextchar <8 \else \if \@nextchar >9 \else 10 \@chnum \if \@nextchar m\thr@@\else \if \@nextchar p4 \else \if \@nextchar b5 \else \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi} % \end{macrocode} % % \begin{macro}{\@classz} % \changes{v1.4-3-1}{1999/06/25} % {Introduced because \textsf{array} uses it.} % \changes{v1.71-1}{2004/08/31} % {Modified to call \cs{adl@startmbox} and \cs{adl@endmbox} for % \textsf{array}'s \texttt{m}-columns.} % \SpecialIndex{\adl@putlrc} % \SpecialIndex{\adl@box} % \SpecialIndex{\adl@startmbox} % \SpecialIndex{\adl@endmbox} % % In \textsf{array}, |array| and |tabular| share common macro for class-0 % named |\@classz|, which also generates the preamble for `|p|', `|m|' and % `|b|'. Thus we modify it to measure the height and depth of the % class-0 column by the macro |\adl@putlrc|, and to set |\adl@box| to the % box for `|p|' and its relatives. Note that |m|-type preambles % (|@chnum|${}=3$) have to be generated by |\adl@startmbox| and % |\adl@endmbox| because a |\vcenter| construct cannot be assigned by % to |\adl@box| by |\setbox| directly. % \end{macro} % % \begin{macrocode} \def\@classz{\@classx \@tempcnta \count@ \prepnext@tok \@addtopreamble{\ifcase \@chnum \hfil \adl@putlrc{\d@llarbegin \insert@column \d@llarend}\hfil \or \hskip1sp\adl@putlrc{\d@llarbegin \insert@column \d@llarend}\hfil \or \hfil\hskip1sp\adl@putlrc{\d@llarbegin \insert@column \d@llarend}\or \setbox\adl@box\hbox \adl@startmbox{\@nextchar}\insert@column \adl@endmbox\or \setbox\adl@box\vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or \setbox\adl@box\vbox \@startpbox{\@nextchar}\insert@column \@endpbox \fi}\prepnext@tok} % \end{macrocode} % % \begin{macro}{\adl@class@start} % \changes{v1.4-3-1}{1999/06/25} % {Introduced for class number identification.} % \begin{macro}{\adl@class@iiiorvii} % \changes{v1.4-3-1}{1999/06/25} % {Introduced for class number identification.} % % Another stuffs for compatibility are to refer the class number of the % beginning of preamble which is different between \LaTeX{} and % \textsf{array}, and that of `|p|' or `|@|' to get the argument of `|;|' as % explained later. In case with \textsf{array}, the former is class-4 % and we use `|@|' (class-7) for the latter. % \end{macro}\end{macro} % % \begin{macrocode} \def\adl@class@start{4} \def\adl@class@iiiorvii{7} % \end{macrocode} % % \subsubsection*{Without \textsf{array}} % % \begin{macro}{\@testpach} % \SpecialIndex{\@arrayrule} % \SpecialIndex{\adl@arrayrule} % \SpecialIndex{\adl@arraydashrule} % \SpecialIndex{\adl@argarraydashrule} % % The reason why and how we modify |\@testpach| of \LaTeX{} is same as those % of \textsf{array}. % \end{macro} % % \begin{macrocode} \else \def\@testpach#1{\@chclass \ifnum \@lastchclass=\tw@ 4\relax \else \ifnum \@lastchclass=\thr@@ 5\relax \else \z@ \if #1c\@chnum \z@ \else \if #1l\@chnum \@ne \else \if #1r\@chnum \tw@ \else \@chclass \if #1|\@ne \let\@arrayrule\adl@arrayrule \else \if #1:\@ne \let\@arrayrule\adl@arraydashrule \else \if #1;\@ne \let\@arrayrule\adl@argarraydashrule \else \if #1@\tw@ \else \if #1p\thr@@ \else \z@ \@preamerr 0\fi \fi \fi \fi \fi \fi \fi \fi \fi \fi} % \end{macrocode} % % \begin{macro}{\@arrayclassz} % \begin{macro}{\@tabclassz} % \SpecialIndex{\adl@putlrc} % % Since \LaTeX{} has two macros for class-0, one for |array| and the other % for |tabular|, we have to modify both. Since the box for `|p|' is opened % by |\@@startpbox|, however, we may not worry about it. % \end{macro}\end{macro} % % \begin{macrocode} \def\@arrayclassz{\ifcase \@lastchclass \@acolampacol \or \@ampacol \or \or \or \@addamp \or \@acolampacol \or \@firstampfalse \@acol \fi \edef\@preamble{\@preamble \ifcase \@chnum \hfil\adl@putlrc{$\relax\@sharp$}\hfil \or \adl@putlrc{$\relax\@sharp$}\hfil \or \hfil\adl@putlrc{$\relax\@sharp$}\fi}} \def\@tabclassz{\ifcase \@lastchclass \@acolampacol \or \@ampacol \or \or \or \@addamp \or \@acolampacol \or \@firstampfalse \@acol \fi \edef\@preamble{\@preamble \ifcase \@chnum \hfil\adl@putlrc{\@sharp\unskip}\hfil \or \adl@putlrc{\@sharp\unskip}\hfil \or \hfil\hskip\z@ \adl@putlrc{\@sharp\unskip}\fi}} % \end{macrocode} % % \begin{macro}{\adl@class@start} % \changes{v1.4-3-1}{1999/06/25} % {Introduced for class number identification.} % \begin{macro}{\adl@class@iiiorvii} % \changes{v1.4-3-1}{1999/06/25} % {Introduced for class number identification.} % In \LaTeX{}, the beginning of preamble is class-6 and we use `|p|' % (class-3) to get the argument of `|;|'. % \end{macro}\end{macro} % % \begin{macrocode} \def\adl@class@start{6} \def\adl@class@iiiorvii{3} \fi % \end{macrocode} % % Hereafter, codes for \LaTeX{} and \textsf{array} are common again. % % \begin{macro}{\adl@putlrc} % \changes{v1.5-2}{2002/06/26} % {\cs{adl@putlrc} must do \cs{unhbox}\cs{adl@box} to make glues % effective.} % \SpecialIndex{\adl@box} % \SpecialIndex{\adl@colhtdp} % % The macro |\adl@putlrc| is for class-0 preamble characters to set % |\adl@box| to the contents of a column, measure its height\slash depth by % |\adl@colhtdp| and put the box by |\unhbox| (not by |\box|) in order to % make the glues in the contents effective. % \end{macro} % % \begin{macrocode} \def\adl@putlrc#1{\setbox\adl@box\hbox{#1}\adl@colhtdp \unhbox\adl@box} % \end{macrocode} % % \begin{macro}{\adl@arrayrule} % \changes{v1.4-3-1}{1999/06/25} % {Modified to replace \cs{adl@columns} with \cs{adl@ncol}.} % \begin{macro}{\adl@arraydashrule} % \changes{v1.4-3-1}{1999/06/25} % {Modified to replace \cs{adl@columns} with \cs{adl@ncol}.} % \begin{macro}{\adl@argarraydashrule} % \changes{v1.4-3-1}{1999/06/25} % {Modified to replace \cs{adl@columns} with \cs{adl@ncol}.} % \changes{v1.4-3-1}{1999/06/25} % {Modified to pretend \texttt{p} or \texttt{@} depending on if % \textsf{array} is in use.} % \begin{macro}{\adl@xarraydashrule} % \changes{v1.4-3-1}{1999/06/25} % {Modified to refer \cs{adl@class@start} rather than \LaTeX's 6.} % \changes{v1.4-3-2}{1999/06/25} % {Modified to add invisible rule of \cs{arrayrulewidth} wide if % \cs{ADLsome}\penalty\exhyphenpenalty\texttt{wide}.} % \changes{v1.7-3}{2004/5/21} % {Modified to add color arguments to \cs{adl@vline}\texttt{L}\slash % \texttt{R}} % \SpecialIndex{\@lastchclass} % \SpecialIndex{\adl@class@start} % \SpecialIndex{\ifadl@leftrule} % \SpecialIndex{\adl@vlineL} % \SpecialIndex{\adl@vlineR} % \SpecialIndex{\adl@ncol} % \SpecialIndex{\CT@arc@} % \SpecialIndex{\adl@dashgapcolor} % \SpecialIndex{\color} % \def\G{{\mit\Gamma}} % % The preamble parts for vertical solid- and dash-lines are constructed by % the macros |\adl@arrayrule| for `\verb!|!', |\adl@arraydashrule| for % `|:|', and |\adl@argarraydashrule| for `|;|'.\@ The macro; % % \begin{quote} % |\adl@xarraydashrule|\Meta{$c^L$}\Meta{$c^R$}|{|\meta{d}|/|\meta{g}|}| % \end{quote} % % is invoked by them to perform common operations. It at first checks the % preamble character is the first element of the preamble % (|\@lastchclass|${}=|\adl@class@start|$) or it follows another character % for vertical line (|\@lastchclass|${}=1$). If this is not satisfied, the % vertical line is put at the right edge of a column and thus % |\ifadl@leftrule| is set to false. Then it adds % |\adl@vlineL|\Meta{$\G_d$}\Meta{$\G_g$} % \Meta{$c^L$}|{|\meta{d}|/|\meta{g}|}| if |\ifadl@leftrule| is % true indicating the vertical line will appear at the left edge of the % column \meta{$c^L$}, or |\adl@vlineR|\Meta{$\G_d$}\Meta{$\G_g$} % \Meta{$c^R$}|{|\meta{d}|/|\meta{g}|}| otherwise. Note that \meta{$c^L$} % is always 1 for {\em main} preamble while \meta{$c^R$} is the column % number given by |\adl@ncol|, but \meta{$c^L$} may not be 1 for the % preamble of |\multicolumn| as described in \S\ref{sec:imp-mc}. Also note % that $\G_d$ and $\G_g$ are |\CT@arc@| and |\adl@dashgapcolor| % respectively whose bodies are |\color| for dashes and gaps specified by % |\arrayrulecolor| and |\dashgapcolor|, or |\relax| if they are not colored. % % In addition, an invisible |\vrule| of |\arrayrulewidth| wide is added if % both |\ADL#some#wide| and |\ADLactivate| are in effect, i.e.\ both % |\ifadl@zwrule| and |\ifadl@inactive| are false, to keep a space for % the vertical line having {\em real} width. % \end{macro}\end{macro}\end{macro}\end{macro} % % \begin{macro}{\adl@classv} % \begin{macro}{\adl@classvfordash} % \SpecialIndex{\@nextchar} % \SpecialIndex{\@chclass} % \SpecialIndex{\@classv} % \SpecialIndex{\adl@class@iiiorvii} % % The argument of `|;|' is not provided by |\adl@argarraydashrule| but is % directly passed from the preamble text through |\@nextchar|. This direct % passing is implemented by the following trick. The macro % |\adl@argarraydashrule| set |\@chclass| to |\adl@class@iiiorvii| to % pretend it is for `|p|' if \textsf{array} is not in use, or `|@|' % otherwise. Then it temporally changes the definition of |\@classv|, which % is incidentally for the argument of `|p|' and `|@|' in case without/with % \textsf{array} respectively, to |\adl@classvfordash| to process the % argument of `|;|' rather than that of `|p|' or `|@|'\@. Then % |\adl@classvfordash| is invoked by |\@mkpream| and it adds the argument to % |\@preamble|. Finally, it restores the definition of |\@classv| and set % |\@chclass| to 1 to indicate that the last item is a vertical line % specification. % \end{macro}\end{macro} % % \begin{macrocode} \def\adl@arrayrule{% \adl@xarraydashrule {\@ne}{\adl@ncol}{{\z@/\z@}}} \def\adl@arraydashrule{% \adl@xarraydashrule {\@ne}{\adl@ncol}% {{\dashlinedash/\dashlinegap}}} \def\adl@argarraydashrule{% \adl@xarraydashrule {\@ne}{\adl@ncol}{}% \@chclass\adl@class@iiiorvii \let\@classv\adl@classvfordash} \def\adl@xarraydashrule#1#2#3{% \ifnum\@lastchclass=\adl@class@start\else \ifnum\@lastchclass=\@ne\else \adl@leftrulefalse \fi\fi \ifadl@zwvrule\else \ifadl@inactive\else \@addtopreamble{\vrule\@width\arrayrulewidth \@height\z@ \@depth\z@}\fi \fi \ifadl@leftrule \@addtopreamble{\adl@vlineL{\CT@arc@}{\adl@dashgapcolor}% {\number#1}#3}% \else \@addtopreamble{\adl@vlineR{\CT@arc@}{\adl@dashgapcolor}% {\number#2}#3}\fi} \let\adl@classv\@classv \def\adl@classvfordash{\@addtopreamble{{\@nextchar}}\let\@classv\adl@classv \@chclass\@ne} %%^L % \end{macrocode} % % % \subsection{Building Columns} % \label{sec:imp-col} % % \begin{macro}{\adl@preaminit} % \begin{macro}{\adl@colhtdp} % \begin{macro}{\adl@vlineL} % \begin{macro}{\adl@vlineR} % % If \textsf{array} is not in use, after the |\@preamble| is completed, the % control sequences for macros in it should regain their own definition. % The macro |\adl@preaminit| performs this operation for macros we % introduced, |\adl@colhtdp|, |\adl@vlineL| and |\adl@vlineR|. For the case % with \textsf{array}, we will call |\adl@preaminit| in \textsf{arydshln} to % initiate them with the definitions as described later. % \end{macro}\end{macro}\end{macro}\end{macro} % % \begin{macrocode} %% Building Columns \def\adl@preaminit{\let\adl@colhtdp\adl@@colhtdp \let\adl@vlineL\adl@@vlineL \let\adl@vlineR\adl@@vlineR} % \end{macrocode} % % \begin{macro}{\adl@@colhtdp} % For the measurement of the height and depth of a row, |\adl@@colhtdp| % compares |\adl@height| and |\adl@depth| to the height and depth of % |\adl@box| which contains the main part of the column to be built, and % |\global|-ly updates the registers if they are less. % \end{macro} % % \begin{macrocode} \def\adl@@colhtdp{% \ifdim\adl@height<\ht\adl@box \global\adl@height\ht\adl@box \fi \ifdim\adl@depth<\dp\adl@box \global\adl@depth\dp\adl@box\fi} % \end{macrocode} % % \begin{macro}{\adl@@vlineL} % \changes{v1.7-3}{2004/5/21} % {Color arguments are added.} % \begin{macro}{\adl@@vlineR} % \changes{v1.7-3}{2004/5/21} % {Color arguments are added.} % \begin{macro}{\adl@@ivline} % \changes{v1.7-3}{2004/5/21} % {Invocations of \cs{adl@setcolor} are added.} % \begin{macro}{\adl@setcolor} % \changes{v1.7-3}{2004/5/21} % {Introduced to color vertical lines.} % \begin{macro}{\adl@nocolor} % \changes{v1.7-3}{2004/5/21} % {Introduced to examine if coloring is specified.} % \begin{macro}{\adl@dashcolor} % \changes{v1.7-3}{2004/5/21} % {Introduced as the temporary variable of color specification of % dashes.} % \begin{macro}{\adl@gapcolor} % \changes{v1.7-3}{2004/5/21} % {Introduced as the temporary variable of color specification of % gaps.} % \SpecialIndex{\color} % \SpecialIndex{\current@color} % \def\G{{\mit\Gamma}} \let\g\gamma % The macro % |\adl@@vlineL|\meta{$\G_d$}\meta{$\G_g$}\meta{c}|{|\meta{d}|/|\meta{g}|}| % adds the element % $e=\langle c,d,g\rangle={}$ % |\@elt|\Meta{c}\Meta{d}\Meta{g}\Meta{$\g_d$}\Meta{$\g_g$} to the tail of % the list |\adl@colsL| to construct $C^L_i$, where $\g_d$ and $\g_g$ are % the color specifications given by |\color| macros in $\G_d$ and $\G_g$. % The macro |\add@@vlineR| performs similar operation but the element is % added to the head of |\adl@colsR| for $C^R_i$ because it is processed % right-to-left manner. The argument \meta{d} and \meta{g} are extracted by % the macro |\adl@ivline| which converts given dimensional values of them to % integers. It also set \meta{d} and \meta{g} to 0 (i.e. solid-line) if one % of given values are not positive, in order to make it sure that one dash % segment has positive length. Then it invokes |\adl@setcolor| to define % |\adl@dashcolor| and |\adl@gapcolor| with the color specification of % $\G_d$ and $\G_g$. Since |\adl@setcolor| locally expands |\color| macro % in $\G_d$ and $\G_g$ to define |\currnet@color| that becomes the body of % |\adl@dashcolor| ($\g_d$) and |\adl@gapcolor| ($\g_g$) with expansion, % different |\color| specifications of a color, such as |\color{red}| % and |\color[rgb]{1,0,0}|, will produce a unified result such as % |{rgb 1 0 0}|. If $\G_d$ or $\G_g$ is |\relax| which is the body of % |\adl@nocolor|, $\g_d$ or $\g_g$ is also |\relax| to indicate dashes are % colored (or not colored) as done in outer world and gaps are transparent. % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro} % % \begin{macrocode} \def\adl@@vlineL#1#2#3#4{\adl@ivline#4\@nil{#1}{#2}% \xdef\adl@colsL{\adl@colsL \@elt{#3}{\number\@tempcnta}{\number\@tempcntb}% {\adl@dashcolor}{\adl@gapcolor}}} \def\adl@@vlineR#1#2#3#4{\adl@ivline#4\@nil{#1}{#2}% \xdef\adl@colsR{% \@elt{#3}{\number\@tempcnta}{\number\@tempcntb}% {\adl@dashcolor}{\adl@gapcolor}% \adl@colsR}} \def\adl@ivline#1/#2\@nil#3#4{% \@tempdima#1\relax \@tempcnta\@tempdima \@tempdima#2\relax \@tempcntb\@tempdima \ifnum\@tempcnta>\z@ \else \@tempcnta\z@ \@tempcntb\z@ \fi \ifnum\@tempcntb>\z@ \else \@tempcnta\z@ \@tempcntb\z@ \fi \adl@setcolor\adl@dashcolor{#3}\adl@setcolor\adl@gapcolor{#4}} \def\adl@setcolor#1#2{\def\@tempa{#2}\ifx\@tempa\adl@nocolor \def#1{\relax}% \else{#2\xdef#1{\current@color}}\fi} \def\adl@nocolor{\relax} % \end{macrocode} % % \begin{macro}{\adl@colhtdp} % \changes{v1.4-3-1}{1999/06/25} % {Initialized by calling \cs{adl@preaminit}.} % \begin{macro}{\adl@vlineL} % \changes{v1.4-3-1}{1999/06/25} % {Initialized by calling \cs{adl@preaminit}.} % \begin{macro}{\adl@vlineR} % \changes{v1.4-3-1}{1999/06/25} % {Initialized by calling \cs{adl@preaminit}.} % \SpecialIndex{\adl@preaminit} % % After |\adl@@colhtdp|, |\adl@@vlineL| and |\adl@@vlineR| are defined, % we call |\adl@preaminit| to |\let| their single |@| counterparts be equal % to them. Therefore, in case with \textsf{array}, |\adl@colhtdp| etc.\ are % temporarily |\relax| when |\@preamble| is being generated in the group of % |\@mkpream|, and regain their own definition outside the group where % the completed |\@preamble| is referred. % \end{macro}\end{macro}\end{macro} % % \begin{macrocode} \adl@preaminit % \end{macrocode} % % \begin{macro}{\adl@inactivevl} % \changes{v1.4-3-3}{1999/06/25} % {Introduced to emulate `\texttt{:}' and \texttt{;} by % \protect\VERTBAR.} % \changes{v1.7-3}{2004/5/21} % {Modified to color the \cs{vline} by the first argument.} % \SpecialIndex{\ifadl@zwvrule} % % If |\ADLinactivate| is in effect, |\adl@vlineL|\slash|R| and % |\adl@@vlineL|\slash|R| are |\let|-equal % to |\adl@inactivevl|. This macro simply put a |\vrule| by |\vline| with % |\color| (or |\relax|) in its first argument and % with\slash without negative |\hskip| of a half of |\arrayrulewidth| wide % depending on |\ifadl@zwvrule|, discarding other arguments. % \end{macro} % % \begin{macrocode} \def\adl@inactivevl#1#2#3#4{\ifadl@zwvrule \hskip-.5\arrayrulewidth \fi {#1\vline}\ifadl@zwvrule \hskip-.5\arrayrulewidth \fi} % \end{macrocode} % % % \begin{macro}{\@@startpbox} % \begin{macro}{\@@endpbox} % \begin{macro}{\@endpbox} % \changes{v1.4-3-1}{1999/06/25} % {Introduced because \textsf{array} uses it.} % \begin{macro}{\adl@startmbox} % \changes{v1.71-1}{2004/08/31} % {Introduced to the bug fix of \textsf{array}'s \texttt{m}-columns.} % \begin{macro}{\adl@endmbox} % \changes{v1.71-1}{2004/08/31} % {Introduced to the bug fix of \textsf{array}'s \texttt{m}-columns.} % \SpecialIndex{\@finalstrut} % \SpecialIndex{\@startpbox} % \SpecialIndex{\adl@box} % \SpecialIndex{\adl@colhtdp} % % The macros to make |\parbox| for `|p|' (and `|b|' of % \textsf{array}), |\@@startpbox| and \hbox{|\@@endpbox|}, are modified for % height\slash depth measurement. The code for |\@@endpbox| is based on % that of \LaTeXe{} to fix the bug of |\strut|-ing in \LaTeX-2.09, but % |\@finalstrut| is manually expanded because it is not available in % \LaTeX-2.09. % % In \textsf{array}, |\@@endpbox| is not used but |\@endpbox| is. % Therefore, we |\let| them be equal. As for |\@startpbox|, however, we may % not worry about it because we have modified \hbox{|\@classz|} in % \S\ref{sec:imp-pream} for the measurement. However, we have to take care % of |m|-type columns specially because its body |\vcenter| cannot be % assigned directly to |\adl@box| by |\setbox|\footnote{ % % The author had forgotten this fact until Morten H\o gholm pointed out it. % Thanks Morten.}. % % Thus we enclose a |$\vcenter{|\ldots|}$| construct in a |\hbox| and assign % it to |\adl@box|. The macro |\adl@startmbox| opens the construct with % \textsf{array}'s |\@startpbox|, while |\adl@endmbox| closes it calling % |\adl@org@endpbox| which is the unmodified |\@endpbox| of \textsf{array} % and measures the height and depth of the |\hbox| by |\adl@colhtdp|. % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} % % \begin{macrocode} \def\@@startpbox#1{\setbox\adl@box\vtop\bgroup \hsize#1\@arrayparboxrestore} \def\@@endpbox{\unskip \ifhmode \nobreak \vrule\@width\z@\@height\z@\@depth\dp\@arstrutbox \fi \par \egroup \adl@colhtdp \box\adl@box \hfil} \let\@endpbox\@@endpbox \def\adl@startmbox{\bgroup $\vcenter\@startpbox} \def\adl@endmbox{\adl@org@endpbox $\egroup \adl@colhtdp \box\adl@box \hfil} %%^L % \end{macrocode} % % % % \subsection{Multi-columns} % \label{sec:imp-mc} % % \begin{macro}{\multicolumn} % \changes{v1.4-3-1}{1999/06/25} % {Modified for several reason.} % \begin{macro}{\adl@preamble} % \begin{macro}{\adl@mcaddamp} % \changes{v1.4-3-1}{1999/06/25} % {Introduced for the complaint on multiple columns if with % \textsf{array}.} % \begin{macro}{\adl@activatepbox} % \changes{v1.4-3-1}{1999/06/25} % {Introduced to do nothing if with \textsf{array}.} % % The macro |\multicolumn| is modified for the followings. % % \begin{itemize} % \item % The macros to construct the parts of |\@preamble| for vertical lines, % |\adl@arrayrule|, |\adl@arraydashrule| and |\adl@argarraydashrule|, have % to perform operations slightly different from those for main preamble. % Thus they are |\def|-ined to multi-column version |\adl@mcarrayrule|, etc. % \changes{v1.3}{1998/10/08} % {\cs{def}-s for \cs{adl@mcarrayrule} etc. are enclosed in a group.} % These |\def|-initions are enclosed in a group so that they are not % affected to |array| or |tabular| which may occur in the third argument of % |\multicolumn|. In order to make |\@preamble| work well outside of the % group containing |\@makepream|, |\adl@preamble| is |\global|-ly |\let|-equal % to |\@preamble| just after |\@makepream| in the group and then % reverse |\let|-assignment is performed just after the group is closed. % These global assignment is unnecessary with \textsf{array} because % |\@preamlbe| is constructed |\global|-ly, but safe. % % Since this grouping nullifies the effect of |\adl@preaminit| called in % |\@mkpream|, we call |\adl@preaminit| again after the group closing. % % \item % In \textsf{array}, |\@addamp| to make |\@preamble| for |\multicolumn| has % a different definition from that for main one. Thus it is |\let|-equal % to |\adl@mcaddamp| whose definition is switched by |\ifadl@usingarypkg|. % % \item % If \textsf{array} is in use, |\@preamble| has to be |\xdef|-ed once again % by |\@addpreamble| with an |\@empty| argument after |\@mkpreamble| to % expand the contents of |\toks| registers. This is performed whether or % not with \textsf{array} because it is safe. % % \item % As done in |\@array|, |\set@typeset@protect| is replaced with direct % |\let|. % % \item % If without \textsf{array}, |\@startpbox| and |\@endpbox| should be % |\let|-equal to their |@@| counterparts, while should not with % \textsf{array}. Thus we define |\adl@activatepbox| to do or not to do so % depending on |\ifadl@usingarypkg|. % % \item % The counter |\adl@currentcolumn| is |\global|-ly incremented by the first % argument of |\multicolumn| (number of columns to be |\span|-ned). % \end{itemize} % % Note that |\adl@columns| is modified by |\@mkpream|, but it is not % referred |\adl@mcarrayrule| etc., and its value is restored before % referred by |\hdashline|, etc. % \end{macro}\end{macro}\end{macro}\end{macro} % % \SpecialIndex{\adl@arrayrule} % \SpecialIndex{\adl@arraydashrule} % \SpecialIndex{\adl@argarraydashrule} % \SpecialIndex{\adl@mcarrayrule} % \SpecialIndex{\adl@mcarraydashrule} % \SpecialIndex{\adl@mcargarraydashrule} % \SpecialIndex{\ifadl@usingarypkg} % \SpecialIndex{\adl@currentcolumn} % % \begin{macrocode} %% Multi-Columns \def\multicolumn#1#2#3{\multispan{#1}\begingroup \begingroup \def\adl@arrayrule{\adl@mcarrayrule{#1}}% \def\adl@arraydashrule{\adl@mcarraydashrule{#1}}% \def\adl@argarraydashrule{\adl@mcargarraydashrule{#1}}% \let\@addamp\adl@mcaddamp \@mkpream{#2}\@addtopreamble\@empty \global\let\adl@preamble\@preamble \endgroup \let\@preamble\adl@preamble \def\@sharp{#3}\let\protect\relax \adl@activatepbox \adl@preaminit \@arstrut \@preamble\hbox{}\endgroup \global\advance\adl@currentcolumn#1\ignorespaces} \ifadl@usingarypkg \def\adl@mcaddamp{\if@firstamp\@firstampfalse \else\@preamerror5\fi} \let\adl@activatepbox\relax \else \let\adl@mcaddamp\@addamp \def\adl@activatepbox{\let\@startpbox\@@startpbox \let\@endpbox\@@endpbox} \fi % \end{macrocode} % % \begin{macro}{\adl@mcarrayrule} % \begin{macro}{\adl@mcarraydashrule} % \begin{macro}{\adl@mcargarraydashrule} % \changes{v1.4-3-1}{1999/06/25} % {Modified to pretend \texttt{p} or \texttt{@} depending on if % \textsf{array} is in use.} % \SpecialIndex{\adl@arrayrule} % \SpecialIndex{\adl@arraydashrule} % \SpecialIndex{\adl@argarraydashrule} % \SpecialIndex{\adl@currentcolumn} % % The preamble parts for vertical lines are constructed by the macros % |\adl@mcarrayrule|, |\adl@mcarraydashrule| and |\adl@mcargarraydashrule| % which are passed the first argument \meta{$n$} of |\multicolumn| to know % the number of columns to be |\span|-ned. They are similar to their % relatives for main preamble, |\adl@arrayrule|, etc., but the arguments % \meta{$c^L$} and \meta{$c^R$} passed to |\adl@xarraydashrule| are; % $$ % c^L=c,\qquad c^R=c+n-1 % $$ % where $c={}$|\adl@currentcolumn|. This makes leading vertical lines drawn % at the left edge of the leftmost |\span|-ned column and trailing ones at % the right edge of the rightmost column. % \end{macro}\end{macro}\end{macro} % % \begin{macrocode} \def\adl@mcarrayrule#1{\@tempcnta#1\advance\@tempcnta\adl@currentcolumn \advance\@tempcnta\m@ne \adl@xarraydashrule {\adl@currentcolumn}{\@tempcnta}{{\z@/\z@}}} \def\adl@mcarraydashrule#1{\@tempcnta#1\advance\@tempcnta\adl@currentcolumn \advance\@tempcnta\m@ne \adl@xarraydashrule {\adl@currentcolumn}{\@tempcnta}% {{\dashlinedash/\dashlinegap}}} \def\adl@mcargarraydashrule#1{\@tempcnta#1\advance\@tempcnta\adl@currentcolumn \advance\@tempcnta\m@ne \adl@xarraydashrule {\adl@currentcolumn}{\@tempcnta}{}% \@chclass\adl@class@iiiorvii \let\@classv\adl@classvfordash} %%^L % \end{macrocode} % % % % \subsection{End of Rows} % \label{sec:imp-eor} % % \begin{macro}{\@xarraycr} % \changes{v1.4-3-1}{1999/06/25} % {The version for \textsf{array} is introduced.} % \begin{macro}{\@xtabularcr} % \begin{macro}{\@xargarraycr} % \begin{macro}{\@yargarraycr} % \SpecialIndex{\ifadl@usingarypkg} % % At the end of the $i\th$ row, we have to calculate $h_i$ which is the height % plus depth of the row, and add elements \meta{$C^L_i,h_i$} and % \meta{$C^R_i,h_i$} to $R^L$ and $R^R$. To do this, |\cr|-s in the macros % \hbox{|\@xarraycr|}, |\@xtabularcr|, |\@xargarraycr| are replaced with our % own |\adl@cr|. The macro |\@yargarraycr|\meta{dimen} is also modified but % its |\cr| is replaced with |\adl@argcr|\meta{dimen} to add (negative) % |\dimen| to $h_i$. Note that |\@xargarraycr|\meta{dimen} uses ordinary % |\adl@cr| because the extra vertical space of \meta{dimen} is inserted to % the last column. % % Note that the implementation of |\@xarraycr| is slightly different between % \LaTeX{} and \textsf{array}, we have to have two versions and choose one. % \end{macro}\end{macro}\end{macro}\end{macro} % % \begin{macrocode} %% End of row \ifadl@usingarypkg \def\@xarraycr{\@ifnextchar[{\@argarraycr}{\ifnum0=`{}\fi\adl@cr}} \else \def\@xarraycr{\@ifnextchar[{\@argarraycr}{\ifnum0=`{\fi}${}\adl@cr}} \fi \def\@xtabularcr{\@ifnextchar[{\@argtabularcr}{\ifnum0=`{\fi}\adl@cr}} \def\@xargarraycr#1{\@tempdima#1\advance\@tempdima\dp\@arstrutbox \vrule\@height\z@\@depth\@tempdima\@width\z@ \adl@cr} \def\@yargarraycr#1{\adl@argcr{#1}\noalign{\vskip #1}} % \end{macrocode} % % \begin{macro}{\adl@cr} % \begin{macro}{\adl@argcr} % The macro |\adl@cr| and |\adl@argcr| perform |\cr| and then invoke the % common macro |\adl@@cr|\meta{x}. The argument \meta{x} is the extra % (negative) vertical space for |\adl@argcr|, while it is 0 for |\adl@cr|. % \end{macro}\end{macro} % % \begin{macro}{\adl@@cr} % \changes{v1.4-3-6}{1999/06/25} % {Modified to set \cs{adl@finaldepth}.} % \changes{v1.6-1}{2003/8/25} % {Modified to insert \cs{adl@discard}.} % \SpecialIndex{\@arstrutbox} % \SpecialIndex{\adl@totalheight} % \SpecialIndex{\adl@colsL} % \SpecialIndex{\adl@colsR} % \SpecialIndex{\adl@rowsL} % \SpecialIndex{\adl@rowsR} % \SpecialIndex{\adl@connect} % \SpecialIndex{\adl@discard} % \SpecialIndex{\adl@finaldepth} % \SpecialIndex{\adl@height} % \SpecialIndex{\adl@depth} % \SpecialIndex{\adl@currentcolumn} % % The macro |\adl@@cr|\meta{x} at first calculate $h_i$ as follows. The % registers |\adl@height|${}=\eta$ and |\adl@depth|${}=\delta$ have the % maximum height and depth of the columns in the row. However, they could % be smaller than the height and/or depth of |\@arstrutbox|, $\eta_s$ and % $\delta_s$. If so, the height and/or depth of the row are $\eta_s$ and % $\delta_s$. Therefore, $h_i$ is caluclated by; % $$ % h_i = \max(\eta,\eta_s) + \max(\delta,\delta_s). % $$ % Additionally, if the extra space \meta{x} is negative, a vertical space of % $x$ is inserted below the row\footnote{ % % Before v1.54, negative \meta{x} shrinks the hight of the row by $\vert % x\vert$. Although the former result may be more appropriate if the row % has vertical lines than the current because lines extrude to the next row % now, new feature is considered compatible with original % \texttt{array}\slash \texttt{tabular}.}. % % Thus the integer value of $h_i+x$ is % |\global|-ly added to |\adl@totalheight|, and the elements % \meta{$C^L_i{=}\cs{adl@colsL},h_i$} and % \meta{$C^R_i{=}\cs{adl@colsR},h_i$} are added to the tail of % $R^L={}$|\adl@rowsL| and $R^C={}$|\adl@rowsR|\@. If $x$ is not 0 % (negative), {\it discard}$(x)$ or {\it connect}$(x)$ is also added after % \meta{$C^{L/R}_i,h_i$} according to the current environment (|longtable| % or not). In the real implementation, $R^L$ and $R^C$ has the following % format of \meta{rows}. % % % \begin{eqnarray*} % \meta{rows}&::=& % [\meta{row}\hbox{\tt;}]^*\\ % \meta{row}&::=& % \hbox{{\tt(}\meta{cols}{\tt/}\meta{$h_i$}{\tt)}}\\ % \meta{cols}&::=& % [\hbox{\cs{elt}\Meta{c}\Meta{d}\Meta{g}}]^*\ \vert\qquad\qquad& % \hbox to.3\textwidth{\ldots\ $C^L$ or $C^R$\hss}\cr % && \cs{adl@connect}\ \vert& % \hbox to.3\textwidth{\ldots\ for {\it connect}$(h_i)$\hss}\cr % && \cs{adl@discard}\ \vert& % \hbox to.3\textwidth{\ldots\ for {\it discard}$(h_i)$\hss}\cr % && \cs{relax}& % \hbox to.3\textwidth{\ldots\ for {\it disconnect}$(h_i)$\hss}\cr % \noalign{\vskip-\baselineskip} % \end{eqnarray*} % % Since |\adl@discard| is |\def|-ined as |\adl@connect| by |\adl@arrayinit|, % added |\adl@discard| transforms itself into |\adl@connect| if current % envrionment is not |longtable|. Otherwise, as we make |\adl@discard| % |\let|-equal to |\relax| when a |longtable| environment starts, it keeps % its own form. % % Then, |\adl@finaldepth| is set to |\adl@depth| if $x$ is zero, or to zero % otherwise (negative), in order to make the depth |array|\slash|tabular| % equal to that of the last row. Finally, |\adl@colsL|, |\adl@colsR|, % |\adl@currentcolumn|, |\adl@height| and |\adl@depth| are reinitialized to % process the next row. % \end{macro} % % \begin{macrocode} \def\adl@cr{\cr\noalign{\adl@@cr\z@}} \def\adl@argcr#1{\cr\noalign{\adl@@cr{#1}}} \def\adl@@cr#1{ \ifdim\adl@height<\ht\@arstrutbox \adl@height\ht\@arstrutbox\fi \ifdim\adl@depth<\dp\@arstrutbox \adl@depth\dp\@arstrutbox\fi \advance\adl@height\adl@depth \global\advance\adl@totalheight\adl@height \@tempdima#1\relax \global\advance\adl@totalheight\@tempdima \xdef\adl@rowsL{\adl@rowsL (\adl@colsL/\number\adl@height);% \ifdim#1=\z@\else (\adl@discard/\number\@tempdima);\fi}% \xdef\adl@rowsR{\adl@rowsR (\adl@colsR/\number\adl@height);% \ifdim#1=\z@\else (\adl@discard/\number\@tempdima);\fi}% \gdef\adl@colsL{}\gdef\adl@colsR{} \global\adl@currentcolumn\@ne \ifdim#1=\z@ \global\adl@finaldepth\adl@depth \else \global\adl@finaldepth\z@\fi \global\adl@height\z@ \global\adl@depth\z@} %%^L % \end{macrocode} % % % % \subsection{Horizontal Lines} % \label{sec:imp-hline} % % \begin{macro}{\hline} % \changes{v1.4-3-6}{1999/06/25} % {Modified to set \cs{adl@finaldepth} to zero.} % \changes{v1.7-1}{2004/5/21} % {Modified to shift up if null-wide.} % \begin{macro}{\cline} % \changes{v1.4-3-6}{1999/06/25} % {Modified to set \cs{adl@finaldepth} to zero.} % \changes{v1.7-1}{2004/5/21} % {Modified to shift up if null-wide.} % \SpecialIndex{\adl@hline} % \SpecialIndex{\adl@xhline} % \SpecialIndex{\adl@connect} % \SpecialIndex{\adl@finaldepth} % \SpecialIndex{\adl@org@cline} % % The macro |\hline| is modified to insert |\vskip-\arrayrulewidth| before % drawing if |\ADLnullwidehline| is in effect, or to add the element ${\it % connect}(w)={}$|(\adl@connect/|\allowbreak|\number\arrayrulewidth)| to the % end of $R^L$ and $R^R$ by |\adl@hline| otherwise. The other modifications % are to set |\adl@finaldepth| to zero for the case that the last vertical % item is |\hline|, and to check if it is followed by not only |\hline| but % also |\hdashline| by |\adl@xhline|. % % The macro |\cline| is also modified to set |\adl@finaldepth| to zero. As % for the feature of |\ADLnullwidehline|, it inserts |\vskip-\arrayrulewidth| % to shift the line up befor drawing, and |\vskip\arrayrulewidth| after % drawing to cancel the negative skip inserted by |\adl@org@cline|. % \end{macro}\end{macro} % % \begin{macrocode} %% Horizontal Lines \def\hline{\noalign{\ifnum0=`}\fi \ifadl@zwhrule \vskip-\arrayrulewidth \else \adl@hline\adl@connect\arrayrulewidth \fi \hrule\@height\arrayrulewidth \global\adl@finaldepth\z@ \futurelet\@tempa\adl@xhline} \def\cline#1{\noalign{\global\adl@finaldepth\z@ \ifadl@zwhrule \vskip-\arrayrulewidth\fi} \adl@org@cline{#1}% \noalign{\ifadl@zwhrule \vskip\arrayrulewidth\fi}} % \end{macrocode} % % \begin{macro}{\hdashline} % \changes{v1.4-3-5}{1999/06/25} % {Modified to make \cs{adl@hdashline} usable for % \cs{first}\slash\texttt{lasthdashline}.} % \begin{macro}{\adl@hdashline} % \changes{v1.4-3-5}{1999/06/25} % {Modified to be usable for % \cs{first}\slash\texttt{lasthdashline}.} % \changes{v1.7-1}{2004/5/21} % {Modified for null-wide horizontal lines.} % \begin{macro}{\adl@ihdashline} % \changes{v1.4-3-5}{1999/06/25} % {Introduced as the substitute of old \cs{adl@hdashline}.} % \changes{v1.7-1}{2004/5/21} % {\cs{adl@hline} is moved to \cs{adl@hdashline} for null-wide lines.} % \SpecialIndex{\adl@hcline} % \SpecialIndex{\dashlinedash} % \SpecialIndex{\dashlinegap} % % The macro |\hdashline| calls |\adl@hdashline| to open the |\noalign| % construct by the well-known trick |{\ifnum0=`}\fi| and then to invoke % |\adl@ihdashline| checking the existence of its optional argument % |[|\meta{dash}|/|\meta{gap}|]|. Before the invocation, it inserts % |\vskip-\arrayrulewidth| if |\ADLnullwidehline| is in effect, or adds % ${\it connect}(w)$ to the end of $R^L$ and $R^R$. Then |\adl@ihdashline| % closes the |\noalign| by |\ifnum0=`{\fi}| to start the pseudo row for the % horizontal dash-line. Before the dash-line is drawn by |\adl@hcline| % which is also used for |\cdashline|, all the columns are |\span|-ned by % giving |\adl@columns| to |\multispan|. Finally, the |\noalign| is opened % again and |\adl@xhline| is invoked to check whether |\h(dash)line| is % followed. % \end{macro}\end{macro}\end{macro} % % \begin{macro}{\adl@inactivehdl} % \changes{v1.4-3-3}{1999/06/25} % {Introduced to emulate \cs{hdashline} by \cs{hline}.} % \changes{v1.7-1}{2004/5/21} % {Modified to shift up if null-wide.} % % If |\ADLinactivate| is in effect, |\adl@ihdashline| is |\let|-equal % to |\adl@inactivehdl|. This macro simply puts a |\hrule| discarding its % arguments after inserting |\vskip|\allowbreak|-\arrayrulewidth| if % |\ADLnullwidehline| is in effect. % \end{macro} % % \begin{macrocode} \def\hdashline{\adl@hdashline\adl@ihdashline} \def\adl@hdashline#1{\noalign{\ifnum0=`}\fi \ifadl@zwhrule \vskip-\arrayrulewidth \else \adl@hline\adl@connect\arrayrulewidth \fi \@ifnextchar[%] {#1}% {#1[\dashlinedash/\dashlinegap]}} \def\adl@ihdashline[#1/#2]{\ifnum0=`{\fi}% \multispan{\adl@columns}\unskip \adl@hcline\z@[#1/#2]% \noalign{\ifnum0=`}\fi \futurelet\@tempa\adl@xhline} \def\adl@inactivehdl[#1/#2]{\ifadl@zwhrule \vskip-\arrayrulewidth \fi \hrule\@height\arrayrulewidth \futurelet\@tempa\adl@xhline} % \end{macrocode} % % \begin{macro}{\adl@xhline} % \SpecialIndex{\@xhline} % % The macro |\adl@xhline| is the counterpart of the original |\@xhline|. % This is introduced to check the mixed sequence of |\hline| and % |\hdashline|, and to add the element ${\it % disconnect}(s)={}$|(\relax/\doublerulesep)| to the end of $R^L$ and $R^R$ % by |\adl@hline| if a pair of |\h(dash)line| is found. % \end{macro} % % \begin{macrocode} \def\adl@xhline{\ifx\@tempa\hline \adl@ixhline\fi \ifx\@tempa\hdashline \adl@ixhline\fi \ifnum0=`{\fi}} \def\adl@ixhline{\vskip\doublerulesep \adl@hline\relax\doublerulesep} % \end{macrocode} % % \begin{macro}{\adl@hline} % \SpecialIndex{\adl@totalheight} % \SpecialIndex{\adl@rowsL} % \SpecialIndex{\adl@rowsR} % % The macro |\adl@hline|\meta{cs}\meta{dimen} |\global|-ly adds the integer % value of \meta{dimen} to |\adl@totalheight| and adds the element % |(|\meta{cs}|/\number|\meta{dimen}|)| to the tail of $R^L$ and $R^R$. The % arguments \meta{cs}\meta{dimen} are |\adl@connect\arrayrulewidth| for % ${\it connect}(w)$ or |\relax\doublerulesep| for ${\it disconnect}(s)$. % \end{macro} % % \begin{macrocode} \def\adl@hline#1#2{\@tempcnta#2 \global\advance\adl@totalheight\@tempcnta \xdef\adl@rowsL{\adl@rowsL (#1/\number\@tempcnta);}% \xdef\adl@rowsR{\adl@rowsR (#1/\number\@tempcnta);}} % \end{macrocode} % % \begin{macro}{\cdashline} % \changes{v1.4-3-7}{1999/06/25} % {Modified to call renamed \cs{adl@cdline}.} % \begin{macro}{\adl@cdline} % \changes{v1.4-3-7}{1999/06/25} % {Renamed and modified to call renamed \cs{adl@cdlinea}\slash % \texttt{b}.} % \changes{v1.7-1}{2004/5/21} % {Modified to shift up if null-wide.} % \begin{macro}{\adl@cdlinea} % \changes{v1.4-3-7}{1999/06/25} % {Renamed.} % \begin{macro}{\adl@cdlineb} % \changes{v1.4-3-7}{1999/06/25} % {Renamed.} % \SpecialIndex{\@cline} % \SpecialIndex{\adl@cla} % \SpecialIndex{\adl@clb} % \SpecialIndex{\adl@org@cline} % \SpecialIndex{\adl@hcline} % % The macro |\cdashline| at first opens |\noalign| and then invokes % |\adl@cdline| checking the existence of its optional argument % |[|\meta{dash}|/|\meta{gap}|]|. The macro |\adl@cdline| first inserts % |\vskip-\arrayrulewidth| if |\ADLnullwidehline| is in effect. Then it % performs column |\span|-ing by the code based on that of |\@cline| in % \LaTeX-2.09 because \LaTeXe's version will not work with \LaTeX-2.09. The % main job is done by |\adl@hcline| after the target columns are |\span|-ned % by |\adl@cdlinea| or |\adl@cdlineb|. % \end{macro}\end{macro}\end{macro}\end{macro} % % \begin{macro}{\adl@inactivecdl} % \changes{v1.4-3-3}{1999/06/25} % {Introduced to emulate \cs{cdashline} by \cs{cline}.} % \changes{v1.7-1}{2004/5/21} % {Modified to invoke \cs{cline} rather than \cs{adl@orgcline} for % null-wide.} % % If |\ADLinactivate| is in effect, |\adl@cdline| is |\let|-equal % to |\adl@inactivecdl|. This macro simply calls our own |\cline|, after % closing the |\noalign| opened by |\cdashline|. % \end{macro} % % \begin{macrocode} \def\cdashline#1{\noalign{\ifnum0=`}\fi \@ifnextchar[%] {\adl@cdline[#1]}% {\adl@cdline[#1][\dashl