% \iffalse
%% Style file `arydshln'
%% Copyright (C) 1993,1998,1999,2000
%%               Hiroshi Nakashima <nakasima@tutics.tut.ac.jp>
%%               (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{1820}
%% \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}
%</dtx>
%<package>\def\next{LaTeX2e}
%<package>\ifx\fmtname\next\def\next{
%<package>\NeedsTeXFormat{LaTeX2e}[1994/12/01]
%<package>\ProvidesPackage{arydshln}}
%<package>\else\def\next[#1]{}\fi\next
%<driver>\ProvidesFile{arydshln-man.tex}
% \fi
% \ProvidesFile{arydshln.dtx}
[2000/07/04 v1.4 ]
%
% \iffalse
%<*driver>
\documentclass{ltxdoc}
\usepackage{arydshln}
\DisableCrossrefs
\PageIndex
\CodelineNumbered
\RecordChanges
%</driver>
%<driver>\OnlyDescription
%<*driver>
\advance\textwidth4em
\begin{document}
\DocInput{arydshln.dtx}
\end{document}
%</driver>
% \fi
% \MakeShortVerb{\|}
% \GetFileInfo{arydshln.dtx}
% \IndexPrologue{\section*{Index}}
% \def\main#1{#1}
% \def\usage#1{#1}
% \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\SpecialMainIndex#1{\@bsphack
%	\RemoveAtFromCS{#1}
% 	\protected@edef\@tempa{\noexpand\special@index{\RAFCtempa
%		\actualchar \string\verb
% 		\quotechar*\verbatimchar\string#1\verbatimchar
%		\encapchar main}}\@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.}
% 
% 
%
% \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 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 now has
% additional new features.
%
% 
%
% \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}
%
% Only one caution given to users of \textsf{array} package included in
% Standard \LaTeX{} Tools Bundle is that \textsf{arydshln} has to be loaded 
% {\em after} \textsf{array} done.  That is, the following is correct but
% reversing the order of |\usepackage| will cause some mysterious error.
%
% \begin{quote}
% |\usepackage{array}|\\
% |\usepackage{arydshln}|
% \end{quote}
%
% 
% 
% \subsection{Basic Usage}
% \label{sec:usage-basic}
%
% \DescribeEnv{array}\DescribeEnv{tabular}
% You can simply use |array| or |tabular(*)| environments with standard
% preamble, such as \verb!{r|c|ll}!, and standard commands |\\|, |\hline|,
% |\cline| and |\multicolumn|.
%
% \changes{v1.4-2}{1999/06/25}
%	{Description of characters and commands of array package is added.}
%
% Users of \textsf{array} package may also 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|.
%
% \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}
% 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{\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
%	\end{tabular}}
%
% \centerline{\example\qquad
%	\ADLdrawingmode{2}\example\qquad
%	\ADLdrawingmode{3}\example}
% \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 have many
% |array|\slash|tabular| with solid lines and quite few (or no)
% |array|\slash|tabular| with dash-lines, \LaTeX{} will run slowly.
%
% \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
% 
% 
%
% \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.
% \end{enumerate}
%
% 
%
% \StopEventually{
% \section*{Acknowledgments}
% 
% \changes{v1.4-2}{1999/06/25}
%	{Thank to more people.}
%
% 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 Sebastian Rahtz and Graham Williams
% who kindly invited the style to \TeX{} CTAN and online catalogue compiled
% by Graham, and 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.
%
% 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 to make the style
% compatible with \textsf{array}.
% 
% \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.}
%
% 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.
%
% 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 make 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 build 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.
% \end{itemize}
%
% In order to cope with them, the following data structure is constructed
% during rows are build.
%
% \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
% ${\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
% 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
% of the segment.  For a solid line segment, $d^i_j=g^i_j=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&i<i'\LAND\\
% &&	c^i_j=c^{i'}_{j'}\LAND d^i_j=d^{i'}_{j'}\LAND g^i_j=g^{i'}_{j'}\LAND
%		p^i_j=p^{i'}_{j'}\LAND\\
% &&	^\forall k(i<k<i'\to r_k=connect(h_k)).
% \end{eqnarray*}
%
% With these definitions, we can classify all $e^i_j$ into ordered sets
% $S_1,S_2,\ldots S_n$ as follows.
%
% \def\PH{\phantom{^\forall e^i_j\in S_k,\forall e^{i'}_{j'}\in S_{k'}(}}
% \begin{eqnarray*}
% k\neq k'&\togets&
%	S_k\cap S_{k'}=\emptyset\\
% e^i_j\sim e^{i'}_{j'}&\togets&
%	^\exists k(e^i_j,e^{i'}_{j'}\in S_k\LAND
%		   S_k=\{\ldots,e^i_j,e^{i'}_{j'},\ldots\}\\
% k<k'&\togets&
%	^\forall e^i_j\in S_k,\forall e^{i'}_{j'}\in S_{k'}(
%		(c^i_j<c^{i'}_{j'})\LOR\\
% &&	\PH	(c^i_j=c^{i'}_{j'}\LAND p^i_j<p^{i'}_{j'})\LOR\\
% &&	\PH	(c^i_j=c^{i'}_{j'}\LAND p^i_j=p^{i'}_{j'}\LAND i<i')).
% \end{eqnarray*}
%
% Now we can draw a dash-line $L_k=\langle\gamma_k, \pi_k, \delta_k, \xi_k,
% \tau_k, \beta_k\rangle$ corresponding to $S_k=\{e^i_j,\ldots,e^{i'}_{j'}\}$
% as follows.
%
% \begin{itemize}
% \item
% $L_k$ is $\pi_k\th$ line in the $\gamma_k\th$ column where $\gamma_k=
% c^i_j=\ldots=c^{i'}_{j'}$ and $\pi_k=p^i_j=\ldots=p^{i'}_{j'}$.
%
% \item
% $L_k$ has the dash size $\delta_k=d^i_j=\ldots=d^{i'}_{j'}$ and gap size
% $\xi_k=g^i_j=\ldots=g^{i'}_{j'}$.
%
% \item
% The top and bottom ends of $L_k$ are at $\tau_k$ and $\beta_k$ above the
% bottom of the |array|\slash|tabular|, where;
%$$
% \tau_k=\sum_{l=i}^N h_l,\quad\beta_k=\sum_{l=i'+1}^N h_l.
%$$
% \end{itemize}
%
%  The row to draw $L_1,\ldots,L_n$ is;
%$$
% \sigma_1 L_1 \sigma_2 L_2 \ldots L_{n-1}\sigma_n L_n\sigma_{n+1}|\cr|
%$$
% where;
%
% \def\amp{\hbox{\tt\&}}
% \begin{eqnarray*}
% \sigma_1&=&
%	\cs{omit}[\cs{hss}\amp\cs{omit}]^{\gamma_1-1}\\[1ex]
% \sigma_{1<k\leq n}&=&
%	\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
%		[\cs{hss}\amp\cs{omit}]^{\gamma_k-\gamma_{k-1}}&
%			if $\gamma_{k-1}\neq\gamma_k$\cr}\\[1ex]
% \sigma_{n+1}&=&
%	[\cs{hss}\amp\cs{omit}]^{{\mit\Gamma}-\gamma_n-1}\cs{hss}.
% \end{eqnarray*}
%
% Note that $[x]^m$ means $m$-times iteration of $x$, and $\mit\Gamma$ is
% the number of columns specified in the preamble.
%
% Dash-lines at the right edges of columns are similarly drawn by processing
% $C^R_i$ with the following modifications.
%
% \begin{eqnarray*}
% k<k'&\togets&
%	^\forall e^i_j\in S_k,\forall e^{i'}_{j'}\in S_{k'}(
%		(c^i_j<c^{i'}_{j'})\LOR\\
% &&	\PH	(c^i_j=c^{i'}_{j'}\LAND p^i_j>p^{i'}_{j'})\LOR\\
% &&	\PH	(c^i_j=c^{i'}_{j'}\LAND p^i_j=p^{i'}_{j'}\LAND i<i'))\\
% \sigma_1&=&
%	\cs{omit}\cs{hss}[\amp\cs{omit}\cs{hss}]^{\gamma_1-1}\\[1ex]
% \sigma_{k>1}&=&
%	\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}=\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@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 modified.  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| inactivate dash-line functions if it is true.  Its
% default value is false.
% \end{macro}
% \end{itemize}
%
% We also use a working switch |\@tempswa|.
%
%    \begin{macrocode}
\newif\ifadl@leftrule
\newif\ifadl@connected
\newif\ifadl@doublerule
\newif\ifadl@zwvrule
\newif\ifadl@usingarypkg
\ifx\extrarowheight\undefined \adl@usingarypkgfalse
\else                         \adl@usingarypkgtrue  \fi
\newif\ifadl@inactive \adl@inactivefalse

%    \end{macrocode}
%
% \begin{macro}{\ADLnullwide}
% \changes{v1.4-3-2}{1999/06/25}
%	{Introduced to make vertical lines null wide.}
% \begin{macro}{\ADLsomewide}
% \changes{v1.4-3-2}{1999/06/25}
%	{Introduced to make vertical lines \cs{arraydashline} wide.}
% The switch |\adl@zwvruletrue| 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}{\ADLactivate}
% \begin{macro}{\ADLinactivate}
% The switch |\adl@inactive| is also turned on/off by user interface macros
% |\ADLinactivate| and |\ADLactivate|.
% \end{macro}\end{macro}
%
%    \begin{macrocode}
\def\ADLnullwide{\adl@zwvruletrue}
\def\ADLsomewide{\adl@zwvrulefalse}
\ifadl@usingarypkg \ADLsomewide \else \ADLnullwide \fi

\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 an extra 
% two |\smash|ed rows which make the depth of |array|\slash|tabular| zero.
% \end{macro}
% \end{itemize}
%
% 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 build 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 build.  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
% build 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 |\glbal| 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'}$, $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}
% 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}
%
% 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@tablclassz}
% \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 staffs 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.}
%
% \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 |\@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 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.
%
% 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.
% \end{macro}\end{macro}
%
% \begin{macro}{\@@array}
% \changes{v1.4-3-1}{1999/06/25}
%	{Introduced because \textsf{array} uses it.}
%
% Another staff 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}%
        \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.}
%
% 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| that also give them
% their initial values.  The macro also saves the following data structures
% and initializes them to empty lists.
%
% \begin{itemize}
% \item
% \begin{macro}{\adl@rowsL}
% \begin{macro}{\adl@rowsR}
% \begin{macro}{\adl@rowsLsave}
% \begin{macro}{\adl@rowsRsave}
% 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|.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \item
% \begin{macro}{\adl@colsL}
% \begin{macro}{\adl@colsR}
% \begin{macro}{\adl@colsLsave}
% \begin{macro}{\adl@colsRsave}
% 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{macro}\end{macro}\end{macro}\end{macro}
% \end{itemize}
%
% 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.
% 
% \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}.}
%
% Finally, if |\ifadl@inacive| is true, |\adl@inactivate| is invoked to
% inactivate dash-line functions.
% \end{macro}
%
%    \begin{macrocode}
\def\adl@arrayinit{%
        \adl@heightsave\adl@height \global\adl@height\z@
        \adl@depthsave\adl@depth \global\adl@depth\z@
        \adl@currentcolumnsave\adl@currentcolumn \global\adl@currentcolumn\@ne
        \adl@totalheightsave\adl@totalheight \global\adl@totalheight\z@
        \let\adl@rowsLsave\adl@rowsL \gdef\adl@rowsL{}%
        \let\adl@rowsRsave\adl@rowsR \gdef\adl@rowsR{}%
        \let\adl@colsLsave\adl@colsL \gdef\adl@colsL{}%
        \let\adl@colsRsave\adl@colsR \gdef\adl@colsR{}%
        \let\@elt\relax \let\adl@connect\relax
        \adl@columns\adl@ncol
        \ifadl@inactive \adl@inactivate \fi}

%    \end{macrocode}
%
% \begin{macro}{\adl@inactivate}
% \changes{v1.4-3-3}{1999/06/25}
%	{Introduced to inactivate \cs{@arrayclassz} etc.}
%
% If |\ADLinactivate| has effect and thus |\ifadl@inactive| is true, the
% macro |\adl@inactivate| is called from |\adl@arrayinit|.  This |\let|-s
% the following control sequences be equal to their counterparts in \LaTeX{} 
% and/or \textsf{array} package.
%
% \begin{itemize}\item[]
% |\@arrayclassz|\quad
% |\@tabclassz|\quad
% |\@classz|\quad
% |\@@startpbox|\quad
% |\@@endpbox|\\
% |\@endpbox|\quad
% |\adl@cr|\quad
% |\cline|\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 |\@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| 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[]
% |\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}
%
%    \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}%
        \let\cline\adl@org@cline
        \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}

%%^L
%    \end{macrocode}
%
% 
%
% \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}
% `|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{box}\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}
% `\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{c}
%		\hbox{{\tt\char`\{}\meta{d}/\meta{g}{\tt\char`\}}}\ |\\
% &&	\cs{adl@vlineR}\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
%
% Note that \meta{c} is the column number (leftmost is 1) where the
% character appears.
% \end{macro}\end{macro}
% \end{itemize}
%
% Additionally, each column except for 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.}
%
% 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.
%
% 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.
% 
% 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
        \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.}
%
% 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}
%
% 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.}
%
% 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| be 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.}
%
% 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.
% \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\vcenter\@startpbox{\@nextchar}\insert@column \@endpbox $\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 staffs 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}
% 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}
% 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}
% 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.
% \end{macro}
%
%    \begin{macrocode}
\def\adl@putlrc#1{\setbox\adl@box\hbox{#1}\adl@colhtdp \box\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}.}
%
% 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
% (|\@laschclass|${}=|\adl@class@start|$) or it follows another character
% for vertical line (|\@laschclass|${}=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{$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{$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@columns|, but
% \meta{$c^L$} may not be 1 for the preamble of |\multicolumn| as described
% in \S\ref{sec:imp-mc}.
% 
% 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}
% 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{\number#1}#3}%
        \else   \@addtopreamble{\adl@vlineR{\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| perform 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 update 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}
% \begin{macro}{\adl@@vlineR}
% \begin{macro}{\adl@@ivline}
% The macro |\adl@@vlineL|\meta{c}|{|\meta{d}|/|\meta{g}|}| adds the element
% $e=\langle c,d,g\rangle={}$|\@elt|\Meta{c}\Meta{d}\Meta{g} to the tail of
% the list |\adl@colsL| to construct $C^L_i$.  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 value 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.
% \end{macro}\end{macro}\end{macro}
%
%    \begin{macrocode}
\def\adl@@vlineL#1#2{\adl@ivline#2\@nil
        \xdef\adl@colsL{\adl@colsL
                \@elt{#1}{\number\@tempcnta}{\number\@tempcntb}}}
\def\adl@@vlineR#1#2{\adl@ivline#2\@nil
        \xdef\adl@colsR{\@elt{#1}{\number\@tempcnta}{\number\@tempcntb}%
                \adl@colsR}}
\def\adl@ivline#1/#2\@nil{%
        \@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}
%    \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}.}
% 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.} 
%
% If |\ADLinactivate| is in effect, |\adl@vlineL|\slash|R| is |\let|-equal
% to |\adl@inactivevl|.  This macro simply put a |\vrule| by |\vline|
% with\slash without negative |\hskip| of a half of |\arrayrulewidth| wide
% depending on |\ifadl@zwvrule|, discarding its arguments.
% \end{macro}
%
%    \begin{macrocode}
\def\adl@inactivevl#1#2{\ifadl@zwvrule \hskip-.5\arrayrulewidth \fi
        \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.}
%
% The macros to make |\parbox| for `|p|' (and `|m|' 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.
% \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

%%^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@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| be
% 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, it is |\let| be 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|-ed).
% \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}
%
%    \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.}
%
% 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|-ed.  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|-ed 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}
% At the end of a $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@@cr|, 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}.}
%
% 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$.  Additionally, if the extra space \meta{x} is negative, the
% row is shrunk by $-x$.  Therefore, $h_i$ is caluclated by;
% $$
% h_i = \max(\eta,\eta_s) + \max(\delta,\delta_s) + x.
% $$
% Then the integer value of $h_i$ 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|.  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{relax}&
%	    \hbox to.3\textwidth{\ldots\ for {\it disconnect}$(h_i)$\hss}\cr
% \noalign{\vskip-\baselineskip}
% \end{eqnarray*}
%
% 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 \advance\adl@height#1\relax
        \global\advance\adl@totalheight\adl@height
        \xdef\adl@rowsL{\adl@rowsL
                (\adl@colsL/\number\adl@height);}%
        \xdef\adl@rowsR{\adl@rowsR
                (\adl@colsR/\number\adl@height);}%
        \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.}
