Debian Codegraph @

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

raw
1 %% xyv2.tex from $Id: xyv2.doc,v 3.8 2011/03/14 20:14:00 krisrose Exp $
2 %%
3 %% Xy-pic ``Version 2 compatibility'' feature.
4 %% Copyright (c) 1993-1995 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{v2}{Version 2 Compatibility}{\stripRCS$Revision: 3.8 $}%
25 {Kristoffer H.~Rose}{[email protected]}%
26 {IBM T.~ J.\ Watson Research Center, P.O.~Box 704, Yorktown Heights, NY 10598 (USA)}
27 \xylet@\XY=\Xy
28 \ifx\redefine\undefined \let\redefine=\def \fi
29 \ifx\define\undefined \let\define=\xydef@ \fi
30 \ifx\dsize\undefined \let\dsize=\displaystyle \fi
31 \ifx\tsize\undefined \let\dsize=\textstyle \fi
32 \ifx\ssize\undefined \let\ssize=\scriptstyle \fi
33 \ifx\sssize\undefined \let\sssize=\scriptscriptstyle \fi
34 \ifx\text\undefined
35 \def\text{\relax\textC}%
36 \xydef@\textC#1{\relax
37 \ifmmode\mathchoice
38 {\hbox{\the\textfont0\relax#1}}%
39 {\hbox{\the\textfont0\relax#1}}%
40 {\hbox{\the\scriptfont0\relax#1}}%
41 {\hbox{\the\scriptscriptfont0\relax#1}}%
42 \else{\relax#1}\fi}
43 \fi
44 \xydef@\Text{\relax\xyFN@\Text@}
45 \xydef@\TextC{\relax\textC}%
46 \xydef@\Text@{%
47 \addLT@\ifx\next \addGT@{\addLT@\DN@##1}{\A@=##1\Text@i}%
48 \else \DN@{\A@=\maxdimen \Text@i}\fi \next@}
49 \xydef@\Text@i#1{%
50 \ifmmode \mathchoice
51 {\expandafter\Text@ii\the\textfont0{#1}}%
52 {\expandafter\Text@ii\the\textfont0{#1}}%
53 {\expandafter\Text@ii\the\scriptfont0{#1}}%
54 {\expandafter\Text@ii\the\scriptscriptfont0{#1}}%
55 \else
56 \leavevmode \expandafter\Text@ii\the\textfont0{#1}%
57 \fi\ignorespaces}
58 \xydef@\Text@ii{\hbox\bgroup \txt@i}
59 \xylet@\cL=\L@c
60 \xylet@\cR=\R@c
61 \xylet@\cD=\D@c
62 \xylet@\cH=\U@c
63 \xylet@\Xc=\X@c
64 \xylet@\Yc=\Y@c
65 \xylet@\Uc=\U@c
66 \xylet@\Dc=\D@c
67 \xylet@\Lc=\L@c
68 \xylet@\Rc=\R@c
69 \xylet@\Xp=\X@p
70 \xylet@\Yp=\Y@p
71 \xylet@\Up=\U@p
72 \xylet@\Dp=\D@p
73 \xylet@\Lp=\L@p
74 \xylet@\Rp=\R@p
75 \xylet@\dX=\d@X
76 \xylet@\dY=\d@Y
77 \xylet@\Xorigin=\X@origin
78 \xylet@\Yorigin=\Y@origin
79 \xylet@\Xxbase =\X@xbase
80 \xylet@\Yxbase =\Y@xbase
81 \xylet@\Xybase =\X@ybase
82 \xylet@\Yybase =\Y@ybase
83 \xylet@\Xmin=\X@min
84 \xylet@\Ymin=\Y@min
85 \xylet@\Xmax=\X@max
86 \xylet@\Ymax=\Y@max
87 \xydef@\go{\aftergo{}}
88 \xydef@\aftergo#1{\xy@\aftergo{\enter@\pfromthec@}\afterPOS{\xy@@\leave@#1}}
89 \xydef@\merge{\POS.p\relax}
90 \xydef@\swap{\xy@\swap\swap@}
91 \xydef@\Drop{\expandafter\drop\entrymodifiers@}
92 \xydef@\none{\xy@\none{}\ignorespaces}
93 \xydef@\solid{\connect h\dir{-}}
94 \xydef@\Solid{\connect h\dir2{-}}
95 \xydef@\Ssolid{\connect h\dir3{-}}
96 \xydef@\dashed{\connect h\dir{--}}
97 \xydef@\Dashed{\connect h\dir2{--}}
98 \xydef@\Ddashed{\connect h\dir3{--}}
99 \xydef@\dotted{\connect h\dir{.}}
100 \xydef@\Dotted{\connect h\dir2{.}}
101 \xydef@\Ddotted{\connect h\dir3{.}}
102 \xydef@\dottedwith#1{\connect h{#1}}
103 \xydef@\notip{\dir{}}
104 \xydef@\stop{\dir{|}}
105 \xydef@\astop{\dir^{|}}
106 \xydef@\bstop{\dir_{|}}
107 \xydef@\tip{\dir{>}}
108 \xydef@\atip{\dir^{>}}
109 \xydef@\btip{\dir_{>}}
110 \xydef@\Tip{\dir2{>}}
111 \xywarnifdefined\aTip
112 \xywarnifdefined\bTip
113 {\xyuncatcodes
114 \gdef\aTip{\object=<5pt>:(32,-1)\dir^{>}}
115 \gdef\bTip{\object=<5pt>:(32,+1)\dir_{>}}}
116 \xydef@\Ttip{\dir3{>}}
117 \xydef@\ahook{\dir^{(}}
118 \xydef@\bhook{\dir_{(}}
119 \xydef@\aturn{\dir^{'}}
120 \xydef@\bturn{\dir_{'}}
121 \xydef@\rotate{\hbox\bgroup
122 \DN@{\ifx (\next
123 \DN@(####1){\rotate@ii{####1}}%
124 \else \DN@{\rotate@i}\fi\next@}\xyFN@\next@}
125 \xydef@\rotate@i#1{\reverseDirection@ #1\OBJECT@x}
126 \xydef@\rotate@ii#1#2{\dimen@=#1\p@
127 \ifdim \dimen@=-\p@ \aboveDirection@\xydashl@
128 \else\ifdim\dimen@= \p@ \belowDirection@\xydashl@
129 \else\ifdim\dimen@<-1.5\p@ \advance\dimen@-2\p@
130 \edef\next@{\expandafter\removePT@\the\dimen@}\vDirection@(-1,\next@){1pc}%
131 \else\ifdim\dimen@<-.5\p@ \vDirection@(#1,-1){1pc}%
132 \else\ifdim\dimen@< .5\p@ \vDirection@( 1,#1){1pc}%
133 \else\ifdim\dimen@<1.5\p@ \vDirection@(#1, 1){1pc}%
134 \else \dimen@=-\dimen@ \advance\dimen@2\p@
135 \edef\next@{\expandafter\removePT@\the\dimen@}\vDirection@(-1,\next@){1pc}%
136 \fi\fi\fi\fi\fi\fi
137 #2\OBJECT@x}
138 \xydef@\squash#1{%
139 \ifmmode\setboxz@h{\m@th${\mathstrut}#1{\mathstrut}$}\else\setboxz@h{#1}\fi
140 \setboxz@h{\kern-.5\wdz@ \dimen@=.5\ht\z@ \advance\[email protected]\dp\z@
141 \lower\dimen@\boxz@}%
142 \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@}
143 \xydef@\grow{%
144 \DN@{\ifx <\next \DN@<####1>{\dimen@=####1\grow@\empty}%
145 \else \DN@{\dimen@=2\p@ \grow@\empty}\fi\next@}\xyFN@\next@}
146 \xydef@\grow@#1#{\grow@@{#1}}
147 \xydef@\grow@@#1#2{\relax
148 \ifmmode \setboxz@h{\kern\dimen@ \m@th$#2$\kern\dimen@}%
149 \else \setboxz@h{\kern\dimen@ {#2}\kern\dimen@}\fi
150 \dimen@ii=\ht\z@ \advance\dimen@ii\dimen@ \ht\z@=\dimen@ii
151 \dimen@ii=\dp\z@ \advance\dimen@ii\dimen@ \dp\z@=\dimen@ii \boxz@}
152 \xydef@\squarify{\addEQ@{\addPLUS@\object}}
153 \xydef@\qc{\corn@@}
154 \xyrequire{frame}\xycatcodes
155 \xydef@\framed{\relax\convertframed{-}}
156 \xydef@\Framed{\relax\convertframed{=}}
157 \xydef@\circled{\relax\convertframed{o}}
158 \xydef@\Circled{\relax\convertframed{oo}}
159 \xydef@\convertframed#1{\DNii@##1@{\drop\frm##1{#1}}\xyFN@\convertframed@i}
160 \xydef@\convertframed@i{%
161 \addLT@\ifx \next
162 \addGT@{\addLT@\DN@##1}{\addGT@{\addLT@{\nextii@}##1}@}%
163 \else \DN@{\nextii@ @}\fi \next@}
164 \xydef@\dotframed{\relax\drop\frm{.}}
165 \xydef@\dashframed{\relax\drop\frm{--}}
166 \xydef@\rounddashframed{\relax\drop\frm{o-}}
167 \xydef@\filled{\DN@{%
168 \addLT@\ifx \next
169 \addGT@{\addLT@\DN@####1}{\xy@@{\frame@fill@@{####1}}}%
170 \else \DN@{\xy@@{\frame@fill@@\z@}}%
171 \fi\next@}\xyFN@\next@}
172 \xydef@\Filled{\DN@{%
173 \addLT@\ifx \next
174 \addGT@{\addLT@\DN@####1}{\xy@@{\frame@emph@@{####1}}}%
175 \else \DN@{\xy@@{\frame@emph@@\z@}}%
176 \fi\next@}\xyFN@\next@}
177 \xyrequire{matrix}\xycatcodes
178 \xydef@\diagram#1\enddiagram{\relax\diagram@\diagram@@{#1}}
179 \xydef@\diagram@{\relax
180 \ifmmode \DN@##1##2{\vcenter{\oldxymatrix@true \xy##1{\xymatrix{##2}}\endxy}}%
181 \else\DN@##1##2{{\oldxymatrix@true \xy/u.8ex/##1{\xymatrix{##2}}\endxy}}%
182 \fi \next@}
183 \xydef@\LaTeXdiagrams{\def\diagram{\ltxdiagram@\diagram@@}%
184 \def\diagramnocompile{\ltxdiagram@\literal@}%
185 \def\diagramcompileto##1{\ltxdiagram@{\NoCompileMatrices\xycompileto{##1}}}}
186 \xydef@\ltxdiagram@#1#2\end#3{\relax
187 \DN@{#3}\DNii@{diagram}\ifx\next@\nextii@\diagram@{#1}{#2}\end{diagram}%
188 \else\xyerr@{Put \string{\string} around \string\begin...\string\end\space
189 within diagrams}\fi}
190 \xylet@\diagram@@=\literal@
191 \xydef@\NoisyDiagrams{}
192 \xydef@\spreaddiagramrows#1{\addPLUS@\xymatrixrowsep{#1}}
193 \xydef@\spreaddiagramcolumns#1{\addPLUS@\xymatrixcolsep{#1}}
194 \xyrequire{arrow}\xycatcodes
195 \xylet@\arrow=\ar
196 {\xyuncatcodes
197 \gdef\morPHISM#1#2#3{\PATH~={\oldconnect{#1}}~<{|<*{#3}}~>{|>*{#2}}}}
198 \xydef@\morphism{\relax\morPHISM}
199 \xylet@\connect@iii=\connect
200 \xydef@\oldconnect#1{%
201 \let\PATHlabelabove@@=\PATHlabelabove@
202 \let\PATHlabelbelow@@=\PATHlabelbelow@
203 \let\connect=\preconnect#1\let\connect=\connect@iii}
204 \xydef@\definemorphism#1#2#3#4{%
205 \xydefcsname@{x#1}{\morphism{#2}{#3}{#4}}%
206 \xydefcsname@{u#1}{\morphism{#2}{#3}{#4}[u]}%
207 \xydefcsname@{d#1}{\morphism{#2}{#3}{#4}[d]}%
208 \xydefcsname@{l#1}{\morphism{#2}{#3}{#4}[l]}%
209 \xydefcsname@{r#1}{\morphism{#2}{#3}{#4}[r]}%
210 \xydefcsname@{uu#1}{\morphism{#2}{#3}{#4}[uu]}%
211 \xydefcsname@{dd#1}{\morphism{#2}{#3}{#4}[dd]}%
212 \xydefcsname@{ll#1}{\morphism{#2}{#3}{#4}[ll]}%
213 \xydefcsname@{rr#1}{\morphism{#2}{#3}{#4}[rr]}%
214 \xydefcsname@{ur#1}{\morphism{#2}{#3}{#4}[ur]}%
215 \xydefcsname@{ul#1}{\morphism{#2}{#3}{#4}[ul]}%
216 \xydefcsname@{dr#1}{\morphism{#2}{#3}{#4}[dr]}%
217 \xydefcsname@{dl#1}{\morphism{#2}{#3}{#4}[dl]}%
218 \xydefcsname@{uul#1}{\morphism{#2}{#3}{#4}[uul]}%
219 \xydefcsname@{uur#1}{\morphism{#2}{#3}{#4}[uur]}%
220 \xydefcsname@{ull#1}{\morphism{#2}{#3}{#4}[ull]}%
221 \xydefcsname@{urr#1}{\morphism{#2}{#3}{#4}[urr]}%
222 \xydefcsname@{ddl#1}{\morphism{#2}{#3}{#4}[ddl]}%
223 \xydefcsname@{ddr#1}{\morphism{#2}{#3}{#4}[ddr]}%
224 \xydefcsname@{dll#1}{\morphism{#2}{#3}{#4}[dll]}%
225 \xydefcsname@{drr#1}{\morphism{#2}{#3}{#4}[drr]}%
226 \xydefcsname@{uull#1}{\morphism{#2}{#3}{#4}[uull]}%
227 \xydefcsname@{uurr#1}{\morphism{#2}{#3}{#4}[uurr]}%
228 \xydefcsname@{ddll#1}{\morphism{#2}{#3}{#4}[ddll]}%
229 \xydefcsname@{ddrr#1}{\morphism{#2}{#3}{#4}[ddrr]}}
230 \definemorphism{to}\solid\tip\notip
231 \definemorphism{line}\solid\notip\notip
232 \definemorphism{dashed}\dashed\notip\notip
233 \definemorphism{dotted}\dotted\notip\notip
234 \definemorphism{double}\Solid\notip\notip
235 \xywarnifdefined\xyviitoi
236 \xywarnifdefined\xyviitoii
237 \xydef@\XXtoY@#1#2#3#4#5{\save;[#3]\relax
238 \xy@@{%
239 \dimen@=\turnradius@ \ifdim#1<#2\relax \dimen@ii=#2\else\dimen@ii=#1\fi
240 \advance\dimen@\ifdim\dimen@>\dimen@ii +\dimen@\else +\dimen@ii\fi
241 \edef\xyviitoi{\the\dimen@}\leave@}%
242 \xto ~{[#3]} `#4[#3]#5/#4\xyviitoi/ `[#3]}
243 \xydef@\toXY@#1#2#3#4#5{\xy@@{\idfromc@{@}%
244 \dimen@=\turnradius@ \dimen@ii=#1\relax
245 \advance\dimen@\ifdim\dimen@>\dimen@ii +\dimen@\else +\dimen@ii\fi
246 \edef\xyviitoi{\the\dimen@}%
247 \dimen@=\turnradius@ \dimen@ii=#2\relax
248 \advance\dimen@\ifdim\dimen@>\dimen@ii +\dimen@\else +\dimen@ii\fi
249 \edef\xyviitoii{\the\dimen@}}%
250 \morphism\solid{\object #4:(-1,0)\dir{>}}\notip
251 ~{`"@" "@"} `#3"@"#5/#3\xyviitoi/#5/#4\p@/ `"@"#5/#4\xyviitoii/}
252 \xyuncatcodes \catcode64=11
253 \xydef@\lltod{\XXtoY@\D@c\D@p{ll}{d}+}
254 \xydef@\lltou{\XXtoY@\U@c\U@p{ll}{u}+}
255 \xydef@\rrtod{\XXtoY@\D@c\D@p{rr}{d}+}
256 \xydef@\rrtou{\XXtoY@\U@c\U@p{rr}{u}+}
257 \xydef@\ddtol{\XXtoY@\L@c\L@p{dd}{l}+}
258 \xydef@\ddtor{\XXtoY@\R@c\R@p{dd}{r}+}
259 \xydef@\uutol{\XXtoY@\L@c\L@p{uu}{l}+}
260 \xydef@\uutor{\XXtoY@\R@c\R@p{uu}{r}+}
261 \xydef@\told{\toXY@\L@c\D@c{l}{d}+}
262 \xydef@\tolu{\toXY@\L@c\U@c{l}{u}+}
263 \xydef@\tord{\toXY@\R@c\D@c{r}{d}+}
264 \xydef@\toru{\toXY@\R@c\U@c{r}{u}+}
265 \xydef@\todl{\toXY@\D@c\L@c{d}{l}+}
266 \xydef@\todr{\toXY@\D@c\R@c{d}{r}+}
267 \xydef@\toul{\toXY@\U@c\L@c{u}{l}+}
268 \xydef@\tour{\toXY@\U@c\R@c{u}{r}+}
269 \xycatcodes
270 \xydef@\TurnRadius{\addEQ@\turnradius}
271 \xydef@\diagramcompileto#1#2\enddiagram{\relax
272 \diagram@{\NoCompileMatrices\xycompileto{#1}}{#2}}
273 \xydef@\diagramnocompile#1\enddiagram{\relax\diagram@\literal@{#1}}
274 \xydef@\CompileAllDiagrams#1{\CompilePrefix{#1}\CompileMatrices}
275 \xydef@\NoCompileAllDiagrams{\NoCompileMatrices}
276 \xydef@\ReCompileAllDiagrams{\CompileMatrices}
277 \xyendinput