Debian Codegraph @

texmf-dist/tex/generic/xypic/xymatrix.tex

raw
1 %% xymatrix.tex from $Id: xymatrix.doc,v 3.14 2011/03/31 06:10:57 krisrose Exp $
2 %%
3 %% Xy-pic ``Matrix'' feature.
4 %% Copyright (c) 1991-2011 Kristoffer H. Rose <[email protected]>
5 %%
6 %% This file is part of the Xy-pic package for graphs and diagrams in TeX.
7 %% See the companion README and INSTALL files for further information.
8 %% Copyright (c) 1991-2011 Kristoffer H. Rose <[email protected]>
9 %%
10 %% The Xy-pic package is free software; you can redistribute it and/or modify
11 %% it under the terms of the GNU General Public License as published by the
12 %% Free Software Foundation; either version 2 of the License, or (at your
13 %% option) any later version.
14 %%
15 %% The Xy-pic package is distributed in the hope that it will be useful, but
16 %% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 %% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 %% for more details.
19 %%
20 %% You should have received a copy of the GNU General Public License along
21 %% with this package; if not, see http://www.gnu.org/licenses/.
22 %%
23 \ifx\xyloaded\undefined \input xy \fi
24 \xyprovide{matrix}{Matrix feature}{\stripRCS$Revision: 3.14 $}%
25 {Kristoffer H.~Rose}{[email protected]}%
26 {IBM T.~ J.\ Watson Research Center, P.O.~Box 704, Yorktown Heights, NY 10598 (USA)}
27 \xynew@{count}\Row
28 \xynew@{count}\Col
29 \xydef@\maxrow@{0}
30 \xydef@\maxcol@{0}
31 \xydef@\maxcolrow@{0}
32 \xynew@{toks}\queue@
33 \xynew@{toks}\queue@@
34 \xynew@{count}\qcount@
35 \xynew@{count}\qcount@@
36 \xydef@\clearq@{%
37 \global\queue@={}\global\qcount@=\@ne
38 \global\queue@@={}\global\qcount@@=\z@}
39 \xydef@\addq@#1{\global\advance\matrixsize@\@ne
40 \ifnum\qcount@@<\qcount@ \let\addq@@=\addq@i
41 \else \let\addq@@=\addq@ii \fi
42 \expandafter\addq@@\the\queue@@\addq@@{#1}}
43 \xylet@\addq@@=\relax
44 \xydef@\addq@i#1\addq@@#2{%
45 \global\advance\qcount@@\@ne \global\queue@@={#1#2}}
46 \xydef@\addq@ii#1\addq@@#2{%
47 \global\advance\qcount@\@ne \global\qcount@@=\z@
48 \global\queue@=\expandafter{\the\queue@#1#2}\global\queue@@={}}
49 \xydef@\finishq@{\expandafter\addq@ii\the\queue@@\addq@@{}}
50 \xynew@{count}\matrixsize@
51 \xynew@{if}\ifnoisymatrices@ \noisymatrices@true
52 \xydef@\SilentMatrices{\noisymatrices@false}
53 \xydef@\NoisyMatrices{\noisymatrices@true}
54 \xydef@\xymatrixnocompile{\global\matrixsize@=\z@
55 \ifnoisymatrices@\message{<xymatrix}\fi
56 \if\inxy@
57 \DN@{\nter@{}\xy@\xymatrix{\enter@{%
58 \def\noexpand\xy@minX@@{\xy@minX@@}\def\noexpand\xy@maxX@@{\xy@maxX@@}%
59 \def\noexpand\xy@minY@@{\xy@minY@@}\def\noexpand\xy@maxY@@{\xy@maxY@@}%
60 \edef\noexpand\xymatrixprefix@@{\codeof\xymatrixprefix@@}}}}%
61 \else \DN@{\xy \nter@\endxy \xy@\xymatrix{\nter@{}}}\fi \next@
62 \xy@@{\save@ \edef\matrixorigin@{\X@c=\the\X@c \Y@c=\the\Y@c}%
63 \edef\xy@minX@@{\the\X@c}\edef\xy@maxX@@{\the\X@c}%
64 \edef\xy@minY@@{\the\Y@c}\edef\xy@maxY@@{\the\Y@c}}%
65 \xdef\maxrow@{0}\xdef\maxcol@{0}\xdef\maxcolrow@{0}%
66 \mkHWdefaults@ \xymatrix@prefix""}
67 \xylet@\xymatrix=\xymatrixnocompile
68 \xydef@\xymatrixprefix@@{}
69 \xydef@\xymatrix@prefix"#1"{\DN@{#1}\edef\xymatrixprefix@@{\codeof\next@}%
70 \DNii@##1{\xy@{"#1"}{\edef\xymatrixprefix@@{##1}}}%
71 \expandafter\nextii@\expandafter{\xymatrixprefix@@}%
72 \xyFN@\xymatrix@setup}
73 \xydef@\xymatrix@setup{%
74 \ifx \space@\next \expandafter\DN@\space{\xyFN@\xymatrix@setup}%
75 \else\ifx \bgroup\next \let\next@=\xymatrix@ii
76 \else\addAT@\ifx\next \addAT@\DN@{\xy@{@}{}\xyFN@\xymatrix@at}%
77 \else\ifx "\next \let\next@=\xymatrix@prefix
78 \else \DN@{\xyerror@{\string\xymatrix<setup>{<rows>} expected}{}}%
79 \fi\fi\fi\fi \next@}
80 \xydef@\xymatrix@ii#1{%
81 \xymatrix@pretypeset{#1}%
82 \ifnum\maxcol@=\z@ \mkWcol@ \mkWmax@ \mkHrow@ \mkHmax@
83 \xdef\maxcol@{\the\Col}\xdef\maxcolrow@{\the\Row}\fi
84 \ifnoisymatrices@\message{\maxcol@ x\maxrow@}\fi
85 \xymatrix@measureit@@ \the\queue@ \global\queue@={}%
86 \xymatrix@typeset{#1}\restore\xymatrix@insert
87 \xy@@\leave@ \leave@
88 \ifnoisymatrices@\message{\the\matrixsize@>}\fi \ignorespaces}
89 \xydef@\xymatrixcompile#1#{\xymatrixcompile@{#1}}
90 \xydef@\xymatrixcompile@#1#2{\xycompile{\xymatrixnocompile#1{#2}}}
91 \xydef@\CompileMatrices{\let\xymatrix=\xymatrixcompile}
92 \xydef@\NoCompileMatrices{\let\xymatrix=\xymatrixnocompile}
93 \xydef@\xy@cossign@@{+}
94 \xydef@\xy@sinsign@@{+}
95 \xydef@\xy@cosabs@@{1}
96 \xydef@\xy@sinabs@@{0}
97 \xydef@\xy@tanabs@@{0}
98 \xydef@\xy@cotabs@@{100}
99 \xydef@\xymatrix@rotation{%
100 \xy@@{%
101 \edef\xy@cossign@@{\ifdim\cosDirection\p@<\z@-\else+\fi}%
102 \edef\xy@sinsign@@{\ifdim\sinDirection\p@<\z@-\else+\fi}%
103 \edef\xy@cosabs@@{%
104 \if\xy@cossign@@\cosDirection\else\xy@cossign@@\cosDirection\fi}%
105 \edef\xy@sinabs@@{%
106 \if\xy@sinsign@@\sinDirection\else\xy@sinsign@@\sinDirection\fi}%
107 \dimen@=\xy@cosabs@@\p@ \dimen@ii=\xy@sinabs@@\p@
108 \ifdim\dimen@ii<.01\p@ \def\xy@cotabs@@{100}%
109 \else \quotient@\xy@cotabs@@\dimen@\dimen@ii \fi
110 \dimen@=\xy@cosabs@@\p@ \dimen@ii=\xy@sinabs@@\p@
111 \ifdim\dimen@<.01\p@ \def\xy@tanabs@@{100}%
112 \else \quotient@\xy@tanabs@@\dimen@ii\dimen@ \fi}}
113 \xylet@\xymatrixsavedCOORD@=\relax
114 \xydef@\xymatrix@pretypeset#1{%
115 \global\Row=\z@ \xdef\maxcol@{0}\clearq@
116 \setbox8=\vtop{%
117 \ifx\xymatrixsavedCOORD@\relax \let\xymatrixsavedCOORD@=\COORD@ \fi
118 \let\COORD@=\xymatrixCOORD@
119 \everycr{}\let\\=\cr \tabskip=\z@ \offinterlineskip
120 \halign{\prentry@ ##!@&&\xyFN@\prentry@@##!@\cr#1\crcr}%
121 \prentry@@@}%
122 \xdef\maxrow@{\the\Row}%
123 \finishq@}
124 \xydef@\prentry@{\relax
125 \ifnum\Row>\z@
126 \ifnum\maxcol@<\Col\xdef\maxcol@{\the\Col}\xdef\maxcolrow@{\the\Row}\fi
127 \expandafter\xdef\csname maxcol@\the\Row\endcsname{\the\Col}\fi
128 \global\advance\Row\@ne \global\Col=\z@ \xyFN@\prentry@@}
129 \xylet@\lastprentry@@=\relax
130 \xydef@\xyeatall@{\let\xy@=\xyeat@ \change@oxy@\xyeat@ \let\xy@@ix@=\eat@}
131 \xydef@\prentry@@{\global\advance\Col\@ne
132 \let\next@=\prentry@@norm
133 \ifoldxymatrix@\else \ifx *\next \DN@*{\xyFN@\prentry@@star}\fi \fi
134 \next@}
135 \xydef@\prentry@@star{\ifx *\next \DN@*{\xyFN@\prentry@@star@ii}%
136 \else \DN@##1##{\prentry@@star@i{##1}}\fi \next@}
137 \xydef@\prentry@@star@i#1#2#3!@{\gdef\lastprentry@@{*#1{#2}#3}%
138 \setbox\lastobjectbox@=\object#1{#2}%
139 \prentry@@x}
140 \xydef@\prentry@@star@ii{%
141 \ifx [\next
142 \DN@[##1]{\DN@####1{\def\entrymodifiers@{[##1]####1}}%
143 \expandafter\next@\expandafter{\entrymodifiers@}\prentry@@norm}%
144 \else
145 \DN@##1{\DN@####1{\def\entrymodifiers@{##1####1}}%
146 \expandafter\next@\expandafter{\entrymodifiers@}\prentry@@norm}%
147 \fi \next@}
148 \xydef@\prentry@@norm#1!@{\gdef\lastprentry@@{#1}%
149 \DN@{\setbox\lastobjectbox@=\object}%
150 \expandafter\next@\entrymodifiers@{\xyeatall@ \everyentry@ #1}%
151 \prentry@@x}
152 \xydef@\prentry@@x{%
153 \edef\next@{{\noexpand\pre@emit{\the\Row}{\Upness@}{\the\Col}{\Leftness@}%
154 {\the\L@c}{\the\R@c}{\the\D@c}{\the\U@c}{\expandafter\noexpand\the\Edge@c}}}%
155 \expandafter\addq@\next@ \box\lastobjectbox@}
156 \xynew@{if}\ifoldxymatrix@ \oldxymatrix@false
157 \xydef@\prentry@@@{\relax \let\next@=\prentry@@@i
158 \ifoldxymatrix@ \ifnum\Col=\@ne \ifx\lastprentry@@\empty
159 \global\advance\Row\m@ne \let\next@=\relax \fi\fi\fi
160 \global\let\lastprentry@@=\relax \next@}
161 \xydef@\prentry@@@i{%
162 \ifnum\maxcol@<\Col \xdef\maxcol@{\the\Col}\xdef\maxcolrow@{\the\Row}\fi
163 \expandafter\xdef\csname maxcol@\the\Row\endcsname{\the\Col}}
164 \xydef@\xy@minX@@{\z@}
165 \xydef@\xy@maxX@@{\z@}
166 \xydef@\xy@minY@@{\z@}
167 \xydef@\xy@maxY@@{\z@}
168 \xydef@\pre@emit#1#2#3#4#5#6#7#8#9{%
169 \global\Row=#1\global\Col=#3\relax
170 \ifnum#3=\@ne
171 \ifnum#1=\@ne \xy@@{\matrixorigin@}%
172 \else \count@@=#1\advance\count@@\m@ne
173 \edef\next@{\noexpand\xy@@{\noexpand\cfromid@
174 {\xymatrixprefix@@\the\count@@,1}}}\next@
175 \pre@emit@ \W@maxout\Hrow@c@@\W@maxin\Hrow@in\xy@tanabs@@
176 \X@c\xy@sinsign@@\xy@sinabs@@\xymatrixrowsep@
177 \pre@emit@ \Hrow@c@@\W@maxout\Hrow@in\W@maxin\xy@cotabs@@
178 \Y@c{-\xy@cossign@@}\xy@cosabs@@\xymatrixrowsep@
179 \fi
180 \else \count@@=#3\advance\count@@\m@ne
181 \pre@emit@ \Wcol@c@@\H@maxout\Wcol@in\H@maxin\xy@cotabs@@
182 \X@c\xy@cossign@@\xy@cosabs@@\xymatrixcolsep@
183 \pre@emit@ \H@maxout\Wcol@c@@\H@maxin\Wcol@in\xy@tanabs@@
184 \Y@c\xy@sinsign@@\xy@sinabs@@\xymatrixcolsep@
185 \fi
186 \DN@##1{\xy@@{\L@c=#5\R@c=#6\D@c=#7\U@c=#8\Edge@c={#9}\idfromc@{##1#1,#3}}}%
187 \expandafter\next@\expandafter{\xymatrixprefix@@}%
188 \xy@@{%
189 \dimen@=\X@c \advance\dimen@-\L@c
190 \ifdim\dimen@<\xy@minX@@ \edef\xy@minX@@{\the\dimen@}\fi
191 \dimen@=\X@c \advance\dimen@+\R@c
192 \ifdim\dimen@>\xy@maxX@@ \edef\xy@maxX@@{\the\dimen@}\fi
193 \dimen@=\Y@c \advance\dimen@-\D@c
194 \ifdim\dimen@<\xy@minY@@ \edef\xy@minY@@{\the\dimen@}\fi
195 \dimen@=\Y@c \advance\dimen@+\U@c
196 \ifdim\dimen@>\xy@maxY@@ \edef\xy@maxY@@{\the\dimen@}\fi}}
197 \xydef@\pre@emit@#1#2#3#4{#1\A@ #2\B@ #3\R@ #4\dimen@
198 \edef\next@{{\the\A@}{\the\B@}{\the\R@}{\the\dimen@}}%
199 \expandafter\pre@emit@i\next@}
200 \xydef@\pre@emit@i#1#2#3#4#5{\xy@@{%
201 \dimen@=#2\R@=#5\dimen@ \dimen@=#1\relax \ifdim\R@>\dimen@ \R@=\dimen@ \fi
202 \dimen@=#4\B@=#5\dimen@ \dimen@=#3\relax \ifdim\B@>\dimen@ \B@=\dimen@ \fi
203 \advance\R@\B@}%
204 \pre@emit@ii}
205 \xydef@\pre@emit@ii#1#2#3#4{\xy@@{%
206 \dimen@=#4\dimen@=#3\dimen@ \advance\R@\dimen@ \advance#1#2\R@}}
207 \xydef@\Wcol@in#1{#1=\csname Wcol@\the\Col\endcsname #1=.5#1}
208 \xydef@\Wcol@out#1{#1=\csname Wcol@\the\Col\endcsname #1=.5#1}
209 \xydef@\Wcol@c@@#1{#1=\csname Wcol@\the\count@@\endcsname #1=.5#1}
210 \xydef@\W@maxin#1{#1=\W@max #1=.5#1}
211 \xydef@\W@maxout#1{#1=\W@max #1=.5#1}
212 \xydef@\Hrow@in#1{#1=\csname Hrow@\the\Row\endcsname #1=.5#1}
213 \xydef@\Hrow@out#1{#1=\csname Hrow@\the\Row\endcsname #1=.5#1}
214 \xydef@\Hrow@c@@#1{#1=\csname Hrow@\the\count@@\endcsname #1=.5#1}
215 \xydef@\H@maxin#1{#1=\H@max #1=.5#1}
216 \xydef@\H@maxout#1{#1=\H@max #1=.5#1}
217 \xydef@\H@max{\z@}
218 \xydef@\W@max{\z@}
219 \xydef@\HW@max{\z@}
220 \xydef@\mkHrow@{}
221 \xydef@\mkWcol@{}
222 \xydef@\mkHmax@{}
223 \xydef@\mkWmax@{}
224 \xydef@\mkHWmax@{}
225 \xydef@\mkHWdefaults@{\let\xymatrix@measureit@@=\xymatrix@measureit
226 \let\mkHrow@=\Hrow@R \let\mkWcol@=\Wcol@C
227 \def\mkHmax@{\ifdim\dimen@>\H@max\relax \xdef\H@max{\the\dimen@}\fi}%
228 \def\mkWmax@{\ifdim\dimen@>\W@max\relax \xdef\W@max{\the\dimen@}\fi}%
229 \let\mkHWmax@=\HWmax@max}
230 \xydef@\Hrow@R{\expandafter\xdef\csname Hrow@\the\Row\endcsname{\the\dimen@}}
231 \xydef@\Wcol@C{\expandafter\xdef\csname Wcol@\the\Col\endcsname{\the\dimen@}}
232 \xydef@\Hrow@max{\expandafter\gdef\csname Hrow@\the\Row\endcsname{\H@max}}
233 \xydef@\Wcol@max{\expandafter\gdef\csname Wcol@\the\Col\endcsname{\W@max}}
234 \xydef@\Hrow@HWmax{\expandafter\gdef\csname Hrow@\the\Row\endcsname{\HW@max}}
235 \xydef@\Wcol@HWmax{\expandafter\gdef\csname Wcol@\the\Col\endcsname{\HW@max}}
236 \xydef@\HWmax@max{%
237 \ifdim\H@max>\W@max\global\let\HW@max=\H@max\else\global\let\HW@max=\W@max\fi}
238 \xydef@\HWmax@set#1{\gdef\HW@max{#1}%
239 \global\let\H@max=\HW@max \global\let\W@max=\HW@max}
240 \xydef@\xymatrix@measureit{%
241 \xdef\H@max{\z@}\xdef\W@max{\z@}%
242 \setbox6=\vbox{\unvbox8 \global\Row=\maxrow@
243 \loop@ \dimen@ii=\lastskip\unskip \ifnum\z@<\Row
244 \setbox4=\lastbox \dimen@=\dp4 \advance\dimen@\ht4 \mkHrow@ \mkHmax@
245 \ifnum\Row=\maxcolrow@
246 \setbox2=\hbox{\unhbox4
247 \global\Col=\maxcol@
248 \loop@ \dimen@ii=\lastskip\unskip \ifnum\z@<\Col
249 \setbox\z@=\lastbox \dimen@=\wdz@ \mkWcol@ \mkWmax@
250 \global\advance\Col\m@ne
251 \repeat@}\fi
252 \global\advance\Row\m@ne
253 \repeat@}%
254 \mkHWmax@}
255 \xylet@\xymatrix@measureit@@=\relax
256 \xydef@\xymatrix@typeset#1{%
257 \clearq@
258 \hbox{\vtop{\xyqall@
259 \xy@@{\ifx\xymatrixsavedCOORD@\relax
260 \enter@{\noexpand\let\noexpand\COORD@\noexpand\xymatrixsavedCOORD@}%
261 \let\xymatrixsavedCOORD@=\COORD@ \let\COORD@=\xymatrixCOORD@
262 \else \enter@{}\fi}%
263 \ifx\xymatrixsavedCOORD@\relax \let\xymatrixsavedCOORD@=\COORD@ \fi
264 \let\COORD@=\xymatrixCOORD@
265 \kern\z@ \global\Row=\z@
266 \everycr{}\let\\=\cr \tabskip=\z@ \offinterlineskip
267 \halign{\entry@##!@&&\entry@@##!@\cr#1\crcr}%
268 \xy@@{\leave@}}}%
269 \finishq@ \expandafter\xy@@\expandafter{\the\queue@}\global\queue@={}}
270 \xydef@\entry@{\relax \global\advance\Row\@ne \global\Col=\z@ \entry@@}
271 \xydef@\entry@@{\global\advance\Col\@ne
272 \DN@##1,##2,##3@{\xy@{ENTRY "##3##1,##2"}{\Row=##1 \Col=##2\relax
273 \cfromid@{##3##1,##2}\pfromc@}}%
274 \edef\nextii@{\the\Row,\the\Col,\xymatrixprefix@@ @}%
275 \expandafter\next@\nextii@
276 \xyFN@\entry@@i}
277 \xydef@\entry@@i{\let\next@=\entry@@norm
278 \ifoldxymatrix@\else \ifx *\next \DN@*{\xyFN@\entry@@star}\fi \fi
279 \next@}
280 \xydef@\entry@@star{\ifx *\next \DN@*{\xyFN@\entry@@star@ii}%
281 \else \DN@##1##{\entry@@star@i{##1}}\fi \next@}
282 \xydef@\entry@@star@i#1#2#3!@{%
283 \xy@@ix@{{#1}{#2}}\xy@@{\expandafter\dropentry@\the\toks9}%
284 \setboxz@h{\xyqall@
285 \ifx\xymatrixsavedCOORD@\relax \let\xymatrixsavedCOORD@=\COORD@ \fi
286 \let\COORD@=\xymatrixCOORD@ \everyentry@ #3}%
287 \setbox\z@=\copy\voidb@x}
288 \xydef@\entry@@star@ii{%
289 \ifx [\next
290 \DN@[##1]{\DN@####1{\def\entrymodifiers@{[##1]####1}}%
291 \expandafter\next@\expandafter{\entrymodifiers@}\entry@@norm}%
292 \else
293 \DN@##1{\DN@####1{\def\entrymodifiers@{##1####1}}%
294 \expandafter\next@\expandafter{\entrymodifiers@}\entry@@norm}%
295 \fi \next@}
296 \xydef@\entry@@norm#1!@{%
297 \DN@##1{\expandafter\xy@@ix@
298 \expandafter{\expandafter{\entrymodifiers@}{##1}}}%
299 \expandafter\next@\expandafter{\everyentry@#1}%
300 \xy@@{\expandafter\dropentry@\the\toks9}%
301 \setbox\z@=\expandafter\object\entrymodifiers@{\xyqall@
302 \ifx\xymatrixsavedCOORD@\relax \let\xymatrixsavedCOORD@=\COORD@ \fi
303 \let\COORD@=\xymatrixCOORD@ \everyentry@ #1}%
304 \setbox\z@=\copy\voidb@x}
305 \xydef@\dropentry@#1#2{\drop@{#1}{\xyeatall@
306 \ifx\xymatrixsavedCOORD@\relax \let\xymatrixsavedCOORD@=\COORD@ \fi
307 \let\COORD@=\xymatrixCOORD@ #2}}
308 \xydef@\xyqall@{%
309 \ifxysaving@ \let\xy@=\xyqs@ \let\xy@@ix@=\xysave@@toksix@
310 \else \let\xy@=\xyq@ \let\xy@@ix@=\xyq@@toksix@ \fi
311 \change@oxy@\xy@}
312 \xydef@\xyq@#1#2{\addq@{#2}}
313 \xydef@\xyq@@toksix@{\begingroup
314 \xyuncatcodes \afterassignment\xyq@@toksix@i \global\toks9=}
315 \xydef@\xyq@@toksix@i{%
316 \DN@##1{\endgroup \xy@@{\global\toks9={##1}}}%
317 \expandafter\next@\expandafter{\the\toks9}}
318 \xydef@\xyqs@{\global\advance\matrixsize@\@ne \xysave@}
319 \xydef@\xymatrix@insert{%
320 \xy@@{\edef\nextii@{{\xy@minX@@}{\xy@maxX@@}{\xy@minY@@}{\xy@maxY@@}}%
321 \expandafter\xymatrix@insert@\nextii@}}
322 \xydef@\xymatrix@insert@#1#2#3#4{\matrixorigin@
323 \L@c=+\X@c \advance\L@c-#1\relax
324 \R@c=-\X@c \advance\R@c+#2\relax
325 \D@c=+\Y@c \advance\D@c-#3\relax
326 \U@c=-\Y@c \advance\U@c+#4\relax
327 \Edge@c={\rectangleEdge}}
328 \xylet@\thematrixCOORD@@=\relax
329 \xylet@\thematrixprefix@@=\relax
330 \xydef@\xymatrixCOORD@{%
331 \ifx [\next
332 \DN@[##1]{\xy@{[##1]}{\def\thematrixCOORD@@{[##1]}}%
333 \xyFN@\xymatrixCOORD@i##1]}%
334 \else \let\next@=\xymatrixsavedCOORD@ \fi \next@}
335 \xydef@\xymatrixCOORD@i{\count@=\Row \count@@=\Col
336 \let\thematrixprefix@@=\xymatrixprefix@@
337 \ifcat A\noexpand\next
338 \DN@##1{\expandafter\notrelaxorelse@\csname xymatrixCOORD@i@##1\endcsname
339 \xymatrixCOORD@other}%
340 \else\ifx ]\next \DN@]{\xymatrixCOORD@x}%
341 \else\ifx "\next \DN@"##1"{\DN@{##1}\edef\thematrixprefix@@{\codeof\next@}%
342 \xyFN@\xymatrixCOORD@ii}%
343 \else \let\next@=\xymatrixCOORD@other \fi\fi\fi \next@}
344 \xydef@\xymatrixCOORD@i@u{\advance\count@ \m@ne\xyFN@\xymatrixCOORD@ii}
345 \xydef@\xymatrixCOORD@i@d{\advance\count@ \@ne \xyFN@\xymatrixCOORD@ii}
346 \xydef@\xymatrixCOORD@i@l{\advance\count@@\m@ne\xyFN@\xymatrixCOORD@ii}
347 \xydef@\xymatrixCOORD@i@r{\advance\count@@\@ne \xyFN@\xymatrixCOORD@ii}
348 \xydef@\xymatrixCOORD@ii{%
349 \ifcat A\noexpand\next
350 \DN@##1{\expandafter\notrelaxorelse@\csname xymatrixCOORD@i@##1\endcsname
351 \xymatrixCOORD@error}%
352 \else\ifx ]\next \DN@]{\xymatrixCOORD@x}%
353 \else \let\next@=\xymatrixCOORD@xx \fi\fi \next@}
354 \xydef@\xymatrixCOORD@error#1{\DN@{#1}%
355 \xyerror@{illegal <coord> (\codeof\next@): illegal [...] target form}{}%
356 \xyFN@\xymatrixCOORD@ii}
357 \xydef@\xymatrixCOORD@other#1,#2]{%
358 \advance\count@#1\advance\count@@#2\xymatrixCOORD@x}
359 \xydef@\xymatrixCOORD@x{%
360 \DN@##1{\xy@@{%
361 \expandafter\let\expandafter\next@\csname Q@##1\endcsname
362 \ifx\next@\relax \xyerror@RC{##1}\else \next@ \fi}%
363 \afterCOORD@}%
364 \edef\nextii@{{\thematrixprefix@@\the\count@,\the\count@@}}%
365 \expandafter\next@\nextii@}
366 \xydef@\xymatrixCOORD@xx{%
367 \DN@##1{\xy@@{%
368 \expandafter\let\expandafter\next@\csname Q@##1\endcsname
369 \ifx\next@\relax \xyerror@RC{##1}\else \next@\no@@ \fi}%
370 \afterPLACE\xymatrixCOORD@after}%
371 \edef\nextii@{{\thematrixprefix@@\the\count@,\the\count@@}}%
372 \expandafter\next@\nextii@}
373 \xydef@\xymatrixCOORD@after{%
374 \ifx ]\next \DN@]{\afterCOORD@}%
375 \else \let\next@=\xymatrixCOORD@error \fi \next@}
376 \xydef@\xyerror@RC#1{\xyerror@{in entry \string"\the\Row,\the\Col\string":
377 No \codeof\thematrixCOORD@@\space(is \string"#1\string") from here}{}}
378 \xylet@\xymatrix@addop@@=\relax
379 \xydef@\xymatrix@at{\def\xymatrix@addop@@{\xymatrix@R\xymatrix@C}%
380 \ifx \space@\next \expandafter\DN@\space{\xyFN@\xymatrix@at}%
381 \else\ifx !\next \DN@!{\xyFN@\xymatrix@fix}%
382 \else\addPLUS@\ifx \next \let\next@=\xymatrix@addop
383 \else\addDASH@\ifx \next \let\next@=\xymatrix@addop
384 \else\addEQ@\ifx \next \let\next@=\xymatrix@addop
385 \else\ifx 1\next \DN@1{%
386 \let\objectmargin@=\p@ \xyFN@\xymatrix@setup}%
387 \else\ifx R\next \def\xymatrix@addop@@{\xymatrix@R}\DN@ R{\xymatrix@addop}%
388 \else\ifx C\next \def\xymatrix@addop@@{\xymatrix@C}\DN@ C{\xymatrix@addop}%
389 \else\ifx M\next \def\xymatrix@addop@@{\xymatrix@M}\DN@ M{\xymatrix@addop}%
390 \else\ifx L\next \def\xymatrix@addop@@{\xymatrix@L}\DN@ L{\xymatrix@addop}%
391 \else\ifx H\next \def\xymatrix@addop@@{\xymatrix@H}\DN@ H{\xymatrix@addop}%
392 \else\ifx W\next \def\xymatrix@addop@@{\xymatrix@W}\DN@ W{\xymatrix@addop}%
393 \else\ifx *\next \DN@*{\xyFN@\xymatrix@mods}%
394 \else \DN@{\afterDIRECTIONorEMPTY
395 {\xymatrix@rotation \xyFN@\xymatrix@setup}{%
396 \xyerror@{<addop> or <direction> or one of 1RCMLHW*! expected}{}%
397 \xyFN@\xymatrix@setup}}%
398 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next@}
399 \xydef@\xymatrix@fix{%
400 \ifx \space@\next \expandafter\DN@\space{\xyFN@\xymatrix@fix}%
401 \else\ifx R\next \let\mkHrow@=\Hrow@max \DN@ R{\xyFN@\xymatrix@fix@}%
402 \else\ifx C\next \let\mkWcol@=\Wcol@max \DN@ C{\xyFN@\xymatrix@fix@}%
403 \else \let\mkHrow@=\Hrow@HWmax \let\mkWcol@=\Wcol@HWmax
404 \let\next@=\xymatrix@fix@
405 \fi\fi\fi \next@}
406 \xydef@\xymatrix@fix@{%
407 \ifx \space@\next \expandafter\DN@\space{\xyFN@\xymatrix@fix@}%
408 \else\ifx 0\next \def\mkHWmax@{\HWmax@set\z@}\DN@ 0{\xyFN@\xymatrix@setup}%
409 \else\addEQ@\ifx\next \addEQ@\DN@{\afterassignment\xymatrix@fix@x\dimen@ii=}%
410 \else \let\mkHWmax@=\HWmax@max \let\next@=\xymatrix@setup \fi\fi\fi \next@}
411 \xydef@\xymatrix@fix@x{%
412 \edef\mkHWmax@{\noexpand\HWmax@set{\the\dimen@ii}}\xyFN@\xymatrix@setup}
413 \xydef@\xymatrix@addop{\afterADDOP{\xyFN@\xymatrix@addop@}}
414 \xydef@\xymatrix@addop@{%
415 \ifx \space@\next \expandafter\DN@\space{\xyFN@\xymatrix@addop@}%
416 \else\ifx R\next \DN@ R{\xy@{R}{}\dimen@ii=\xymatrixrowsep@\xymatrix@addop@x}%
417 \else\ifx C\next \DN@ C{\xy@{C}{}\dimen@ii=\xymatrixcolsep@\xymatrix@addop@x}%
418 \else \DN@{\afterassignment\xymatrix@addop@x\dimen@ii=}\fi\fi\fi \next@}
419 \xydef@\xymatrix@addop@x{\expandafter\xy@\expandafter{\the\dimen@ii}{}%
420 \xymatrix@addop@@ \xyFN@\xymatrix@setup}
421 \xydef@\xymatrix@R{\Addop@@\xymatrixrowsep@\dimen@ii}
422 \xydef@\xymatrix@C{\Addop@@\xymatrixcolsep@\dimen@ii}
423 \xydef@\xymatrix@M{\Addop@@\objectmargin@\dimen@ii}
424 \xydef@\xymatrix@L{\Addop@@\labelmargin@\dimen@ii}
425 \xydef@\xymatrix@H{\Addop@@\objectheight@\dimen@ii}
426 \xydef@\xymatrix@W{\Addop@@\objectwidth@\dimen@ii}
427 \xydef@\xymatrixrowsep@{2pc}
428 \xydef@\xymatrixcolsep@{2pc}
429 \xydef@\xymatrixrowsep{\afterADDOP{\Addop@@\xymatrixrowsep@}}
430 \xydef@\xymatrixcolsep{\afterADDOP{\Addop@@\xymatrixcolsep@}}
431 \xydef@\xymatrix@mods{%
432 \ifx \space@\next \expandafter\DN@\space{\xyFN@\xymatrix@mods}%
433 \else\ifx [\next
434 \DN@ [##1]{\xy@{[##1]}{}\DN@####1{\def\entrymodifiers@{[##1]####1}}%
435 \expandafter\next@\expandafter{\entrymodifiers@}\xyFN@\xymatrix@setup}%
436 \else\addPLUS@\ifx \next \DN@##1{\DNii@{##1}\xyFN@\xymatrix@change}%
437 \else\addDASH@\ifx \next \DN@##1{\DNii@{##1}\xyFN@\xymatrix@change}%
438 \else\addEQ@\ifx \next \DN@##1{\DNii@{##1}\xymatrix@set}%
439 \else \let\next@=\xymatrix@mods@error \fi\fi\fi\fi\fi \next@}
440 \xydef@\xymatrix@set{%
441 \begingroup \plainxy@
442 \afterVECTORorEMPTY\xymatrix@mods@x\xymatrix@mods@error}
443 \xydef@\xymatrix@change{%
444 \addEQ@\ifx\next \DN@##1{\expandafter\DNii@\expandafter{\nextii@##1}%
445 \expandafter\xy@\expandafter{\nextii@}{}\begingroup \plainxy@
446 \afterVECTORorEMPTY\xymatrix@mods@x\xymatrix@mods@xx}%
447 \else \DN@{\expandafter\xy@\expandafter{\nextii@}{}\begingroup \plainxy@
448 \afterVECTORorEMPTY\xymatrix@mods@x\xymatrix@mods@xx}\fi
449 \next@}
450 \xydef@\xymatrix@mods@x{\expandafter\xy@\expandafter{\nextii@}{}%
451 \def\next@##1##2##3{\def\nextii@####1{##1##2####1##3}}%
452 \addGT@{\addLT@{\expandafter\next@\expandafter{\nextii@}}}%
453 \DN@##1{\gdef\tmp@@@{{##1}}}%
454 \edef\nextiii@{{\the\X@c,\the\Y@c}}%
455 \expandafter\expandafter\expandafter\next@
456 \expandafter\expandafter\expandafter{\expandafter\nextii@\nextiii@}%
457 \endgroup
458 \DN@##1{\xy@{##1}{}\DN@####1{\def\entrymodifiers@{##1####1}}%
459 \expandafter\next@\expandafter{\entrymodifiers@}\xyFN@\xymatrix@setup}%
460 \expandafter\next@\tmp@@@}
461 \xydef@\xymatrix@mods@xx{\expandafter\xy@\expandafter{\nextii@}{}%
462 \expandafter\gdef\expandafter\tmp@@@\expandafter{\expandafter{\nextii@}}%
463 \endgroup
464 \DN@##1{\xy@{##1}{}\DN@####1{\def\entrymodifiers@{##1####1}}%
465 \expandafter\next@\expandafter{\entrymodifiers@}\xyFN@\xymatrix@setup}%
466 \expandafter\next@\tmp@@@}
467 \xydef@\xymatrix@mods@error{\endgroup
468 \xyerror@{Impossible @*<addop><size> <setup>.}{}\xyFN@\xymatrix@setup}
469 \xywarnifdefined\entrymodifiers
470 \expandafter\def\addEQ@\entrymodifiers#1{\def\entrymodifiers@{#1}\ignorespaces}
471 \xydef@\entrymodifiers@{!V\entrybox}
472 \xydef@\entrybox#1{\hbox{\setbox\z@=\objectbox{#1}%
473 %%
474 %% \L@p=\wdz@ \D@p=\ht\z@ \advance\D@p\dp\z@
475 %% \dimen@=\objectwidth@ \advance\dimen@-\L@p
476 %% \ifdim\dimen@>\z@ \advance\L@p\dimen@ \R@p=.5\dimen@ \else \R@p=\z@ \fi
477 %% \dimen@=\objectheight@ \advance\dimen@-\D@p
478 %% \ifdim\dimen@>\z@ \advance\D@p\dimen@ \fi
479 %% \dimen@=\objectmargin@ \advance\L@p2\dimen@ \advance\D@p2\dimen@
480 %% \U@p=-.5\ht\z@ \advance\[email protected]\dp\z@ \advance\R@p\objectmargin@
481 %% \setboxz@h{\kern\R@p \raise\U@p\boxz@}%
482 %% \wdz@=\L@p \ht\z@=.5\D@p \dp\z@=.5\D@p
483 \L@p=\wdz@ \R@p=\z@
484 \dimen@=\objectwidth@ \advance\dimen@-\L@p
485 \ifdim\dimen@>\z@ \advance\L@p\dimen@ \R@p=.5\dimen@ \fi
486 \dimen@=\objectmargin@ \advance\L@p2\dimen@ \advance\R@p\dimen@
487 \D@p=\ht\z@ \advance\D@p\dp\z@ \U@p=-\fontdimen22\textfont\tw@
488 \dimen@=\objectheight@ \advance\dimen@-\D@p
489 \ifdim\dimen@>\z@ \advance\D@p\dimen@ \fi
490 \dimen@=\objectmargin@ \advance\D@p2\dimen@
491 \setboxz@h{\kern\R@p \raise\U@p\boxz@}%
492 \wdz@=\L@p
493 \advance\D@p-\ht\z@ \advance\D@p-\dp\z@ \D@p=.5\D@p
494 \dimen@=\ht\z@ \advance\dimen@\D@p \ht\z@=\dimen@
495 \dimen@=\dp\z@ \advance\dimen@\D@p \dp\z@=\dimen@
496 \boxz@}}
497 \xywarnifdefined\everyentry
498 \expandafter\def\addEQ@\everyentry#1{\def\everyentry@{#1}\ignorespaces}
499 \xylet@\everyentry@=\empty
500 \xyendinput