| 1 |
% |
| 2 |
% \iffalse meta-comment |
| 3 |
% |
| 4 |
% Copyright 1995, 1999 American Mathematical Society. |
| 5 |
% Copyright 2016-2017 LaTeX3 Project and American Mathematical Society. |
| 6 |
% Copyright 2019 Martin Vermeer. |
| 7 |
% |
| 8 |
% This work may be distributed and/or modified under the |
| 9 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 10 |
% of this license or (at your option) any later version. |
| 11 |
% The latest version of this license is in |
| 12 |
% https://www.latex-project.org/lppl.txt |
| 13 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 14 |
% version 2005/12/01 or later. |
| 15 |
% |
| 16 |
% This work has the LPPL maintenance status `maintained'. |
| 17 |
% |
| 18 |
% The Current Maintainer of this work is Martin Vermeer. |
| 19 |
% |
| 20 |
% \fi |
| 21 |
% |
| 22 |
%\iffalse |
| 23 |
%<*driver> |
| 24 |
\documentclass{amsdtx} |
| 25 |
\usepackage{amscdx} |
| 26 |
\usepackage{amsmath,calc} |
| 27 |
\GetFileInfo{amscdx.sty} |
| 28 |
% Dummy citation to avoid error in an example. |
| 29 |
\bibcite{fre:cichon}{C} |
| 30 |
\begin{document} |
| 31 |
\title{The \pkg{amscd\textcolor[RGB]{255,0,0}{x}} package} |
| 32 |
\author{\textcolor{red}{Martin Vermeer}\thanks{firstname.lastname$@$aalto.fi},\\ |
| 33 |
based on \pkg{amscd} by\\ |
| 34 |
Frank Mittelbach, Rainer Sch\"opf and Michael Downes} |
| 35 |
\date{Version \fileversion, \filedate} |
| 36 |
\DocInput{amscdx.dtx} |
| 37 |
\end{document} |
| 38 |
%</driver> |
| 39 |
%\fi |
| 40 |
% |
| 41 |
% \maketitle |
| 42 |
% This file is maintained by Martin Vermeer.\\% |
| 43 |
% |
| 44 |
% \MakeShortVerb\| |
| 45 |
% \renewcommand{\operatorname}[1]{\mathop{\mathrm{#1}}} |
| 46 |
% \newcommand{\per}{\operatorname{per}} |
| 47 |
% \newcommand{\cov}{\operatorname{cov}} |
| 48 |
% \newcommand{\non}{\operatorname{non}} |
| 49 |
% \newcommand{\cf}{\operatorname{cf}} |
| 50 |
% \newcommand{\add}{\operatorname{add}} |
| 51 |
% \newcommand{\End}{\operatorname{End}} |
| 52 |
% |
| 53 |
% \renewcommand{\labelitemi}{$\circ$} |
| 54 |
% |
| 55 |
% \section{Introduction} |
| 56 |
% |
| 57 |
% The \pkg{amscd} package provides a \env{CD} environment that |
| 58 |
% emulates the commutative diagram capabilities of \amstex/ version |
| 59 |
% 2.x. This means that only simple rectangular diagrams are |
| 60 |
% supported, with no diagonal arrows or more exotic features. Many |
| 61 |
% users will be better served by one of the more powerful diagram |
| 62 |
% packages such as \pkg{diagram}, \pkg{xypic}, \pkg{xymatrix}, |
| 63 |
% \pkg{kuvio}, or \pkg{tikz-cd}. |
| 64 |
% |
| 65 |
% Example: |
| 66 |
% \begin{equation}\begin{CD} |
| 67 |
% S^{{\mathcal{W}}_\Lambda}\otimes T @>j>> T\\ |
| 68 |
% @VVV @VV{\End P}V\\ |
| 69 |
% (S\otimes T)/I @= (Z\otimes T)/J |
| 70 |
% \end{CD}\end{equation} |
| 71 |
% \begin{verbatim} |
| 72 |
% \begin{equation}\begin{CD} |
| 73 |
% S^{{\mathcal{W}}_\Lambda}\otimes T @>j>> T\\ |
| 74 |
% @VVV @VV{\End P}V\\ |
| 75 |
% (S\otimes T)/I @= (Z\otimes T)/J |
| 76 |
% \end{CD}\end{equation} |
| 77 |
% \end{verbatim} |
| 78 |
% (assuming \cn{End} is defined as an `operator name'. |
| 79 |
% |
| 80 |
% Another example: |
| 81 |
% |
| 82 |
% We will make liberal use of Cichon's Diagram \cite{fre:cichon}: |
| 83 |
% \begin{equation} |
| 84 |
% \begin{CD} |
| 85 |
% \cov(\mathcal{L}) @>>> \non(\mathcal{K}) @>>> \cf(\mathcal{K}) @>>> |
| 86 |
% \cf(\mathcal{L})\\ |
| 87 |
% @VVV @AAA @AAA @VVV\\ |
| 88 |
% \add(\mathcal{L}) @>>> \add(\mathcal{K}) @>>> \cov(\mathcal{K}) @>>> |
| 89 |
% \non(\mathcal{L}) |
| 90 |
% \end{CD}\end{equation} |
| 91 |
% \begin{verbatim} |
| 92 |
% \begin{equation}\begin{CD} |
| 93 |
% \cov(\mathcal{L}) @>>> \non(\mathcal{K}) @>>> \cf(\mathcal{K}) @>>> |
| 94 |
% \cf(\mathcal{L})\\ |
| 95 |
% @VVV @AAA @AAA @VVV\\ |
| 96 |
% \add(\mathcal{L}) @>>> \add(\mathcal{K}) @>>> \cov(\mathcal{K}) @>>> |
| 97 |
% \non(\mathcal{L}) |
| 98 |
% \end{CD}\end{equation} |
| 99 |
% \end{verbatim} |
| 100 |
% |
| 101 |
% \section{\color[RGB]{255,0,0}Enhancements in amscdx} |
| 102 |
% We implemented double ("fat") and dashed arrows in both directions, |
| 103 |
% and color attributes for arrows and their annotations. |
| 104 |
% Naming scheme: |
| 105 |
% \begin{itemize} |
| 106 |
% \item The left-right double arrow \verb+@ZZZ+ |
| 107 |
% \item The up-down double arrow \verb+@XXX+. |
| 108 |
% \end{itemize} |
| 109 |
% |
| 110 |
% The color, a defined \verb+xcolor+ color name, can be added to an arrow by |
| 111 |
% inserting \verb+\CDlor{<+\textit{color}\verb+>}+ into the diagram before, i.e., |
| 112 |
% to the immediate left of, the arrow that you wish to color. The command |
| 113 |
% affects all arrows following it, so cancel it by the command |
| 114 |
% \verb+\CDlor{black}+. If you want to change the color of all the arrows, you |
| 115 |
% can place the color command outside and before the \verb+CD+ environment. |
| 116 |
% |
| 117 |
% Double arrows are obtained by inserting \verb+\CDfattrue+ into the diagram |
| 118 |
% before, i.e., to the immediate left of, the arrow that you wish to be |
| 119 |
% doubled. The command only affects the arrow immediately following it. To |
| 120 |
% change the whole diagram to double arrows, place the \verb+\CDfattrue+ command |
| 121 |
% outside and before the \verb+CD+ environment. If you do that, you can exempt |
| 122 |
% individual arrows, i.e., make them single again, by the command |
| 123 |
% \verb+\CDfatfalse+. |
| 124 |
% |
| 125 |
% A similar technique applies for obtaining dashed arrows, but with the |
| 126 |
% boolean (flag) \verb+\CDash+, i.e., the command \verb+\CDashtrue+ will give |
| 127 |
% a dashed arrow, while \verb+\CDashfalse+ will turn it off. \verb+\CDash+ |
| 128 |
% will only work if the state of the \verb+\CDfat+ flag be false. If both |
| 129 |
% \verb+\CDfat+ and \verb+\CDash+ are true, the \verb+CDfat+ flag takes |
| 130 |
% precedence. |
| 131 |
% |
| 132 |
% \subsection*{Dependencies} |
| 133 |
% |
| 134 |
% \begin{itemize} |
| 135 |
% \item the \verb+xcolor+ package, for the color; |
| 136 |
% \item the \verb+graphics+ package, if you want vertical dashed arrows, |
| 137 |
% as this uses the \verb+\rotatebox+ command. |
| 138 |
% \end{itemize} |
| 139 |
% These are now required within the package. |
| 140 |
% |
| 141 |
% \subsection*{Option} |
| 142 |
% The package takes one option: \verb+lyx+, to be issued if you use it |
| 143 |
% in LyX. Place, in the preamble, the command \verb+\usepackage[lyx]{amscdx}+. |
| 144 |
% This forces a \verb+\renewenvironment{CD}+ to be called instead of |
| 145 |
% \verb+\newenvironment{CD}+, as \verb+CD+ is already defined. |
| 146 |
% |
| 147 |
% A demonstration of some of the new capabilities (yes, this looks tacky): |
| 148 |
% \begin{equation} |
| 149 |
% \CDfattrue |
| 150 |
% \CDlor{green} |
| 151 |
% \begin{CD} |
| 152 |
% \text{Left header} @. \text{Right header} \\ |
| 153 |
% TL \CDfatfalse\CDashtrue @Z\text{Atop}Z{\hspace{4cm}}Z TR \\ |
| 154 |
% \CDfatfalse @X\text{Left}X{N_x}X |
| 155 |
% \CDfatfalse \CDashtrue |
| 156 |
% \CDlor{brown} @A{\scriptsize\begin{array}{r}\text{Right}\\ |
| 157 |
% \text{column}\end{array}}A{N^x}A \\ |
| 158 |
% ML \CDfatfalse \CDashtrue \CDlor{lime} @<{xyzxyzxyz}<{pqr}< MR \\ |
| 159 |
% \CDlor{red} @A{M^2}A\scriptsize\begin{array}{l}\text{Left}\\ |
| 160 |
% \text{column}\end{array}A @V+V{N_y}V \\ |
| 161 |
% BL \CDlor{purple} @Z\text{above}Z\text{below}Z BR \\ |
| 162 |
% \end{CD} |
| 163 |
% \end{equation} |
| 164 |
% \begin{verbatim} |
| 165 |
% \begin{equation} |
| 166 |
% \CDfattrue |
| 167 |
% \CDlor{green} |
| 168 |
% \begin{CD} |
| 169 |
% \text{Left header} @. \text{Right header} \\ |
| 170 |
% TL \CDfatfalse\CDashtrue @Z\text{Atop}Z{\hspace{4cm}}Z TR \\ |
| 171 |
% \CDfatfalse @X\text{Left}X{N_x}X |
| 172 |
% \CDfatfalse \CDashtrue |
| 173 |
% \CDlor{brown} @A{\scriptsize\begin{array}{r}\text{Right}\\ |
| 174 |
% \text{column}\end{array}}A{N^x}A \\ |
| 175 |
% ML \CDfatfalse \CDashtrue \CDlor{lime} @<{xyzxyzxyz}<{pqr}< MR \\ |
| 176 |
% \CDlor{red} @A{M^2}A\scriptsize\begin{array}{l}\text{Left}\\ |
| 177 |
% \text{column}\end{array}A @V+V{N_y}V \\ |
| 178 |
% BL \CDlor{purple} @Z\text{above}Z\text{below}Z BR \\ |
| 179 |
% \end{CD} |
| 180 |
% \end{equation} |
| 181 |
% \end{verbatim} |
| 182 |
% \hrule |
| 183 |
% \bigskip |
| 184 |
% |
| 185 |
% \StopEventually{} |
| 186 |
% |
| 187 |
% Standard package info. |
| 188 |
% \begin{macrocode} |
| 189 |
\NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX) |
| 190 |
[1994/12/01]% LaTeX date must December 1994 or later |
| 191 |
\ProvidesPackage{amscdx}[2019/07/02 v2.2x AMS Commutative Diagrams] |
| 192 |
% \end{macrocode} |
| 193 |
% \begin{macrocode} |
| 194 |
|
| 195 |
\newif\iflyx\lyxfalse |
| 196 |
\DeclareOption{lyx}{\lyxtrue} |
| 197 |
|
| 198 |
\DeclareOption*{} |
| 199 |
\ProcessOptions*\relax |
| 200 |
|
| 201 |
\RequirePackage{amsgen} |
| 202 |
\RequirePackage{xcolor} |
| 203 |
\RequirePackage{graphicx} |
| 204 |
% \end{macrocode} |
| 205 |
% Better not to redefine \verb|\math@cr| if it is already defined, |
| 206 |
% because for CD use only we want to omit the part of the code |
| 207 |
% related to \verb|\dspbrk@lvl| (see \fn{amsmath.sty}). |
| 208 |
% |
| 209 |
% [mjd,1999/11/04] These definitions have gone somewhat obsolete; but |
| 210 |
% we had probably better leave them as they are for backward |
| 211 |
% compatibility. |
| 212 |
% \begin{macrocode} |
| 213 |
\@ifundefined{math@cr}{% |
| 214 |
\def\math@cr{{\ifnum0=`}\fi |
| 215 |
\@ifstar{\global\@eqpen\@M\math@cr@}% |
| 216 |
{\global\@eqpen\interdisplaylinepenalty \math@cr@}} |
| 217 |
% \end{macrocode} |
| 218 |
% The following section merely duplicates some code from the |
| 219 |
% \pkg{amsmath} package, in case the \pkg{amscdx} package is used by |
| 220 |
% itself. For documentation of the code refer to \fn{amsmath.dtx}. |
| 221 |
% \begin{macrocode} |
| 222 |
\def\math@cr@{\new@ifnextchar[\math@cr@@{\math@cr@@[\z@]}} |
| 223 |
\def\math@cr@@[#1]{\ifnum0=`{\fi}\math@cr@@@ |
| 224 |
\noalign{\vskip#1\relax}} |
| 225 |
\def\restore@math@cr{\def\math@cr@@@{\cr}} |
| 226 |
}{} |
| 227 |
\restore@math@cr |
| 228 |
% \end{macrocode} |
| 229 |
% [mjd,1999/11/04] These definitions too are somewhat obsolete; |
| 230 |
% but we had probably better leave them as they are for backward |
| 231 |
% compatibility. |
| 232 |
% \begin{macrocode} |
| 233 |
% |
| 234 |
\def\clap#1{\hbox to 0pt{\hss#1\hss}} |
| 235 |
% |
| 236 |
\newif\ifCDfat |
| 237 |
\newif\ifCDash |
| 238 |
\def\dye@{black} |
| 239 |
\def\CDlor#1{\gdef\dye@{#1}} % must be gdef |
| 240 |
% |
| 241 |
% |
| 242 |
\@ifundefined{rightarrowfill@}{ |
| 243 |
\def\rightarrowfill@#1{% |
| 244 |
\m@th\setboxz@h{$#1\relbar$}\ht\z@\z@ |
| 245 |
$#1\copy\z@\mkern-6mu\cleaders |
| 246 |
\hbox{$#1\mkern-2mu\box\z@\mkern-2mu$}\hfill |
| 247 |
\mkern-6mu\mathord\rightarrow$} |
| 248 |
\def\leftarrowfill@#1{% |
| 249 |
\m@th\setboxz@h{$#1\relbar$}\ht\z@\z@ |
| 250 |
$#1\mathord\leftarrow\mkern-6mu\cleaders% |
| 251 |
\hbox{$#1\mkern-2mu\copy\z@\mkern-2mu$}\hfill |
| 252 |
\mkern-6mu\box\z@$} |
| 253 |
\def\leftrightarrowfill@#1{% |
| 254 |
\m@th\setboxz@h{$#1\relbar$}\ht\z@\z@ |
| 255 |
$#1\mathord\leftarrow\mkern-6mu\cleaders |
| 256 |
\hbox{$#1\mkern-2mu\box\z@\mkern-2mu$}\hfill |
| 257 |
\mkern-6mu\mathord\rightarrow$} |
| 258 |
}{} |
| 259 |
% \end{macrocode} |
| 260 |
% |
| 261 |
% Added double arrows |
| 262 |
% |
| 263 |
% \begin{macrocode} |
| 264 |
\def\Rightarrowfill@#1{% |
| 265 |
\m@th\setboxz@h{$#1\Relbar$}\ht\z@\z@ |
| 266 |
$#1\copy\z@\mkern-6mu\cleaders |
| 267 |
\hbox{$#1\mkern-2mu\box\z@\mkern-2mu$}\hfill |
| 268 |
\mkern-6mu\mathord\Rightarrow$} |
| 269 |
\def\Leftarrowfill@#1{% |
| 270 |
\m@th\setboxz@h{$#1\Relbar$}\ht\z@\z@ |
| 271 |
$#1\mathord\Leftarrow\mkern-6mu\cleaders% |
| 272 |
\hbox{$#1\mkern-2mu\copy\z@\mkern-2mu$}\hfill |
| 273 |
\mkern-6mu\box\z@$} |
| 274 |
\def\Leftrightarrowfill@#1{% |
| 275 |
\m@th\setboxz@h{$#1\Relbar$}\ht\z@\z@ |
| 276 |
$#1\mathord\Leftarrow\mkern-6mu\cleaders |
| 277 |
\hbox{$#1\mkern-2mu\box\z@\mkern-2mu$}\hfill |
| 278 |
\mkern-6mu\mathord\Rightarrow$} |
| 279 |
% |
| 280 |
\def\rightdasharrowfill@#1{% |
| 281 |
\m@th\setboxz@h{$#1\:\relbar\:$}\ht\z@\z@ |
| 282 |
$#1\copy\z@\mkern-6mu\cleaders |
| 283 |
\hbox{$#1\mkern-2mu\box\z@\mkern-2mu$}\hfill |
| 284 |
\mkern-2mu\mathord\rightarrow$} |
| 285 |
\def\leftdasharrowfill@#1{% |
| 286 |
\m@th\setboxz@h{$#1\:\relbar\:$}\ht\z@\z@ |
| 287 |
$#1\mathord\leftarrow\mkern-2mu\cleaders% |
| 288 |
\hbox{$#1\mkern-2mu\copy\z@\mkern-2mu$}\hfill |
| 289 |
\mkern-6mu\box\z@$} |
| 290 |
\def\leftrightdasharrowfill@#1{% |
| 291 |
\m@th\setboxz@h{$#1\:\relbar\:$}\ht\z@\z@ |
| 292 |
$#1\mathord\leftarrow\mkern-2mu\cleaders |
| 293 |
\hbox{$#1\mkern-2mu\box\z@\mkern-2mu$}\hfill |
| 294 |
\mkern-2mu\mathord\rightarrow$} |
| 295 |
% \end{macrocode} |
| 296 |
% |
| 297 |
% \begin{macrocode} |
| 298 |
\def\atdef@#1{\expandafter\def\csname\space @\string#1\endcsname} |
| 299 |
\@ifundefined{Iat}{% |
| 300 |
\DeclareRobustCommand{\Iat}{\FN@\at@} |
| 301 |
}{} |
| 302 |
\begingroup \catcode`\@=\active |
| 303 |
% \end{macrocode} |
| 304 |
% Define math \qc{\@} to replicate its mathcode-dictated behavior. |
| 305 |
% This is in case \qc{\@} occurs outside of \env{CD}. |
| 306 |
% \begin{macrocode} |
| 307 |
\csname if\string @compatibility\endcsname |
| 308 |
\else \fam=\mathcode`\@ |
| 309 |
\xdef @{\mathchar\number\fam\space } |
| 310 |
\fi |
| 311 |
\gdef\CDat{\let @=\Iat} |
| 312 |
\endgroup |
| 313 |
\mathcode`\@="8000 % make @ pseudo-active in math |
| 314 |
\def\at@{\let\next@\at@@ |
| 315 |
\ifcat\noexpand\next a\else |
| 316 |
\ifcat\noexpand\next0\else |
| 317 |
\ifcat\noexpand\next\relax\else |
| 318 |
\let\next@\at@@@\fi\fi\fi\next@} |
| 319 |
\def\at@@#1{\expandafter |
| 320 |
\ifx\csname\space @\string#1\endcsname\relax |
| 321 |
\DN@{\at@@@#1}% |
| 322 |
\else |
| 323 |
\DN@{\csname\space @\string#1\endcsname}% |
| 324 |
\fi\next@}% |
| 325 |
% \end{macrocode} |
| 326 |
% The following items should be defined only if they are not |
| 327 |
% already defined, either to leave the package name untouched (in |
| 328 |
% the case of \cs{PackageError}) or to avoid redundant allocation |
| 329 |
% of token or dimen registers. |
| 330 |
% \begin{macrocode} |
| 331 |
\@ifundefined{default@tag}{% |
| 332 |
\def\default@tag{% |
| 333 |
\def\tag{\PackageError{amscdx}{\protect\tag\space not allowed |
| 334 |
here}\@eha}}% |
| 335 |
}{}% |
| 336 |
\@ifundefined{at@@@}{% |
| 337 |
\def\at@@@{\PackageError{amscdx}{\Invalid@@ @}{\the\athelp@}\char64\relax} |
| 338 |
}{} |
| 339 |
\@ifundefined{athelp@}{\csname newhelp\endcsname\athelp@ |
| 340 |
{Only certain combinations beginning with @ make sense to me.^^J% |
| 341 |
I'll assume you wanted @@ for a printed @.}}{} |
| 342 |
\@ifundefined{minaw@}{\newdimen\minaw@}{} |
| 343 |
\@ifundefined{bigaw@}{\newdimen\bigaw@}{} |
| 344 |
% \end{macrocode} |
| 345 |
% |
| 346 |
% Assignment of a couple of dimensions, and initialization of |
| 347 |
% \verb=\ampersand@=. We check to see if we need to define |
| 348 |
% \verb=\minaw@= and \verb=\bigaw@=. |
| 349 |
% \begin{macrocode} |
| 350 |
\[email protected] |
| 351 |
\newdimen\minCDarrowwidth |
| 352 |
\minCDarrowwidth2.5pc |
| 353 |
\newif\ifCD@ |
| 354 |
\let\ampersand@\relax |
| 355 |
% \end{macrocode} |
| 356 |
% |
| 357 |
% Added \verb|\restore@math@cr\default@tag| to fix line numbering |
| 358 |
% problems, 7-JUN-1991. Suggested by I.~Zakharevich. |
| 359 |
% \begin{macrocode} |
| 360 |
\iflyx\else\newenvironment{CD}{}{}\fi |
| 361 |
\renewenvironment{CD}{% |
| 362 |
\CDat |
| 363 |
\bgroup\relax\iffalse{\fi\let\ampersand@&\iffalse}\fi |
| 364 |
\CD@true\vcenter\bgroup\let\\\math@cr\restore@math@cr\default@tag |
| 365 |
\tabskip\z@skip\baselineskip20\ex@ |
| 366 |
\lineskip3\ex@\lineskiplimit3\ex@\halign\bgroup |
| 367 |
&\hfill$\m@th##$\hfill\crcr |
| 368 |
}{% |
| 369 |
\crcr\egroup\egroup\egroup |
| 370 |
} |
| 371 |
% \end{macrocode} |
| 372 |
% |
| 373 |
% \begin{macro}{\CD@check} |
| 374 |
% This check is used by all macros that must not appear outside the |
| 375 |
% \env{CD} environment. The first argument is the symbol to be used |
| 376 |
% after \verb+@+, the second one the action to be performed. |
| 377 |
% |
| 378 |
% Once again we use the trick of defining a temporary control |
| 379 |
% sequence \verb+\next@+ and calling it after the final \verb+\fi+. |
| 380 |
% This is not absolutely necessary, but it ensures that the |
| 381 |
% conditional text is processed in one and the same column |
| 382 |
% of the enclosing alignment. |
| 383 |
% \begin{macrocode} |
| 384 |
\def\CD@check#1#2{\ifCD@\DN@{#2}\else |
| 385 |
\DN@{\PackageError{amscdx}{@\protect#1 not |
| 386 |
allowed outside of the CD environment}\@eha}% |
| 387 |
\fi\next@} |
| 388 |
% \end{macrocode} |
| 389 |
% \end{macro} |
| 390 |
% |
| 391 |
% The boolean \verb+\ifCDfat+ has scope only within a table cell: |
| 392 |
% |
| 393 |
% \begin{macrocode} |
| 394 |
\atdef@>#1>#2>{% |
| 395 |
\ifCDfat\gdef\ar@{\Rightarrowfill@}\else\ifCDash\gdef\ar@{\rightdasharrowfill@}\else\gdef\ar@{\rightarrowfill@}\fi\fi |
| 396 |
\gdef\before@{\dye@} |
| 397 |
\ampersand@ |
| 398 |
\ifCD@ \global\bigaw@\minCDarrowwidth \else \global\bigaw@\minaw@ \fi |
| 399 |
\setboxz@h{$\m@th\scriptstyle\;{#1}\;\;$}% |
| 400 |
\ifdim\wdz@>\bigaw@\global\bigaw@\wdz@\fi |
| 401 |
% \end{macrocode} |
| 402 |
% If \verb|#2| is empty we can save some work. |
| 403 |
% \begin{macrocode} |
| 404 |
\@ifnotempty{#2}{\setbox\@ne\hbox{$\m@th\scriptstyle\;{#2}\;\;$}% |
| 405 |
\ifdim\wd\@ne>\bigaw@\global\bigaw@\wd\@ne\fi}% |
| 406 |
\ifCD@\enskip\fi |
| 407 |
\color{\before@}\mathrel{\mathop{\hbox to\bigaw@{\ar@\displaystyle}}% |
| 408 |
\limits^{#1}\@ifnotempty{#2}{_{#2}}}% |
| 409 |
\ifCD@\enskip\fi \ampersand@} |
| 410 |
% |
| 411 |
\atdef@<#1<#2<{% |
| 412 |
\ifCDfat\gdef\ar@{\Leftarrowfill@}\else\ifCDash\gdef\ar@{\leftdasharrowfill@}\else\gdef\ar@{\leftarrowfill@}\fi\fi |
| 413 |
\gdef\before@{\dye@} |
| 414 |
\ampersand@ |
| 415 |
\ifCD@ \global\bigaw@\minCDarrowwidth \else \global\bigaw@\minaw@ \fi |
| 416 |
\setboxz@h{$\m@th\scriptstyle\;\;{#1}\;$}% |
| 417 |
\ifdim\wdz@>\bigaw@ \global\bigaw@\wdz@ \fi |
| 418 |
\@ifnotempty{#2}{\setbox\@ne\hbox{$\m@th\scriptstyle\;\;{#2}\;$}% |
| 419 |
\ifdim\wd\@ne>\bigaw@ \global\bigaw@\wd\@ne \fi}% |
| 420 |
\ifCD@\enskip\fi |
| 421 |
\color{\before@}\mathrel{\mathop{\hbox to\bigaw@{\ar@\displaystyle}}% |
| 422 |
\limits^{#1}\@ifnotempty{#2}{_{#2}}}% |
| 423 |
\ifCD@\enskip\fi \ampersand@} |
| 424 |
% \end{macrocode} |
| 425 |
% |
| 426 |
% \begin{macrocode} |
| 427 |
\atdef@ Z#1Z#2Z{\CD@check{x..x..x}{% |
| 428 |
\ifCDfat\gdef\ar@{\Leftrightarrowfill@}\else\ifCDash\gdef\ar@{\leftrightdasharrowfill@}\else\gdef\ar@{\leftrightarrowfill@}\fi\fi |
| 429 |
\gdef\before@{\dye@} |
| 430 |
\ampersand@ |
| 431 |
\ifCD@ \global\bigaw@\minCDarrowwidth \else \global\bigaw@\minaw@ \fi |
| 432 |
\setboxz@h{$\m@th\scriptstyle\;\;{#1}\;$}% |
| 433 |
\ifdim\wdz@>\bigaw@ \global\bigaw@\wdz@ \fi |
| 434 |
\@ifnotempty{#2}{\setbox\@ne\hbox{$\m@th\scriptstyle\;\;{#2}\;$}% |
| 435 |
\ifdim\wd\@ne>\bigaw@ \global\bigaw@\wd\@ne \fi}% |
| 436 |
\ifCD@\enskip\fi |
| 437 |
\color{\before@}\mathrel{\mathop{\hbox to\bigaw@{\ar@\displaystyle}}% |
| 438 |
\limits^{#1}\@ifnotempty{#2}{_{#2}}}% |
| 439 |
\ifCD@\enskip\fi \ampersand@}} |
| 440 |
% \end{macrocode} |
| 441 |
% |
| 442 |
% Variants of the above two arrows, using \verb|(| and \verb|)| |
| 443 |
% characters instead of \verb|<| and \verb|>| characters, are |
| 444 |
% provided for those whose keyboards don't have the latter. |
| 445 |
% \begin{macrocode} |
| 446 |
\begingroup \catcode`\~=\active \lccode`\~=`\@ |
| 447 |
\lowercase{% |
| 448 |
\global\atdef@)#1)#2){~>#1>#2>} |
| 449 |
\global\atdef@(#1(#2({~<#1<#2<} |
| 450 |
}% end lowercase |
| 451 |
\endgroup |
| 452 |
% \end{macrocode} |
| 453 |
% |
| 454 |
% \begin{macrocode} |
| 455 |
\atdef@ A#1A#2A{\CD@check{A..A..A}{\color{\dye@}\llap{$\m@th\vcenter{\hbox |
| 456 |
{$\scriptstyle#1$}}$} |
| 457 |
\ifCDfat \Big\Uparrow \else |
| 458 |
\ifCDash \vphantom{\Bigg\Updownarrow}\text{\rotatebox{90}{\clap{$\mkern8mu\relbar\:\relbar\mkern-2mu\rightarrow$}}} |
| 459 |
\else \Big\uparrow \fi \fi |
| 460 |
\rlap{$\m@th\vcenter{\hbox{$\scriptstyle#2$}}$}&&}} |
| 461 |
% |
| 462 |
\atdef@ V#1V#2V{\CD@check{V..V..V}{\color{\dye@}\llap{$\m@th\vcenter{\hbox |
| 463 |
{$\scriptstyle#1$}}$} |
| 464 |
\ifCDfat \Big\Downarrow \else |
| 465 |
\ifCDash \vphantom{\Bigg\Updownarrow}\text{\rotatebox{270}{\clap{$\mkern-8mu\relbar\:-\mkern-2mu\rightarrow$}}} |
| 466 |
\else \Big\downarrow \fi \fi |
| 467 |
\rlap{$\m@th\vcenter{\hbox{$\scriptstyle#2$}}$}&&}} |
| 468 |
% |
| 469 |
\atdef@ X#1X#2X{\CD@check{X..X..X}{\color{\dye@}\llap{$\m@th\vcenter{\hbox |
| 470 |
{$\scriptstyle#1$}}$} |
| 471 |
\ifCDfat \Big\Updownarrow \else |
| 472 |
\ifCDash \vphantom{\Bigg\Updownarrow}\text{\rotatebox{90}{\clap{$\mkern8mu\leftarrow\mkern-2mu\relbar\mkern-2mu\rightarrow$}}} |
| 473 |
\else \Big\updownarrow \fi \fi |
| 474 |
\rlap{$\m@th\vcenter{\hbox{$\scriptstyle#2$}}$}&&}} |
| 475 |
% |
| 476 |
\atdef@={\CD@check={\gdef\before@{\dye@}&\color{\before@}\enskip\mathrel |
| 477 |
{\vbox{\hrule\@width\minCDarrowwidth\vskip2\ex@\hrule\@width |
| 478 |
\minCDarrowwidth}}\enskip&}} |
| 479 |
% |
| 480 |
\atdef@|{\CD@check|{\color{\dye@}\Big\Vert&&}} |
| 481 |
% |
| 482 |
\atdef@\vert{\CD@check\vert{\color{\dye@}\Big\Vert&&}} |
| 483 |
% |
| 484 |
\atdef@.{\CD@check.{&&}} |
| 485 |
% \end{macrocode} |
| 486 |
% |
| 487 |
% The \cn{pretend} command has weird syntax that doesn't fit well |
| 488 |
% with standard \latex/ syntax so we leave it undone, at least for |
| 489 |
% now. [mjd,1994/10/27] |
| 490 |
% \begin{macrocode} |
| 491 |
%\def\pretend#1\haswidth#2{\setboxz@h{$\m@th\scriptstyle{#2}$}\hbox |
| 492 |
% to\wdz@{\hfill$\m@th\scriptstyle{#1}$\hfill}} |
| 493 |
% \end{macrocode} |
| 494 |
% |
| 495 |
% The usual \cs{endinput} to ensure that random garbage at the end of |
| 496 |
% the file doesn't get copied by \fn{docstrip}. |
| 497 |
% \begin{macrocode} |
| 498 |
\endinput |
| 499 |
% \end{macrocode} |
| 500 |
% |
| 501 |
% \CheckSum{829} |
| 502 |
% \Finale |