% \begin{macro}{\cline}
% \changes{v1.4-3-6}{1999/06/25}
%	{Modified to set \cs{adl@finaldepth} to zero.}
%
% The macro |\hline| is modified to add the element ${\it
% connect}(w)={}$|(\adl@connect/\number|\allowbreak|\arrayrulewidth)| to the
% end of $R^L$ and $R^R$ by |\adl@hline|, 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.
% \end{macro}\end{macro}
%
%    \begin{macrocode}

%% Horizontal Lines

\def\hline{\noalign{\ifnum0=`}\fi \hrule\@height\arrayrulewidth
        \adl@hline\adl@connect\arrayrulewidth
        \global\adl@finaldepth\z@
        \futurelet\@tempa\adl@xhline}
\def\cline{\noalign{\global\adl@finaldepth\z@}\adl@org@cline}

%    \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}.}
% \begin{macro}{\adl@ihdashline}
% \changes{v1.4-3-5}{1999/06/25}
%	{Introduced as the substitute of old \cs{adl@hdashline}.}
% 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}|]|.  Then the macro |\adl@ihdashline| adds
% ${\it connect}(w)$ to the end of $R^L$ and $R^R$, and 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|-ed 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}.}
%
% If |\ADLinactivate| is in effect, |\adl@ihdashline| is |\let|-equal
% to |\adl@inactivehdl|.  This macro simply puts a |\hrule| discarding its
% arguments.
% \end{macro}
%
%    \begin{macrocode}
\def\hdashline{\adl@hdashline\adl@ihdashline}
\def\adl@hdashline#1{\noalign{\ifnum0=`}\fi
        \@ifnextchar[%]
                     {#1}%
                     {#1[\dashlinedash/\dashlinegap]}}
\def\adl@ihdashline[#1/#2]{\adl@hline\adl@connect\arrayrulewidth
        \ifnum0=`{\fi}%
        \multispan{\adl@columns}\unskip \adl@hcline\z@[#1/#2]%
        \noalign{\ifnum0=`}\fi
        \futurelet\@tempa\adl@xhline}
\def\adl@inactivehdl[#1/#2]{\hrule\@height\arrayrulewidth
        \futurelet\@tempa\adl@xhline}

%    \end{macrocode}
%
% \begin{macro}{\adl@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}
% 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}.} 
% \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.}
% The macro |\cdashline| at first opens |\noalign| and then invokes
% |\adl@cdline| checking the existence of its optional argument
% |[|\meta{dash}|/|\meta{gap}|]|.  The code of the macro |\adl@cdline| is
% 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|-ed 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}.}
%
% If |\ADLinactivate| is in effect, |\adl@cdline| is |\let|-equal
% to |\adl@inactivecdl|.  This macro simply calls |\adl@org@cline|, original 
% version of |\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][\dashlinedash/\dashlinegap]}}
\def\adl@cdline[#1-#2]{\global\adl@cla#1\relax
        \global\advance\adl@cla\m@ne
        \ifnum\adl@cla>\z@ \global\let\@gtempa\adl@cdlinea
        \else              \global\let\@gtempa\adl@cdlineb\fi
        \global\adl@clb#2\relax
        \global\advance\adl@clb-\adl@cla \ifnum0=`{\fi}
        \@gtempa{-\arrayrulewidth}}
\def\adl@cdlinea{\multispan\adl@cla &\multispan\adl@clb \unskip \adl@hcline}
\def\adl@cdlineb{\multispan\adl@clb \unskip \adl@hcline}

\def\adl@inactivecdl[#1-#2][#3]{\ifnum0=`{\fi}\adl@org@cline{#1-#2}}

%    \end{macrocode}
%
% \begin{macro}{\adl@hcline}
% \changes{v1.4-3-4}{1999/06/25}
%	{Modified to use \cs{adl@draw}.}
%
% The macro |\adl@hcline|\meta{w}|[|\meta{d}|/|\meta{g}|]| draws a
% horizontal dash-line of dash size $d$ and gap size $g$ for |\hdashline|
% and |\cdashline| in the |\span|-ed columns by |\adl@draw|.  As we will
% discussed in \S\ref{sec:imp-draw}, the macro requires $d$ and $g$ are
% passed through |\@tempdima| and \hbox{|\@tempdimb|}, and control sequences
% \meta{rule}, \meta{skip} and \meta{box} are passed through its arguments
% to make it usable for both horizontal and vertical lines.  Then the
% vertical space of $w$, 0 for |\hdashline| and $-$|\arrayrulewidth| for
% |\cdashline|, is inserted.
% \end{macro}
%
%    \begin{macrocode}
\def\adl@hcline#1[#2/#3]{\@tempdima#2\relax \@tempdimb#3\relax
        \adl@draw\adl@vrule\hskip\hbox \cr
        \noalign{\global\adl@finaldepth\z@ \vskip#1}}

%    \end{macrocode}
%
% \begin{macro}{\firsthdashline}
% \changes{v1.4-3-5}{1999/06/25}
%	{Introduced as the dashed version of \cs{firsthline}.}
% \begin{macro}{\lasthdashline}
% \changes{v1.4-3-5}{1999/06/25}
%	{Introduced as the dashed version of \cs{lasthline}.}
% If \textsf{array} is in use, we wish to have dashed counterparts of
% |\first|\slash|lasthline| named |\first|\slash|lasthdashline|, which
% simply call |\adl@hdashline| with an argument to call
% |\adl@first|\slash|lasthdashline| after closing |\noalign| opened by
% |\adl@hdashline|.
% \end{macro}\end{macro}
%
% \begin{macro}{\adl@defflhdl}
% \changes{v1.4-3-5}{1999/06/25}
%	{Introduced for the tricky definition of \cs{adl@first}\slash
%	\texttt{lasthdashline}.}
% \begin{macro}{\adl@idefflhdl}
% \changes{v1.4-3-5}{1999/06/25}
%	{Introduced for the tricky definition of \cs{adl@first}\slash
%	\texttt{lasthdashline}.}
% \begin{macro}{\adl@firsthdashline}
% \changes{v1.4-3-5}{1999/06/25}
%	{Introduced as the body of \cs{firsthdashline}.}
% \begin{macro}{\adl@lasthdashline}
% \changes{v1.4-3-5}{1999/06/25}
%	{Introduced as the body of \cs{lasthdashline}.}
% The macros |\adl@first|\slash|lasthdashline|, however, are defined in a
% tricky manner to replace |\hline| in |\first|\slash|lasthline| with;
%
% \begin{quote}
% |\adl@hdashline\adl@ihdashline[|\meta{dash}|/|\meta{gap}|]|
% \end{quote}
%
% in order to avoid copy-and-replace.  To do that, we define |\adl@defflhdl| 
% and |\adl@idefflhdl| in which the body of |\first|\slash|lasthline| is
% expanded by |\exapndafter| and the parts preceding and following |\hline|
% are extracted.  Then the preceding part \meta{p}, the calling sequence of
% |\adl@hdashline|, and the following part \meta{f} are connected to be the
% body of |\adl@first|\slash|lasthdashline|.  Thus we define
% |\adl@firsthdashline| as follows.
% 
% \begin{quote}
% |\def\adl@firsthdashline|\texttt{[\#1/\#2]}|{%|\\
% \mbox{\qquad}\meta{p}\\
% \mbox{\qquad}|\adl@hdashline\adl@ihdashline|\texttt{[\#1/\#2]}\\
% \mbox{\qquad}\meta{f}|}|
% \end{quote}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
%    \begin{macrocode}
\ifadl@usingarypkg
\def\firsthdashline{\adl@hdashline{\ifnum0=`{\fi}\adl@firsthdashline}}
\def\lasthdashline{\adl@hdashline{\ifnum0=`{\fi}\adl@lasthdashline}}

\def\adl@defflhdl#1{\def\@tempa{#1}
        \expandafter\adl@idefflhdl}
\def\adl@idefflhdl#1\hline#2\@nil{%
        \@namedef\@tempa[##1/##2]{#1\adl@hdashline\adl@ihdashline[##1/##2]#2}}
\adl@defflhdl{adl@firsthdashline}\firsthline\@nil
\adl@defflhdl{adl@lasthdashline}\lasthline\@nil
\fi

%%^L
%    \end{macrocode}
% 
%
% \subsection{End of Environment}
% \label{sec:imp-eoe}
%
% \begin{macro}{\endarray}
% \begin{macro}{\endtabular}
% \begin{macro}{\endtabular*}
% The macros to close the |array|/|tabular| environment, |\endarray| and
% |\endtabular(*)|, are modified so that they invoke |\adl@endarray| to draw
% vertical lines just before closing |\halign|, and |\adl@arrayrestore| to
% restore registers and data structures |\global|-ly modified in the
% environment.
% \end{macro}\end{macro}\end{macro}
%
%    \begin{macrocode}

%% End of Environment

\def\endarray{\adl@endarray \egroup \adl@arrayrestore \egroup}
\def\endtabular{\adl@endarray \egroup \adl@arrayrestore \egroup $\egroup}
\expandafter\let\csname endtabular*\endcsname\endtabular

%    \end{macrocode}
%
% \begin{macro}{\adl@endarray}
% \changes{v1.4-3-6}{1999/06/25}
%	{Modified to set the depth of \texttt{array}\slash\texttt{tabular}
%	to \cs{adl@finaldepth}.}
% The macro |\adl@endarray| at first closes the last row by |\crcr|.  If this
% |\crcr| has real effect, we have to invoke |\adl@@cr| to perfrom our own
% end-of-row operations.  We assume that the |\crcr| is effective if either
% |\adl@height| or |\adl@depth| has a non-zero value\footnote{
%
% The author confesses that this rule is not strict and the introduction of a
% switch could improve the strictness.}.
%
% Then the rows to draw vertical lines $L_1$, \ldots, $L_n$;
% $$
% \sigma_1 L_1 \sigma_2 L_2 \ldots L_{n-1}\sigma_n L_n\sigma_{n+1}
% $$
% are created in |\adl@vlrowL| and |\adl@vlrowR| by |\adl@makevlrL| and
% |\adl@makevlrR|.  In the real implementation,
% $L_k=\meta{$\gamma_k,\pi_k,\delta_k,\xi_k,\tau_k,\beta_k$}$ is represented
% as;
% 
% \begin{quote}
% |\adl@vl{|$\beta_k$|}{|$\tau_k-\beta_k$|}{|$\delta_k$|}{|$\xi_k$|}|.
% \end{quote}
% 
% Thus |\adl@vl| is made |\let|-equal to |\relax| when the rows are
% constructed and to \hbox{|\adl@@vl|} when the rows are put.
%
% Since |\adl@makevlrL| and |\adl@makevlrR| shares common macros, they
% conceptually have the following interface.
%
% \begin{quote}
% \begin{tabbing}
% \cs{adl@vlrow}${}={}$\cs{adl@makevlrL/R}(\=
%	\cs{adl@rows}\,:\,\meta{$R^L$ or $R^R$},\\
% \>	\cs{adl@currentcolumn}\,:\,\meta{start column},\\
% \>	\cs{adl@addvl}\,:\,\meta{macro to add an element})
% \end{tabbing}
% \end{quote}
%
% Thus they are invoked as;
%
% \begin{quote}\leavevmode
% \cs{adl@vlrowL}${}={}$\cs{adl@makevrL}(
%	\cs{adl@rowsL},
% 	1,
% 	\cs{adl@addvlL})\\
% \cs{adl@vlrowR}${}={}$\cs{adl@makevrR}(
%	\cs{adl@rowsR},
% 	\cs{adl@columns},
% 	\cs{adl@addvlR})
% \end{quote}
%
% Finally, after constructed rows for vertical lines are put, a vertical
% skip of $-{}$|\adl@finaldepth| is inserted to move back to the last
% baseline, and then an invisible |\vrule| of |\adl@finaldepth| deep is put
% to make |array|\slash|tabular| has the depth of the last real row or zero
% if it ends with a horizontal line.
% \end{macro}
%
%    \begin{macrocode}
\def\adl@endarray{\crcr \noalign{
        \ifdim\adl@height=\z@
        \ifdim\adl@depth=\z@  \else \adl@@cr\z@ \fi
                              \else \adl@@cr\z@ \fi
        \let\adl@vl\relax
        \def\adl@vlrow{}\adl@currentcolumn\@ne
                \let\adl@rows\adl@rowsL
                \let\adl@addvl\adl@addvlL
                \adl@makevlrL \global\let\adl@vlrowL\adl@vlrow
        \def\adl@vlrow{}\adl@currentcolumn\adl@columns
                \let\adl@rows\adl@rowsR
                \let\adl@addvl\adl@addvlR
                \adl@makevlrR \global\let\adl@vlrowR\adl@vlrow
        \global\let\adl@vl\adl@@vl}%
        \omit \adl@vlrowL \cr \omit \adl@vlrowR \cr
        \noalign{\vskip-\adl@finaldepth}%
        \omit\vrule\@width\z@\@height\z@\@depth\adl@finaldepth\cr}

%    \end{macrocode}
%
% \begin{macro}{\adl@arrayrestore}
% The macro |\adl@arrayrestore| restores the values of registers and data
% structures, |\adl@height|, |\adl@depth|, |\adl@currentcolumn|,
% |\adl@totalheight|, |\adl@rowsL|, |\adl@rowsR|, |\adl@colsL| and
% |\adl@colsR|, saved by |\adl@arrayinit|.
% \end{macro}
%
%    \begin{macrocode}
\def\adl@arrayrestore{%
        \global\adl@height\adl@heightsave
        \global\adl@depth\adl@depthsave
        \global\adl@currentcolumn\adl@currentcolumnsave
        \global\adl@totalheight\adl@totalheightsave
        \global\let\adl@rowsL\adl@rowsLsave
        \global\let\adl@rowsR\adl@rowsRsave
        \global\let\adl@colsL\adl@colsLsave
        \global\let\adl@colsR\adl@colsRsave}

%%^L
%    \end{macrocode}
%
% 
%
% \def\defprog{
% \def\WHILE{\hbox{\bf while}}
% \def\DO{\hbox{\bf do}}
% \def\BEGIN{\hbox{\bf begin}}
% \def\END{\hbox{\bf end}}
% \def\IF{\hbox{\bf if}}
% \def\THEN{\hbox{\bf then}}
% \def\ELSE{\hbox{\bf else}}
% \def\TRUE{\hbox{\bf true}}
% \def\FALSE{\hbox{\bf false}}
% \let\_\gets
% \def\GAMMA{{\mit\Gamma}}
% \def\LAMBDA{{\mit\Lambda}}
% \def\!{\stepcounter{enumi}\llap{\footnotesize(\arabic{enumi})\quad}}
% }
% \begin{figure}[p]\defprog
% \begin{itemize}\item[]
% \setcounter{enumi}{0}
% \begin{tabbing}
%\!$\LAMBDA\_\meta{}$; $R\_R^L$; $\gamma\_1$;\\
%\!\WHILE\ $\gamma\leq\GAMMA$ \DO\ \BEGIN\\
%\!\qquad\=
%	$\tau\_H$; $\beta\_H$; $\delta\_ -1$; $\xi\_ -1$;\\
%\!\>	${\it conn}\_\FALSE$; ${\it double}\_\FALSE;$; $R'\_\meta{}$\\
%\!\>	\WHILE\ $R\neq\meta{}$ \DO\ \BEGIN\\
%\!\>\qquad\=	$\meta{$r,R$}\_R$;\\
%\!\>	\>	$\meta{$C,h$}\_r$;\\
%\!\>	\>	\IF\ $C=\meta{}$ \THEN\\
%\!\>	\>\qquad\=	${\it add}(\tau,\beta,\delta,\xi)$;\\
%\!\>	\>	\ELSE\IF\ $C\neq\meta{connect}$ \BEGIN\\
%\!\>	\>	\>	$\meta{$e,C'$}=C$; $\meta{$c,d,g$}=e$;\\
%\!\>	\>	\>	\IF\ $c=\gamma$ \THEN\ \BEGIN\\
%\!\>	\>	\>\qquad\=	\IF\ $d=\delta\LAND g=\xi$ \THEN\ \BEGIN\\
%\!\>	\>	\>	\>\qquad\=	\IF\ $\lnot{\it conn}$ \THEN\ \BEGIN\\
%\!\>	\>	\>	\>	\>\qquad\=	$\tau\_\beta$;
%						${\it conn}\_\TRUE$;\\
%\!\>	\>	\>	\>	\>	\END;\\
%\!\>	\>	\>	\>	\END;\\
%\!\>	\>	\>	\>	\ELSE\ \BEGIN\\
%\!\>	\>	\>	\>	\>	${\it add}(\tau,\beta,\delta,\xi)$;\\
%\!\>	\>	\>	\>	\>	$\delta\_d$; $\xi\_g$; $\tau\_\beta$;
%					${\it conn}\_\TRUE$;\\
%\!\>	\>	\>	\>	\END;\\
%\!\>	\>	\>	\>	\IF\ $C'=\meta{\meta{$\gamma,?,?$},$?$}$ \THEN
% 					\quad ${\it double}\_\TRUE$;\\
%\!\>	\>	\>	\>	$C\_C'$;\\
%\!\>	\>	\>	\END;\\
%\!\>	\>	\>	\ELSE\quad ${\it add}(\tau,\beta,\delta,\xi)$;\\
%\!\>	\>	\END;\\
%\!\>	\>	$\beta\_\beta-h$; $R'\_\meta{$R',\meta{$C,h$}$}$\\
%\!\>	\END;\\
%\!\>	${\it add}(\tau,\beta,\delta,\xi)$; $R\_R'$;\\
%\!\>	\IF\ {\it double} \THEN\quad
%		$\LAMBDA\_\meta{$\LAMBDA,\cs{hskip}\cs{doublerulesep}$}$;\\
%\!\>	\ELSE\ \BEGIN\\
%\!\>	\>	$\gamma\_\gamma+1$;\\
%\!\>	\>	\IF\ $\gamma>\GAMMA$ \THEN\quad\=
%			$\LAMBDA\_\meta{$\LAMBDA,\cs{hfil}$}$;\\
%\!\>	\>	\ELSE\>
%			$\LAMBDA\_
%			    \meta{$\LAMBDA,\cs{hfil}\hbox{\tt\&}\cs{omit}$}$;\\
%\!\> 	\END;\\
%\!\END;\\
%\!\\
%\!{\bf procedure} ${\it add}(\tau,\beta,\delta,\xi)$ \BEGIN\\
%\!\>	\IF\ {\it conn} \THEN\ \BEGIN\\
%\!\>	\>	$\LAMBDA\_
%		    \meta{$\LAMBDA,\meta{$\beta,\tau-\beta,\delta,\xi$}$}$;
%		${\it conn}\_\FALSE$;\\
%\!\>	\END;\\
%\!\END;
% \end{tabbing}
% \end{itemize}
% \caption{Conceptual Code of \cs{adl@makevlrL}}
% \label{fig-makevlr}
% \end{figure}
%
% 
%
% \subsection{Drawing Vertical Lines}
% \label{sec:imp-vl}
%
% Figure~\ref{fig-makevlr} shows the conceptual code of |\adl@makevlrL|.
% The correspondance of variables in the code and control sequences in the
% real implementation is as follows.
% \begin{itemize}\item[]
% $\begin{array}[t]{*4{r@{\;{:}\;}l}}
% R^L&			\cs{adl@rowsL}&
% R&			\cs{adl@rows}&
% R'&			\cs{@tempb}&
% \mit\Lambda&		\cs{adl@vlrowL}\\
% \mit\Gamma&		\cs{adl@columns}&
% \gamma&		\rlap{\cs{adl@currentcolumn}}\\
% \tau&			\cs{@tempcnta}&
% \beta&		\cs{@tempcntb}&
% \delta&		\cs{adl@dash}&
% \xi&			\cs{adl@gap}\\
% {\it conn}&		\rlap{\cs{ifadl@connected}}&\multicolumn2c{}&
% {\it double}&		\rlap{\cs{ifadl@doublerule}}\\
% \end{array}$
% \end{itemize}
%
% \begin{macro}{\adl@makevlrL}
% \changes{v1.4-3-8}{1999/06/25}
%	{Modified to replace \cs{hfil} with \cs{hss} to prevent drawing
%	vertical lines widen columns.}
% \begin{macro}{\adl@makevlrR}
% \changes{v1.4-3-8}{1999/06/25}
%	{Modified to replace \cs{hfil} with \cs{hss} to prevent drawing
%	vertical lines widen columns.}
% The macro |\adl@makevlrL| corresponds to the line (2) and (30)--(36).  Its
% right-edge counterpart |\adl@makevlrR| has the same correspondance but the
% lines (1)--(2) are;
%
% \begin{quote}\defprog\setcounter{enumi}{0}
% \begin{tabbing}
%\!$\LAMBDA\_\meta{}$; $R\_R^R$; $\gamma\_\GAMMA$;\\
%\!\WHILE\ $\gamma>0$ \DO\ \BEGIN
% \end{tabbing}
% \end{quote}
%
% and (30)--(35) are;
%
% \begin{quote}\defprog\setcounter{enumi}{29}
% \begin{tabbing}
%\!\qquad\=
%	\IF\ {\it double} \THEN\quad
%		$\LAMBDA\_\meta{$\cs{hskip}\cs{doublerulesep},\LAMBDA$}$;\\
%\!\>	\ELSE\ \BEGIN\\
%\!\>\qquad\=	$\gamma\_\gamma-1$;\\
%\!\>	\>	\IF\ $\gamma=0$ \THEN\quad\=
%			$\LAMBDA\_\meta{$\cs{hss},\LAMBDA$}$;\\
%\!\>	\>	\ELSE\>
%			$\LAMBDA\_
%			    \meta{$\hbox{\tt\&}\cs{omit}\cs{hss},\LAMBDA$}$;\\
%\!\> 	\END;\\
% \end{tabbing}
% \end{quote}
% \end{macro}\end{macro}
%    \begin{macrocode}

%% Drawing Vertical Lines

\def\adl@makevlrL{\adl@makevlr
        \ifadl@doublerule
                \edef\adl@vlrow{\adl@vlrow \hskip\doublerulesep}%
                \let\next\adl@makevlrL
        \else
                \advance\adl@currentcolumn\@ne
                \ifnum\adl@currentcolumn>\adl@columns \let\next\relax
                        \edef\adl@vlrow{\adl@vlrow \hss}%
                \else \let\next\adl@makevlrL
                        \edef\adl@vlrow{\adl@vlrow \hss &\omit}%
        \fi\fi\next}
\def\adl@makevlrR{\adl@makevlr
        \ifadl@doublerule
                \edef\adl@vlrow{\hskip\doublerulesep \adl@vlrow}%
                \let\next\adl@makevlrR
        \else
                \advance\adl@currentcolumn\m@ne
                \ifnum\adl@currentcolumn=\z@ \let\next\relax
                        \edef\adl@vlrow{\hss \adl@vlrow}%
                \else \let\next\adl@makevlrR
                        \edef\adl@vlrow{&\omit \hss \adl@vlrow}%
        \fi\fi\next}

%    \end{macrocode}
%
% \begin{macro}{\adl@makevlr}
% The macro |\adl@makevlr| corresponds to the lines (3)--(4) and (29).
% \end{macro}
%
%    \begin{macrocode}
\def\adl@makevlr{\@tempcnta\adl@totalheight \@tempcntb\adl@totalheight
        \adl@dash\m@ne \adl@gap\m@ne
        \adl@connectedfalse \adl@doublerulefalse \def\@tempb{}%
        \expandafter\adl@imakevlr\adl@rows\@nil;%
        \adl@addvl
        \edef\adl@rows{\@tempb}}

%    \end{macrocode}
%
% \begin{macro}{\adl@imakevlr}
% \begin{macro}{\adl@iimakevlr}
% The macro |\adl@imakevlr|\meta{$r$}|;| corresponds to the lines (5)--(6),
% and the macro |\adl@iimakevlr(|\meta{$C$}|/|\meta{$h$}|)| to (7) and (27).
% \end{macro}\end{macro}
%
%    \begin{macrocode}
\def\adl@imakevlr#1;{\def\@tempa{#1}\ifx\@tempa\@nnil \let\next\relax
        \else \adl@iimakevlr#1\let\next\adl@imakevlr \fi \next}
\def\adl@iimakevlr(#1/#2){\let\@elt\adl@iiimakevlr
        \let\adl@connect\adl@@connect
        \let\adl@endmakevlr\adl@endmakevlrcut
         #1\adl@endmakevlr
        \let\@elt\relax \let\adl@connect\relax
        \advance\@tempcntb-#2\edef\@tempb{\@tempb(\@tempc/#2);}}

%    \end{macrocode}
%
% \begin{macro}{\adl@iiimakevlr}
% \begin{macro}{\adl@ivmakevlr}
% \begin{macro}{\adl@vmakevlr}
% \begin{macro}{\adl@endmakevlrcut}
% \begin{macro}{\adl@endmakevlrconn}
% \begin{macro}{\adl@@connect}
% The correspondance of the lines (8)--(29) is a little bit complicated.  As
% shown above, |\adl@iimakevlr| expands $C$ attaching the sentinel
% |\adl@endmakevlr|.
%
% \begin{enumerate}
% \item
% If $C\neq\meta{}$ and $C\neq\meta{connect}$, $C$ has at least one
% |\@elt|\meta{$c$}\meta{$d$}\meta{$g$} which is made |\let|-equal to
% |\adl@iiimakevlr| by |\adl@iimakevlr|.  Thus the lines (10)--(21) and (25)
% are performed by |\adl@iiimakevlr|.
%
% Then;
% \begin{enumerate}
% \item
% if $c=\gamma$, |\@elt| becomes |\let|-equal to |\adl@ivmakevlr| which
% corresponds to (22) in the case of $C'\neq\meta{}$.  Then |\adl@vmakevlr|
% is invoked for (23) and to eat the sentinel |\adl@endmakevlr|.  If
% $C'=\meta{}$, |\adl@endmakevlrconn| is invoked, because the sentinel
% |\adl@endmakevlr| is made |\let|-equal to it by |\adl@iiimakevlr|, for
% (23) (i.e.\ $C\gets\meta{}$).
%
% \item
% if $c\neq\gamma$, |\adl@vmakevlr| is invoked to perform implicit $C\gets
% C$ operation and to eat the sentinel.
% \end{enumerate}
%
% \item
% If $C=\meta{connect}$, i.e.\ it has only one element |\adl@connect|, the
% macro |\adl@@connect| is invoked because it is |\let|-equal to
% |\adl@connect|.  The macro do nothing but implict $C\gets C\ {}
% (=\meta{connect})$ and eating the sentinel.
%
% \item
% If $C=\meta{}$, |\adl@endmakevlrcut| that is |\let|-equal to the sentinel
% |\adl@endmakevlr| is invoked to perform (8)--(9) and implicit $C\gets C
% \ (=\meta{})$.
% \end{enumerate}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
%    \begin{macrocode}
\def\adl@iiimakevlr#1#2#3{\let\@elt\adl@ivmakevlr \let\next\relax
        \ifnum#1=\adl@currentcolumn\relax
                \let\adl@endmakevlr\adl@endmakevlrconn
                \@tempswafalse
                \ifnum#2=\adl@dash\relax
                \ifnum#3=\adl@gap\relax
                        \@tempswatrue
                \fi\fi
                \if@tempswa
                        \ifadl@connected\else
                                \@tempcnta\@tempcntb \adl@connectedtrue \fi
                \else
                        \adl@addvl
                        \adl@dash#2\relax \adl@gap#3\relax
                        \@tempcnta\@tempcntb \adl@connectedtrue
                \fi
        \else
                \adl@addvl
                \def\next{\adl@vmakevlr\@elt{#1}{#2}{#3}}%
        \fi\next}
\def\adl@ivmakevlr#1#2#3{%
        \ifnum#1=\adl@currentcolumn \adl@doubleruletrue \fi
        \adl@vmakevlr\@elt{#1}{#2}{#3}}
\def\adl@vmakevlr#1\adl@endmakevlr{\def\@tempc{#1}}
\def\adl@endmakevlrcut{\adl@addvl \def\@tempc{}}
\def\adl@endmakevlrconn{\def\@tempc{}}
\def\adl@@connect\adl@endmakevlr{\def\@tempc{\adl@connect}}

%    \end{macrocode}
%
% \begin{macro}{\adl@addvlL}
% \begin{macro}{\adl@addvlR}
% The macro |\adl@addvlL| corresonds to the lines (38)--(42), i.e.\ the
% procedure {\it add}.  The macro |\adl@addvlR| performs simlar operations,
% but its conceptual code is the following.
% 
% \begin{quote}\defprog\setcounter{enumi}{37}
% \begin{tabbing}
%\!{\bf procedure} ${\it add}(\tau,\beta,\delta,\xi)$ \BEGIN\\
%\!\qquad\=
%	\IF\ {\it conn} \THEN\ \BEGIN\\
%\!\>\qquad\=	$\LAMBDA\_
%		    \meta{$\meta{$\beta,\tau-\beta,\delta,\xi$},\LAMBDA$}$;
%		${\it conn}\_\FALSE$;\\
%\!\>	\END;\\
%\!\END;
% \end{tabbing}
% \end{quote}
% \end{macro}\end{macro}
%
%    \begin{macrocode}
\def\adl@addvlL{\ifadl@connected
        \advance\@tempcnta-\@tempcntb
        \edef\adl@vlrow{\adl@vlrow
                \adl@vl{\number\@tempcntb}{\number\@tempcnta}%
                       {\number\adl@dash}{\number\adl@gap}}%
        \adl@connectedfalse \fi}
\def\adl@addvlR{\ifadl@connected
        \advance\@tempcnta-\@tempcntb
        \edef\adl@vlrow{\adl@vl{\number\@tempcntb}{\number\@tempcnta}%
                               {\number\adl@dash}{\number\adl@gap}\adl@vlrow}%
        \adl@connectedfalse \fi}

%    \end{macrocode}
%
% \begin{macro}{\adl@@vl}
% \changes{v1.4-3-2}{1999/06/25}
%	{Modified to make vertical line null wide only if \cs{ADLnullwide}.}
% \changes{v1.4-3-4}{1999/06/25}
%	{Modified to use \cs{adl@draw}.}
% After the the macros |\adl@vlrowL| and |\adl@vlrowR| are constructed, they
% are expanded to draw vertical lines.  These macros will have |\adl@vl|,
% which is made |\let|-equal to \hbox{|\adl@@vl|} prior to the expansion, to
% draw a vertical line.  The macro
% |\adl@@vl|\meta{$\beta$}\meta{$\lambda$}\meta{$\gamma$}\meta{$\delta$}
% draws a sloid line if $\gamma=0$ or a dash-line otherwise in a |\vbox| of
% $\lambda=\tau-\beta$ high and |\raise|-s it by $\beta$.  The method to
% draw a dash line in the |\vbox| is analogous to that for holizontal line
% shown in \S\ref{sec:imp-hline}, except that a line is surrounded by
% horizontal spaces of $-|arrayrulewidth|/2$ if |\ADLnullwide| is in effect.
% \end{macro}
%
%    \begin{macrocode}
\def\adl@@vl#1#2#3#4{\vbox to\z@{\vss\hbox{%
        \ifadl@zwvrule \hskip-.5\arrayrulewidth \fi
        \raise#1sp\vbox to#2sp{
                \ifnum#3=\z@
                        \hrule height#2sp depth\z@ width\arrayrulewidth
                \else   \@tempdima#3sp \@tempdimb#4sp
                        \adl@draw\adl@hrule\vskip\vbox
                \fi}%
        \ifadl@zwvrule \hskip-.5\arrayrulewidth \fi}}}

%%^L
%    \end{macrocode}
%
% 
% 
% \subsection{Drawing Dash-lines}
% \label{sec:imp-draw}
% \changes{v1.4-2}{1999/06/25}
%	{Section 4.12 is added.}
% 
% \begin{macro}{\adl@vrule}
% \changes{v1.4-3-4}{1999/06/25}
%	{Introduced to draw a dash for horizontal lines in \cs{adl@draw}.}
% \begin{macro}{\adl@hrule}
% \changes{v1.4-3-4}{1999/06/25}
%	{Introduced to draw a dash for vertical lines in \cs{adl@draw}.}
% As explained later, horizontal and vertical lines are drawn by a common
% macro |\adl@draw| to which the length of a dash segment, $d$, is passed
% through |\@tempdima|.  The macro also has an argument that is either
% |\adl@vrule| to draw a dash for {\em horizontal} lines or |\adl@hrule| for 
% {\em vertical}.  These two macros commonly have one argument \meta{f} to
% draw a dash of $f\times d$ long and of |\arrayrulewidth| wide.
% \end{macro}\end{macro}
%
%    \begin{macrocode}

%% Draw Dash Lines (\adl@vrule/\adl@hrule, \hskip/\vskip, \hbox/\vbox)

\def\adl@vrule#1{\vrule\@width#1\@tempdima\@height\arrayrulewidth\relax}
\def\adl@hrule#1{\hrule\@height#1\@tempdima\@width\arrayrulewidth\relax}
%    \end{macrocode}
% 
% \begin{macro}{\adl@drawi}
% \changes{v1.4-3-4}{1999/06/25}
%	{Introduced as \cs{adl@draw} in mode 1.}
% \begin{macro}{\adl@drawii}
% \changes{v1.4-3-4}{1999/06/25}
%	{Introduced as \cs{adl@draw} in mode 2.}
% \begin{macro}{\adl@drawiii}
% \changes{v1.4-3-4}{1999/06/25}
%	{Introduced as \cs{adl@draw} in mode 3.}
% \begin{macro}{\adl@draw}
% \changes{v1.4-3-4}{1999/06/25}
%	{Introduced as the mode and axis independent line drawing macro.}
% The macro |\adl@draw| is to draw a horizontal or vertical line.  It is
% |\let|-equal to one of |\adl@drawi|, |\adl@drawii| and |\adl@drawiii|
% according to the drawing mode specified by |\ADLdrawingmode|.  These three
% macros have common interface, |\@tempdima| and \hbox{|\@tempdimb|} for the
% length of dash and gap, $d$ and $g$, and three arguments \meta{rule},
% \meta{skip} and \meta{box} with which |\adl@draw| is called in the
% following manner.
%
% \begin{eqnarray*}
% \hbox{|\adl@draw\adl@vrule\hskip\hbox|}&\ldots&\hbox{horizontal}\\
% \hbox{|\adl@draw\adl@hrule\vskip\vbox|}&\ldots&\hbox{vertical}
% \end{eqnarray*}
%
% The drawing methods in three modes have been explained in
% \S\ref{sec:imp-ps2}.  More specifically, |\adl@drawi| for mode 1, to which
% |\adl@draw| is |\let|-equal by default, conceptually performs the
% following operations.
%
% \begin{quote}
% \def\arg#1{\hbox{{\tt\char`\{}#1{\tt\char`\}}}}
% \meta{rule}\arg{1/2}\quad\meta{skip}$(g/2)$\\
% |\xlearders|\meta{box}
%	\arg{\meta{skip}$(g/2)$ \meta{rule}\arg{1} \meta{skip}$(g/2)$}\\
% \phantom{\texttt{.xleaders}}\meta{skip}(0 |plus| 1|fil minus| 1|fil|)\\
% \meta{skip}$(g/2)$\quad\meta{rule}\arg{1/2}
% \end{quote}
%
% The conceptual operations of |\adl@drawii| for mode 2 are as follows.
%
% \begin{quote}
% \def\arg#1{\hbox{{\tt\char`\{}#1{\tt\char`\}}}}
% \meta{rule}\arg{1/2}\quad\meta{skip}$(g/2)$\\
% \meta{box}\arg{\meta{skip}$(g/2)$ \meta{rule}\arg{1} \meta{skip}$(g/2)$}\quad
%	\meta{skip}$(-d-g)$\\
% |\xlearders|\meta{box}
%	\arg{\meta{skip}$(g/2)$ \meta{rule}\arg{1} \meta{skip}$(g/2)$}\\
% \phantom{\texttt{.xleaders}}\meta{skip}(0 |plus| 1|fil minus| 1|fil|)\\
% \meta{skip}$(-d-g)$\quad
%    \meta{box}\arg{\meta{skip}$(g/2)$ \meta{rule}\arg{1} \meta{skip}$(g/2)$}\\
% \meta{skip}$(g/2)$\quad\meta{rule}\arg{1/2}
% \end{quote}
%
% The macro |\adl@drawiii| for mode 3 is quite similar to |\adl@drawi|
% except that |\xleaders| is replaced by |\cleaders|.  This replacement is
% done by temporarily |\let|-ing |\xleaders| be equal to |\cleaders|.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
%    \begin{macrocode}
\def\adl@drawi#1#2#3{%
        #1{.5}#2.5\@tempdimb
        \xleaders#3{#2.5\@tempdimb #1{1}#2.5\@tempdimb}%
                #2\z@ plus1fil minus1fil\relax
        #2.5\@tempdimb #1{.5}}
\def\adl@drawii#1#2#3{%
        \setbox\adl@box#3{#2.5\@tempdimb #1{1}#2.5\@tempdimb}%
        #1{.5}#2.5\@tempdimb
        \copy\adl@box #2-\@tempdima #2-\@tempdimb
        \xleaders\copy\adl@box#2\z@ plus1fil minus1fil\relax
        #2-\@tempdima #2-\@tempdimb \copy\adl@box
        #2.5\@tempdimb #1{.5}}
\def\adl@drawiii#1#2#3{{\let\xleaders\cleaders \adl@drawi#1#2#3}}
\let\adl@draw\adl@drawi

%    \end{macrocode}
% 
% \begin{macro}{\ADLdrawingmode}
% \changes{v1.4-3-4}{1999/06/25}
%	{Introduced to specify drawing mode.}
% The macro |\ADLdrawingmode|\Meta{m} defines the drawing mode by |\let|-ing 
% |\adl@draw| be equal to |\adl@drawi| if $m=1$, and so on.  If \meta{m} is
% neither 1, 2 nor 3, it is assumed as 1.
% \end{macro}
%
%    \begin{macrocode}
\def\ADLdrawingmode#1{\ifcase #1%
        \let\adl@draw\adl@drawi \or
        \let\adl@draw\adl@drawi \or
        \let\adl@draw\adl@drawii \or
        \let\adl@draw\adl@drawiii \else
        \let\adl@draw\adl@drawi \fi}

%%^L
%    \end{macrocode}
% 
% 
% 
% \subsection{Shorthand Activation}
% \label{sec:imp-sh}
% \changes{v1.4-2}{1999/06/25}
%	{Section 4.13 is added.}
%
% \begin{macro}{\adl@Array}
% \changes{v1.4-3-3}{1999/06/25}
%	{Introduced as the body of \cs{Array}.}
% \begin{macro}{\adl@Tabular}
% \changes{v1.4-3-3}{1999/06/25}
%	{Introduced as the body of \cs{Tabular}.}
% \begin{macro}{\adl@Tabularstar}
% \changes{v1.4-3-3}{1999/06/25}
%	{Introduced as the body of \cs{Tabular*}.}
% The macros|\adl@Array|, |\adl@Tabular| and |\adl@Tabular*| start
% environments |array|, |tabular| and |tabular*| respectively, turning
% |\ifadl@inactive| false to activate dash-line functions.  We will |\let|
% macros |\Array| etc.\ be equal to them for shorthand activation.
% \end{macro}\end{macro}\end{macro}
%
%    \begin{macrocode}

%% Shorthand Activation

\def\adl@Array{\adl@inactivefalse \array}
\def\adl@Tabular{\adl@inactivefalse \tabular}
\def\adl@Tabularstar{\adl@inactivefalse \@nameuse{tabular*}}

%    \end{macrocode}
% 
% \begin{macro}{\adl@notdefinable}
% \changes{v1.4-3-3}{1999/06/25}
%	{Introduced to check if \cs{Array} etc. are definable.}
% Before making |\Array| etc.\ |\let|-equal to |\adl@Array| etc., we have to 
% check if these macros having too natural names have already used.  This
% check is done by |\@ifdefinable| that will call |\@notdefinable| for the
% complaint if undefinable.  Since we want to complain with our own
% warning message, |\@notdefinable| is temporarily |\def|-ined so that it
% simply |\def|-ines a macro |\adl@notdefinable| as empty.  Therefore,
% |\adl@notdefinebale| will have some definition if one of |\Array|,
% |\Tabular| and |\Tabular*| cannot be defined, while it will stay undefined 
% otherwise.
% \end{macro}
%
%    \begin{macrocode}
\begingroup
\def\@notdefinable{\gdef\adl@notdefinable{}}
\@ifdefinable\Array\relax
\@ifdefinable\Tabular\relax
\expandafter\@ifdefinable\csname Tabular*\endcsname\relax
\endgroup

%    \end{macrocode}
% 
% \begin{macro}{\Array}
% \changes{v1.4-3-3}{1999/06/25}
%	{Introduced as the always-active \cs{array}.}
% \begin{macro}{\Tabular}
% \changes{v1.4-3-3}{1999/06/25}
%	{Introduced as the always-active \cs{tabular}.}
% \begin{macro}{\Tabular*}
% \changes{v1.4-3-3}{1999/06/25}
%	{Introduced as the always-active \cs{tabular*}.}
% \begin{macro}{\endArray}
% \changes{v1.4-3-3}{1999/06/25}
%	{Introduced to \cs{end} the environment \texttt{Array}.}
% \begin{macro}{\endTabular}
% \changes{v1.4-3-3}{1999/06/25}
%	{Introduced to \cs{end} the environment \texttt{Tabular}.}
% \begin{macro}{\endTabular*}
% \changes{v1.4-3-3}{1999/06/25}
%	{Introduced to \cs{end} the environment \texttt{Tabular*}.}
% If |\adl@notdefinable| is |\undefined| indicating that all |\Array| etc.\
% are definable, we |\let| them be equal to |\adl@Array| etc.  We also
% |\let| ending macros |\endArray| etc.\ be equal to |\endarray| etc.
% 
% Otherwise, we complain with a warning message put by |\PackageWarning| if
% it is defined (i.e.\ \LaTeXe) or |\@warning| otherwise (i.e.\ \LaTeX-2.09).
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
%    \begin{macrocode}
\ifx\adl@notdefinable\undefined
        \let\Array\adl@Array
        \let\Tabular\adl@Tabular
        \expandafter\let\csname Tabular*\endcsname\adl@Tabularstar
        \let\endArray\endarray
        \let\endTabular\endtabular
        \expandafter\let\csname endTabular*\endcsname\endtabular
\else
\begingroup
\def\@tempa{Array and Tabular are not defined because they have\MessageBreak
        been defined}
\ifx\PackageWarning\undefined
        \def\MessageBreak{^^J}
        \@warning\@tempa
\else
        \let\on@line\empty
        \PackageWarning{arydshln}\@tempa
\fi
\endgroup
\fi

%    \end{macrocode}
% 
% \begin{macro}{\ADLnoshorthanded}
% \changes{v1.4-3-3}{1999/06/25}
%	{Introduced to nullify macros for shorthand activation.}
% If a user wishes to define an environment named |Array| or |Tabular(*)|
% by him/herself or by loading other packages {\em after} \textsf{arydshln}
% is loaded, |\newenvironment| for |Array| etc.\ will fail because they have 
% already been undefinable.  The macro |\ADLnoshorthanded| makes them
% definable again by |\let|-ing them and their ending counterparts be equal
% to |\realx|.
% \end{macro}
%
%    \begin{macrocode}
\def\ADLnoshorthanded{%
        \let\Array\relax
        \let\Tabular\relax
        \expandafter\let\csname Tabular*\endcsname\relax
        \let\endArray\relax
        \let\endTabular\relax
        \expandafter\let\csname endTabular*\endcsname\relax}
%    \end{macrocode}
% 
% \iffalse
%</package>
% \fi
% 
% 
% 
% \IndexPrologue{\newpage\section*{Index}
% Numbers written in italic refer to the page where the
% usage of corresoponding entry is described, and the rest to
% the page where the implementation is described.\endgraf
% 
% To find a control sequence, remove prefixes \cs{\@}, \cs{adl@} and 
% \cs{ifadl@} from its name if it has one of them.}
% \def\usage#1{\textit{#1}}
% \Finale
% \newpage
% \PrintChanges
\endinput
