
% \iffalse
%
% This file is part of the array package.
% ---------------------------------------
%
% This file was contributed. In case of error please inform the
% original author.
%
% \fi

%\iffalse
%%% ====================================================================
%%%  @LaTeX-style-file{
%%%     author          = "David Carlisle",
%%%     version         = "1.00",
%%%     date            = "06 July 1992",
%%%     time            = "16:05:31 BST",
%%%     filename        = "delarray.sty",
%%%     address         = "Computer Science Department
%%%                        Manchester University
%%%                        Oxford Road
%%%                        Manchester
%%%                        England
%%%                        M13 9PL",
%%%     telephone       = "+44 61 275 6139",
%%%     FAX             = "+44 61 275 6236",
%%%     checksum        = "48846 263 1116 9649",
%%%     email           = "carlisle@cs.man.ac.uk (Internet)",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "LaTeX,array,delimiters",
%%%     supported       = "yes",
%%%     docstring       = "
%%%
%%%     delarray.sty
%%%
%%%     A LaTeX style option extending array.sty.
%%%     Defines implicit delimiters, eg   \begin{array}({cc}).
%%%
%%%     The checksum field above was produced by
%%%     Robert Solovay's checksum utility.",
%%%  }
%%% ====================================================================
%\fi
%
\def\fileversion{v1.00}
\def\filedate{92/07/06}
\def\docdate {92/07/06}
%
% \CheckSum{124}
% \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         \~}
%
%
% \title{delarray.sty\thanks
%   {Version \fileversion, revised \filedate, documentation dated
%   \docdate}}
% \author{D. P. Carlisle}
% \date{06 July 1992}
% \maketitle
%
% \section{Examples}
%
%
% The addition to {\tt array.sty} added in {\tt delarray.sty} is
% a system of implicit "\left" "\right" pairs. If you want an array
% surrounded by parentheses, you can enter:\\
% "\begin{array}({cc})" \ldots
% \[  \begin{array}({cc})a&b\\c&d\end{array}   \]
%
% Similarly if an environment equivalent to \PlainTeX's "\cases" could
% be defined by:\\
% "\begin{array}\{{lL}." \ldots
%
% \newcolumntype{L}{>{$}l<{$}}
% \[  f(x)=\begin{array}\{{lL}.
%           0        &if $x=0$\\
%           \sin(x)/x&otherwise
%           \end{array}  \]
% Here "L" is supposed to denote a column of left aligned L-R text. It
% may be defined via: "\newcolumntype{L}{>{$}l<{$}}", as discussed in
% {\tt array.sty}.
% Note that as the delimiters must always be used in pairs, the  `"."'
% must be used to denote a  `null delimiter'.
%
% This feature is especially useful if the "[t]" or "[b]"
% arguments are also used. In these cases the result is not equivalent
% to surrounding the environment by "\left"\ldots"\right", as
% can be seen from the following example:
% \[
% \begin{array}[t]({c}) 1\\2\\3 \end{array}
% \begin{array}[c]({c}) 1\\2\\3 \end{array}
% \begin{array}[b]({c}) 1\\2\\3 \end{array}
% \quad\mbox{not}\quad
% \left(\begin{array}[t]{c} 1\\2\\3 \end{array}\right)
% \left(\begin{array}[c]{c} 1\\2\\3 \end{array}\right)
% \left(\begin{array}[b]{c} 1\\2\\3 \end{array}\right)
% \]
% \begin{verbatim}
% \begin{array}[t]({c}) 1\\2\\3 \end{array}
% \begin{array}[c]({c}) 1\\2\\3 \end{array}
% \begin{array}[b]({c}) 1\\2\\3 \end{array}
% \quad\mbox{not}\quad
% \left(\begin{array}[t]{c} 1\\2\\3 \end{array}\right)
% \left(\begin{array}[c]{c} 1\\2\\3 \end{array}\right)
% \left(\begin{array}[b]{c} 1\\2\\3 \end{array}\right)
% \end{verbatim}
%
%
% \StopEventually{}
%
% \section{The Macros}
%
%    \begin{macrocode}
%<*style>
\@ifundefined{del@array}{}{\endinput}
\wlog{Style-Option: `delarray' \fileversion
         \space\space <\filedate> (D.P.C.)}
\wlog{English documentation dated \space <\docdate> (D.P.C.)}
\@ifundefined{d@llarend}{\input{array.sty}}{}
%    \end{macrocode}
%
% \begin{macro}{\@tabarray}
%    This macro tests for an optional bracket and then calls up
%    "\@@array" or "\@@array[c]" (as default).
%    \begin{macrocode}
\def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@@array}
%    This macro tests for an optional delimiter before the left brace
%    of the main preamble argument. If there is no delimiter,
%    "\@arrayleft" and "\@arrayright" are made a no-ops, and
%    "\@array" is called with the positional argument. Otherwise
%    call "\@del@array".
%    \begin{macrocode}
\def\@@array[#1]{\@ifnextchar\bgroup
  {\let\@arrayleft\relax\let\@arrayright\relax\@array[#1]}%
  {\@del@array[#1]}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@del@array}
%    We now know that we have an {\tt array} (or {\tt tabular}) with
%    delimiters.
%    \begin{macrocode}
\def\@del@array[#1]#2#3#4{%
%    \end{macrocode}
% The following line is completely redundant but it does catch errors
% involving delimiters  before the processing of the alignment begins.
% A common error is likely to be omiting the `.' in a
% "\cases"-type construction. This causes the first token of the
% alignment to be gobbled, possibly causing lots of spurious errors
% before the cause of the error, the missing delimiter, is discovered as
% "\@arrayright" puts the alignment and the delimiters together.
%    \begin{macrocode}
  \setbox\z@\hbox{$\left#2\right#4$}%
%    \end{macrocode}
% In the case of a `c' argument we do not need to rebox the alignment,
% so we can define "\@arrayleft" and "\@arrayright" just to
% insert the delimiters.
%    \begin{macrocode}
  \if#1c\def\@arrayleft{\left#2}\def\@arrayright{\right#4}%
%    \end{macrocode}
% Otherwise we (should) have a {\tt[t] or [b]} argument, so first we
% store the alignment, without delimiters in box0.
%    \begin{macrocode}
  \else\def\@arrayleft{\setbox\z@}%
%    \end{macrocode}
% Then after the alignment is finished:
%    \begin{macrocode}
  \def\@arrayright{%
%    \end{macrocode}
% Calculate the amount the box needs to be lowered (this will be
% negative in the case of "[b]"). A little bit of arithmetic cf.\
% the \TeX{}Book, Appendix G, rule 8. We calculate the amount this
% way, rather than just taking the difference between the depth of box0
% and the depth of the box defined below, as the depth of that box may
% be affected by the delimiters if "\delimitershortfall" or
% "\delimiterfactor" have non-standard values.
%    \begin{macrocode}
     \dimen@=\dp\z@
     \advance\dimen@-\ht\z@
     \divide \dimen@ by \tw@
     \advance\dimen@ by\fontdimen22 \textfont\tw@
%    \end{macrocode}
% Now lower the alignment and the delimiters into place.
%    \begin{macrocode}
     \lower\dimen@\hbox{$\left#2\vcenter{\unvbox\z@}\right#4$}}%
%    \end{macrocode}
% End the "\if#1c"
%    \begin{macrocode}
  \fi
%    \end{macrocode}
% Now that we have defined "\@arrayleft" and "\@arrayright", call
% "\@array".
%    \begin{macrocode}
  \@array[#1]{#3}}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%</style>
%    \end{macrocode}
%
%
% \subsection{newarray.sty}
% All the features of the old {\tt newarray} style option have been
% merged into the {\tt array} or {\tt delarray} options. We now supply a
% dummy {\tt newarray} style option informing people of this fact.
%    \begin{macrocode}
%<+newarray>\typeout{\@spaces ****^^J%
%<+newarray>\@spaces newarray.sty is no longer supported.^^J%
%<+newarray>\@spaces For \noexpand\newcolumn
%<+newarray>   and \noexpand\extracolsep use array.sty.^^J%
%<+newarray>\@spaces(\noexpand\newcolumn has been
%<+newarray>   renamed \string\newcolumntype.)^^J%
%<+newarray>\@spaces For implicit delimiters use delarray.sty^^J%
%<+newarray>\@spaces ****}
%<+newarray>\errhelp{Modify the options in the \documentstyle command}%
%<+newarray>\errmessage{Obsolete Style Option}%
%    \end{macrocode}
%
%
% \section{The documentation driver file}
%
% The next bit of code contains the documentation driver file for
% \TeX{}, i.e., the file that will produce the documentation you are
% currently reading. It will be extracted from this file by the {\tt
% docstrip} program.
%    \begin{macrocode}
%<+driver>\documentstyle[delarray,doc]{article}
%<+driver>
%<+driver>% dimensions from ltugboat.sty:
%<+driver>
%<+driver>\setlength\textwidth{31pc} \setlength\textheight{54pc}
%<+driver>\parindent 0pt \parskip 2pt plus 1pt minus 1pt
%<+driver>\setlength{\oddsidemargin}{8pc}
%<+driver>\setlength{\marginparwidth}{8pc}
%<+driver>\setlength{\topmargin}{-2.5pc}
%<+driver>\setlength{\headsep}{20pt}
%<+driver>\setlength{\columnsep}{1.5pc}
%<+driver>\setlength{\columnwidth}{18.75pc}
%<+driver>
%<+driver>\MakeShortVerb{\"}  % "\foo" acts like \verb+\foo+
%<+driver>
%<+driver>\DisableCrossrefs
%<+driver>
%<+driver>\CodelineIndex                  % Index code by line number
%<+driver>
%<+driver>%\OnlyDescription    % comment out for implementation details
%<+driver>
%<+driver>\setcounter{StandardModuleDepth}{1}
%<+driver>
%<+driver>\begin{document}
%<+driver>   \DocInput{delarray.doc}
%<+driver>\end{document}
%    \end{macrocode}
%
%
% \Finale
\endinput
