| 1 |
%% xyarrow.tex from $Id: xyarrow.doc,v 3.9 2011/03/14 20:14:00 krisrose Exp $ |
| 2 |
%% |
| 3 |
%% Xy-pic ``Arrows and Paths'' feature. |
| 4 |
%% Copyright (c) 1991-1997 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{arrow}{Arrow and Path feature}{\stripRCS$Revision: 3.9 $}% |
| 25 |
{Kristoffer H.~Rose}{[email protected]}% |
| 26 |
{IBM T.~ J.\ Watson Research Center, P.O.~Box 704, Yorktown Heights, NY 10598 (USA)} |
| 27 |
\message{path,} |
| 28 |
\xydef@\PATH{\afterPATH{}} |
| 29 |
\xylet@\afterPATH@=\empty |
| 30 |
\xydef@\afterPATH#1{\save |
| 31 |
\DN@##1{\def\afterPATH@{\restore \def\afterPATH@{##1}#1}}% |
| 32 |
\expandafter\next@\expandafter{\afterPATH@}% |
| 33 |
\let\PATHfail@@=\empty |
| 34 |
\let\PATHbefore@@=\empty |
| 35 |
\let\PATHafter@@=\empty |
| 36 |
\let\PATHlabelsevery@@=\empty |
| 37 |
\let\PATHlabelsnext@@=\empty |
| 38 |
\let\PATHlabelslast@@=\empty |
| 39 |
\xy@{\afterPATH{#1}}{\def\PATHslide@@{\z@}}% |
| 40 |
\def\PATHcontinue@@{\xyFN@\PATH@}% |
| 41 |
\xyFN@\PATH@} |
| 42 |
\xynew@{if}\ifPATHsingle@ |
| 43 |
\xydef@\PATH@{% |
| 44 |
\ifx \space@\next \expandafter\DN@\space{\xyFN@\PATH@}% |
| 45 |
\else\ifPATHsingle@ \let\next@=\PATH@single |
| 46 |
\else \let\next@=\PATH@normal \fi\fi \next@} |
| 47 |
\xydef@\PATH@normal{% |
| 48 |
\ifx ~\next \DN@ ~{\xyFN@\PATHsetting@}% |
| 49 |
\else \addRQ@\ifx \next \addRQ@\DN@{\xy@'{}\xyFN@\PATHstraight@}% |
| 50 |
\else \addLQ@\ifx \next \addLQ@\DN@{\xy@`{}\xyFN@\PATHturn@}% |
| 51 |
\else\ifx \PATHfail@@\PATH@x \DN@{\xyFN@\PATHfinal@}% |
| 52 |
\else |
| 53 |
\DNii@{\let\PATHfail@@=\PATH@x \xyFN@\PATH@}% |
| 54 |
\DN@{\expandafter\nextii@\PATHfail@@}% |
| 55 |
\fi\fi\fi\fi \next@} |
| 56 |
\xylet@\PATHfail@@=\empty |
| 57 |
\xylet@\PATHbefore@@=\empty |
| 58 |
\xylet@\PATHafter@@=\empty |
| 59 |
\xylet@\PATHlabelsevery@@=\empty |
| 60 |
\xylet@\PATHlabelsnext@@=\empty |
| 61 |
\xylet@\PATHlabelslast@@=\empty |
| 62 |
\xydef@\PATHsetting@{% |
| 63 |
\ifx \space@\next \expandafter\DN@\space{\xyFN@\PATHsetting@}% |
| 64 |
\else\ifx \bgroup\next |
| 65 |
\DN@##1{\xy@{~{##1}}{}\def\PATHfail@@{##1}\xyFN@\PATH@}% |
| 66 |
\else \addEQ@\ifx \next |
| 67 |
\addEQ@\DN@##1{\xy@{~={##1}}{}\def\PATHbefore@@{##1}\xyFN@\PATH@}% |
| 68 |
\else \addLT@\ifx \next |
| 69 |
\addLT@\DN@##1{\xy@{~<{##1}}{}\def\PATHlabelsnext@@{##1}\xyFN@\PATH@}% |
| 70 |
\else \addGT@\ifx \next |
| 71 |
\addGT@\DN@##1{\xy@{~>{##1}}{}\def\PATHlabelslast@@{##1}\xyFN@\PATH@}% |
| 72 |
\else \addPLUS@\ifx \next |
| 73 |
\addPLUS@\DN@##1{\xy@{~+{##1}}{}\def\PATHlabelsevery@@{##1}\xyFN@\PATH@}% |
| 74 |
\else \ifx /\next |
| 75 |
\DN@/##1{\xy@{~/{##1}}{}\def\PATHafter@@{##1}\xyFN@\PATH@}% |
| 76 |
\else \addDASH@\ifx \next |
| 77 |
\xywarning@{Obsolete `-' PATH <action> translated to `='.}% |
| 78 |
\addDASH@\DN@##1{\xy@{~-{##1}}{}\def\PATHbefore@@{##1}\xyFN@\PATH@}% |
| 79 |
\else |
| 80 |
\xyerror@{Unknown \string~ setting: \meaning\next}% |
| 81 |
{See the Xy-pic arrow feature documentation for help.}% |
| 82 |
\fi\fi\fi\fi\fi\fi\fi\fi \next@} |
| 83 |
\xylet@\PATHinit@@=\empty |
| 84 |
\xylet@\PATHextra@@=\empty |
| 85 |
\xylet@\PATHpost@@=\empty |
| 86 |
\xylet@\PATHcontinue@@=\empty |
| 87 |
\xydef@\PATHstraight@{% |
| 88 |
\def\PATHinit@@{\PATHinitstraight@}% |
| 89 |
\let\PATHextra@@=\empty |
| 90 |
\let\PATHpost@@=\empty |
| 91 |
\let\PATHlabelsextra@@=\relax |
| 92 |
\xy@@\pfromc@ \PATHafterPOS{\xyFN@\PATHsegment@}} |
| 93 |
\xydef@\PATHfinal@{% |
| 94 |
\def\PATHinit@@{\PATHinitstraight@}% |
| 95 |
\def\PATHextra@@{\let\PATHcontinue@@=\afterPATH@}% |
| 96 |
\let\PATHpost@@=\empty |
| 97 |
\let\PATHlabelsextra@@=\PATHlabelsextralast@ |
| 98 |
\xy@@\pfromc@ \PATHafterPOS{\xyFN@\PATHsegment@}} |
| 99 |
\xydef@\PATHlabelsextralast@{\let\PATHlabelsextra@@=\relax |
| 100 |
\expandafter\xyFN@\expandafter\PATHlabels@\PATHlabelslast@@} |
| 101 |
\xydef@\PATHinitstraight@{\xy@@{\setupDirection@ \dimen@=\PATHslide@@ |
| 102 |
\dimen@ii=-\sinDirection\dimen@ |
| 103 |
\ifPATHomitslide@@\else\advance\X@p\dimen@ii\fi \advance\X@c\dimen@ii |
| 104 |
\dimen@ii= \cosDirection\dimen@ |
| 105 |
\ifPATHomitslide@@\else\advance\Y@p\dimen@ii\fi \advance\Y@c\dimen@ii |
| 106 |
\PATHomitslide@@false \resetupDirection@}} |
| 107 |
\xydef@\PATHslide@@{\z@} |
| 108 |
\xynew@{if}\ifPATHomitslide@@ |
| 109 |
\xydef@\PATHsegment@{% |
| 110 |
\addLT@\ifx\next |
| 111 |
\addGT@{\addLT@\DN@##1}{% |
| 112 |
\xy@{<##1>}{\dimen@=##1\relax \edef\PATHslide@@{\the\dimen@}}% |
| 113 |
\xyFN@\PATHsegment@@}% |
| 114 |
\else \let\next@=\PATHsegment@@ |
| 115 |
\fi \next@} |
| 116 |
\xydef@\PATHsegment@@{\PATHinit@@ \addEQ@\PATHaction@\PATHbefore@@ \PATHextra@@ |
| 117 |
\expandafter\toks@\expandafter{\PATHlabelsnext@@}\let\PATHlabelsnext@@=\empty |
| 118 |
\expandafter\addtotoks@\expandafter{\PATHlabelsevery@@}% |
| 119 |
\expandafter\def\expandafter\PATHlabels@@\expandafter{\the\toks@}% |
| 120 |
\toks@={}\expandafter\xyFN@\expandafter\PATHlabels@\PATHlabels@@} |
| 121 |
\xylet@\PATHlabelit@@=\empty |
| 122 |
\xydef@\PATHlabels@{% |
| 123 |
\ifx \space@\next \expandafter\DN@\space{\xyFN@\PATHlabels@}% |
| 124 |
\else \ifx ^\next |
| 125 |
\DN@##1{\xy@^{}\let\PATHlabelit@@=\PATHlabelabove@@ |
| 126 |
\DNii@{}\xyFN@\PATHanchor@}% |
| 127 |
\else \ifx _\next |
| 128 |
\DN@##1{\xy@_{}\let\PATHlabelit@@=\PATHlabelbelow@@ |
| 129 |
\DNii@{}\xyFN@\PATHanchor@}% |
| 130 |
\else \ifx |\next |
| 131 |
\DN@##1{\xy@|{}\let\PATHlabelit@@=\PATHlabelbreak@ |
| 132 |
\DNii@{}\xyFN@\PATHanchor@}% |
| 133 |
\else \let\next@=\PATHfinishsegments@ \fi\fi\fi\fi \next@} |
| 134 |
\xydef@\PATHanchor@{\begingroup \toks@={}\PATHanchor@i} |
| 135 |
\xydef@\PATHanchor@i{% |
| 136 |
\ifx \space@\next \expandafter\DN@\space{\xyFN@\PATHanchor@i}% |
| 137 |
\else\addDASH@\ifx \next |
| 138 |
\addDASH@\DN@{\expandafter\addtotoks@\expandafter{\PATHanchor@toks}% |
| 139 |
\xyFN@\PATHanchor@i}% |
| 140 |
\else |
| 141 |
\DNii@##1{\endgroup\afterPLACE{\xyFN@\PATHit@}##1}% |
| 142 |
\DN@{\expandafter\nextii@\expandafter{\the\toks@}}% |
| 143 |
\fi\fi \next@} |
| 144 |
{\xyuncatcodes \gdef\next{<>(.5)}} |
| 145 |
\xylet@\PATHanchor@toks=\next |
| 146 |
\xylet@\PATHitshapes@@=\empty |
| 147 |
\xydef@\PATHit@{\let\PATHitshape@@=\empty \xyFN@\PATHit@i} |
| 148 |
\xydef@\PATHit@i{% |
| 149 |
\ifx \space@\next \expandafter\DN@\space{\xyFN@\PATHit@i}% |
| 150 |
\else \ifx *\next \DN@*##1##{\PATHlabelit@@{!C##1}}% |
| 151 |
\else \addAT@\ifx\next \addAT@\DN@##1##{\PATHlabelit@@{\dir##1}}% |
| 152 |
\else \ifx [\next \DN@[##1]{% |
| 153 |
\expandafter\def\expandafter\PATHitshape@@\expandafter{\PATHitshape@@[##1]}% |
| 154 |
\xyFN@\PATHit@i}% |
| 155 |
\else \DN@{\PATHlabelit@@{}}% |
| 156 |
\fi\fi\fi\fi \next@} |
| 157 |
\xydef@\PATHfinishsegments@{% |
| 158 |
\ifx\PATHlabelsextra@@\relax \expandafter\PATHfinishsegments@i |
| 159 |
\else |
| 160 |
\expandafter\PATHlabelsextra@@ \fi} |
| 161 |
\xydef@\PATHfinishsegments@i{% |
| 162 |
\xy@@{\Clast@@}\the\toks@ \toks@={}% |
| 163 |
\xy@@\setupDirection@ |
| 164 |
\PATHpost@@ \PATHaction@/\PATHafter@@ |
| 165 |
\PATHcontinue@@} |
| 166 |
\xydef@\PATHaction@default#1#2{\xy@{PATHaction#1{#2}}{}\POS#2\relax} |
| 167 |
\xylet@\PATHaction=\PATHaction@default |
| 168 |
\xydef@\PATHaction@#1#2{\expandafter\PATHaction\expandafter#1\expandafter{#2}} |
| 169 |
\xylet@\PATHafterPOS@default=\afterPOS |
| 170 |
\xylet@\PATHafterPOS=\PATHafterPOS@default |
| 171 |
\xydef@\PATHlastout@@{3} |
| 172 |
\xydef@\PATHturn@{\afterCIRorDIAG\PATHturn@cir\PATHturn@diag} |
| 173 |
\xydef@\PATHturn@cir{\toks@={\xy@@{% |
| 174 |
\count@=\CIRin@@ \ifnum\count@<4\else\advance\count@-4\fi |
| 175 |
\count@@=\CIRout@@ \ifnum\count@@<4\else\advance\count@@-4\fi |
| 176 |
\ifnum\count@=\count@@ \xyerror@{<turn> cannot be half or full}{% |
| 177 |
You asked for a <turn>ed segment with parallel in- and out-direction.^^J% |
| 178 |
This is not allowed because it is not possible to position it uniquely.}\fi}}% |
| 179 |
\edef\next@{{\CIRin@@}{\expandafter\noexpand\CIRorient@@}{\CIRout@@}}% |
| 180 |
\expandafter\PATHturn@i\next@} |
| 181 |
\xydef@\PATHturn@diag{\toks@={\xy@@{% |
| 182 |
\setupDirection@ \count@=\CIRin@@ \dimen@=\xydashl@ \ABfromdiag@ |
| 183 |
\ifdim \sinDirection\A@>\cosDirection\B@ \def\CIRorient@@{\CIRacw@}% |
| 184 |
\advance\count@\ifnum\count@<6 \tw@ \else -6\fi |
| 185 |
\else \def\CIRorient@@{\CIRcw@}% |
| 186 |
\advance\count@\ifnum\count@>\@ne -\tw@ \else 6\fi |
| 187 |
\fi |
| 188 |
\edef\CIRout@@{\the\count@}}}% |
| 189 |
\edef\next@{{\CIRin@@}{}{}}% |
| 190 |
\expandafter\PATHturn@i\next@} |
| 191 |
\xylet@\PATHpostpos@@=\empty |
| 192 |
\xydef@\PATHturn@i#1#2#3{% |
| 193 |
\DN@##1{\def\PATHinit@@{\xy@@{% |
| 194 |
\def\CIRin@@{#1}\def\CIRorient@@{#2}\def\CIRout@@{#3}% |
| 195 |
\ifnum\CIRin@@=8 \let\CIRin@@=\PATHlastout@@ \fi |
| 196 |
\R@=\turnradius@ |
| 197 |
##1\relax}% |
| 198 |
\xy@@{\count@=\CIRin@@ |
| 199 |
\ifPATHomitslide@@ \dimen@=-\PATHslide@@ |
| 200 |
\ABfromdiag@ \advance\X@p-\B@ \advance\Y@p\A@ \fi |
| 201 |
\enter@{\pfromthep@ \basefromthebase@}}% |
| 202 |
\xy@@{\dimen@=\expandafter\ifx\CIRorient@@\CIRcw@-\fi\R@ |
| 203 |
\ABfromdiag@ \advance\X@p-\B@ \advance\Y@p\A@ |
| 204 |
\X@origin=\X@p \Y@origin=\Y@p}% |
| 205 |
\xy@@{\dimen@=\xydashl@ \ABfromdiag@ \R@c=\A@ \U@c=\B@ |
| 206 |
\count@=\CIRout@@ |
| 207 |
\dimen@=\expandafter\ifx\CIRorient@@\CIRcw@-\fi\R@ |
| 208 |
\ABfromdiag@ \advance\X@c-\B@ \advance\Y@c\A@ |
| 209 |
\dimen@=\xydashl@ \X@p=\X@c \Y@p=\Y@c |
| 210 |
\ABfromdiag@ \advance\X@p-\A@ \advance\Y@p-\B@ |
| 211 |
\intersect@ |
| 212 |
\count@=\CIRin@@ \dimen@=\p@ \ABfromdiag@}% |
| 213 |
\xy@@{\edef\next@{\expandafter\removePT@\the\A@}% |
| 214 |
\edef\nextii@{\expandafter\removePT@\the\B@}% |
| 215 |
\A@=\X@c \advance\A@-\X@origin \B@=\Y@c \advance\B@-\Y@origin |
| 216 |
\ifdim \next@\A@<-\nextii@\B@ |
| 217 |
\dontleave@ \cfromp@ |
| 218 |
\count@=\CIRin@@ \advance\count@\ifnum\count@<4 +4\else -4\fi |
| 219 |
\dimen@=\xydashl@ \Directionfromdiag@ |
| 220 |
\the\Edge@c\z@ |
| 221 |
\count@=\CIRin@@ \dimen@=\expandafter\ifx\CIRorient@@\CIRcw@-\fi\R@ |
| 222 |
\ABfromdiag@ \advance\X@c-\B@ \advance\Y@c\A@ |
| 223 |
\dimen@=5sp \ABfromdiag@ \advance\X@c\A@ \advance\Y@c\B@ |
| 224 |
\fi |
| 225 |
\dimen@ii=\expandafter\ifx\CIRorient@@\CIRacw@-\fi\PATHslide@@ |
| 226 |
\advance\R@\dimen@ii |
| 227 |
\drop@\literal@{\hbox\bgroup\cir@i}}% |
| 228 |
\xy@@{\X@p=\X@c \Y@p=\Y@c |
| 229 |
\count@=\CIRout@@ |
| 230 |
\dimen@=\expandafter\ifx\CIRorient@@\CIRacw@-\fi\R@c |
| 231 |
\ABfromdiag@ \advance\X@p-\B@ \advance\Y@p\A@ |
| 232 |
\edef\PATHpostpos@@{\X@c=\the\X@p \Y@c=\the\Y@p \noexpand\czeroEdge@ |
| 233 |
\noexpand\PATHomitslide@@true}}% |
| 234 |
\xy@@{\count@=\CIRin@@ |
| 235 |
\dimen@=\expandafter\ifx\CIRorient@@\CIRacw@-\fi\R@c |
| 236 |
\ABfromdiag@ \advance\X@c-\B@ \advance\Y@c\A@ \czeroEdge@}% |
| 237 |
\xy@@{\leave@ |
| 238 |
\count@=\CIRin@@ \dimen@=\PATHslide@@ |
| 239 |
\ABfromdiag@ \advance\X@p-\B@ \advance\Y@p\A@ |
| 240 |
\edef\PATHlastout@@{\CIRout@@}% |
| 241 |
\count@=\CIRout@@ \dimen@=\xydashl@ \Directionfromdiag@}}}% |
| 242 |
\expandafter\next@\expandafter{\the\toks@}\toks@={}% |
| 243 |
\let\PATHextra@@=\empty |
| 244 |
\def\PATHpost@@{\xy@@\PATHpostpos@@}% |
| 245 |
\let\PATHlabelsextra@@=\relax |
| 246 |
\xyFN@\PATHturn@ii} |
| 247 |
\xydef@\PATHturn@ii{% |
| 248 |
\ifx /\next |
| 249 |
\DN@ /{\afterassignment\nextii@\dimen@=}% |
| 250 |
\DNii@{% |
| 251 |
\edef\next@{\noexpand\xy@@{\edef\noexpand\turnradius@{\the\dimen@}}}\next@ |
| 252 |
\xy@@\pfromc@ \PATHafterPOS{\xyFN@\PATHsegment@}}% |
| 253 |
\else \DN@{\xy@@\pfromc@ \PATHafterPOS{\xyFN@\PATHsegment@}}\fi |
| 254 |
\next@} |
| 255 |
\xydef@\ABfromdiag@{\ifcase\count@\relax |
| 256 |
\A@=-.7071\dimen@ \B@=-.7071\dimen@ \or \A@=\z@ \B@=-\dimen@ |
| 257 |
\or \A@=+.7071\dimen@ \B@=-.7071\dimen@ \or \A@=\dimen@ \B@=\z@ |
| 258 |
\or \A@=+.7071\dimen@ \B@=+.7071\dimen@ \or \A@=\z@ \B@=+\dimen@ |
| 259 |
\or \A@=-.7071\dimen@ \B@=+.7071\dimen@ \or \A@=-\dimen@ \B@=\z@ |
| 260 |
\else\xybug@{impossible <diag>?}\fi} |
| 261 |
\xydef@\turnradius@{10pt} |
| 262 |
\xydef@\turnradius{\afterADDOP{\Addop@@\turnradius@}} |
| 263 |
\xydef@\PATHlabelabove@#1#2{\droplabel@\belowDirection@{#1}{#2}% |
| 264 |
\let\afteraliases@@=\empty \xyFN@\PATHlabelalias@} |
| 265 |
\xydef@\PATHlabelbelow@#1#2{\droplabel@\aboveDirection@{#1}{#2}% |
| 266 |
\let\afteraliases@@=\empty \xyFN@\PATHlabelalias@} |
| 267 |
\xylet@\PATHlabelabove@@=\PATHlabelabove@ |
| 268 |
\xylet@\PATHlabelbelow@@=\PATHlabelbelow@ |
| 269 |
\xydef@\droplabel@#1#2#3{\xy@@{\enter@\DirectionfromtheDirection@}% |
| 270 |
\DN@{#2}\ifx\next@\empty |
| 271 |
\expandafter\xy@@ix@\expandafter{\PATHitshape@@\labelbox{#3}}% |
| 272 |
\else \expandafter\xy@@ix@\expandafter{\PATHitshape@@#2{#3}}\fi |
| 273 |
\xy@@{\setbox\z@=\expandafter\object\the\toks9 |
| 274 |
\advance\L@c\labelmargin@ \advance\R@c\labelmargin@ |
| 275 |
\advance\D@c\labelmargin@ \advance\U@c\labelmargin@ |
| 276 |
\setboxz@h{\kern\labelmargin@\boxz@\kern\labelmargin@}% |
| 277 |
\A@=\X@c \B@=\Y@c #1\xydashl@ \the\Edge@c\thr@@ |
| 278 |
\advance\A@-\X@c \advance\B@-\Y@c \advance\X@c 2\A@ \advance\Y@c 2\B@ |
| 279 |
\ht\z@=\U@c \dp\z@=\D@c \dimen@=\L@c \advance\dimen@\R@c \wd\z@=\dimen@ |
| 280 |
\setbox\lastobjectbox@=\hbox{\X@c=\L@c \Y@c=\z@ \Drop@@}% |
| 281 |
\drop@{\box\lastobjectbox@}{}% |
| 282 |
\leave@}} |
| 283 |
\xydef@\PATHlabelbreak@#1#2{% |
| 284 |
\DN@{#1}\ifx\next@\empty \drop\labelbox{#2}\else \drop#1{#2}\fi |
| 285 |
\def\afteraliases@@{\xy@@\Cbreak@@}\xyFN@\PATHlabelalias@} |
| 286 |
\xylet@\labelmargin@=\objectmargin@ |
| 287 |
\xydef@\labelmargin{\afterADDOP{\Addop@@\labelmargin@}} |
| 288 |
\xydef@\hole{\hbox{\dimen@=\objectmargin@ \kern2\dimen@ |
| 289 |
\vrule height\dimen@ depth\dimen@ width\z@}} |
| 290 |
\xylet@\labelstyle=\scriptstyle |
| 291 |
\xydef@\labelbox#1{\hbox{$\m@th\labelstyle{#1}$}} |
| 292 |
\xydef@\PATHlabelalias@{% |
| 293 |
\ifx \space@\next \expandafter\DN@\space{\xyFN@\PATHlabelalias@}% |
| 294 |
\else \addEQ@\ifx \next |
| 295 |
\addEQ@\DN@"##1"{\savealias@{##1}\xyFN@\PATHlabelalias@}% |
| 296 |
\else \DN@{\afteraliases@@\PATHlabels@}\fi\fi \next@} |
| 297 |
\xylet@\afteraliases@@=\empty |
| 298 |
\xydef@\savealias@#1{\xy@@{\enter@\cfromthec@ |
| 299 |
\advance\X@c-\L@c \advance\L@c\R@c \L@c=.5\L@c \R@c=\L@c \advance\X@c\L@c |
| 300 |
\advance\Y@c-\D@c \advance\D@c\U@c \D@c=.5\D@c \U@c=\D@c \advance\Y@c\D@c |
| 301 |
\idfromc@{#1}\leave@}} |
| 302 |
\message{\string\ar,} |
| 303 |
\xylet@\arvariant@@=\empty |
| 304 |
\xylet@\arstemprefix@@=\empty |
| 305 |
\xylet@\artail@@=\empty |
| 306 |
\xylet@\arstem@@=\empty |
| 307 |
\xylet@\arhead@@=\empty |
| 308 |
\xylet@\armodifiers@@=\empty |
| 309 |
\xylet@\arlabels@@=\empty |
| 310 |
\xylet@\arafterPOS@@=\empty |
| 311 |
\xylet@\arinit@@=\empty |
| 312 |
\xylet@\arexit@@=\empty |
| 313 |
\xylet@\arcomponent@@=\relax |
| 314 |
\xylet@\arcomponenttype@@=\relax |
| 315 |
\xylet@\afterar@@=\relax |
| 316 |
\xydef@\ar{\relax\arSAFE} |
| 317 |
\xydef@\arSAFE{% |
| 318 |
\let\arvariant@@=\empty |
| 319 |
\def\arstemprefix@@{\dir}% |
| 320 |
\edef\artail@@{\arvariant@@{}}% |
| 321 |
\edef\arstem@@{\arvariant@@{-}}% |
| 322 |
\edef\arhead@@{\arvariant@@{>}}% |
| 323 |
\def\armodifiers@@{}% |
| 324 |
\def\arafterPOS@@{}% |
| 325 |
\def\arlabels@@{}% |
| 326 |
\def\arinit@@{}% |
| 327 |
\def\arexit@@{}% |
| 328 |
\let\PATHlabelabove@@=\PATHlabelabove@ |
| 329 |
\let\PATHlabelbelow@@=\PATHlabelbelow@ |
| 330 |
\xyFN@\ar@} |
| 331 |
\xydef@\ar@{% |
| 332 |
\ifx \space@\next \expandafter\DN@\space{\xyFN@\ar@}% |
| 333 |
\else \addAT@\ifx\next \addAT@\DN@{\xyFN@\ar@form}% |
| 334 |
\else\ifx |\next |
| 335 |
\DN@ |{\ar@anchor|}% |
| 336 |
\else\ifx ^\next |
| 337 |
\DN@ ^{\ar@anchor^}% |
| 338 |
\else\ifx _\next |
| 339 |
\DN@ _{\ar@anchor_}% |
| 340 |
\else \let\next@=\ar@x \fi\fi\fi\fi\fi \next@} |
| 341 |
\xydef@\addtoarinit@#1{% |
| 342 |
\expandafter\def\expandafter\arinit@@\expandafter{\arinit@@ #1}} |
| 343 |
\xydef@\addtoarlabels@#1{% |
| 344 |
\expandafter\def\expandafter\arlabels@@\expandafter{\arlabels@@ #1}} |
| 345 |
\xydef@\ar@anchor#1{\begingroup |
| 346 |
\def\PATHlabelit@@##1##2{% |
| 347 |
\DN@{##1}\ifx\next@\empty |
| 348 |
\DN@####1{\expandafter\endgroup\expandafter\addtoarlabels@ |
| 349 |
\expandafter{\the\toks@####1{##2}}\xyFN@\ar@}% |
| 350 |
\else |
| 351 |
\DN@####1{\expandafter\endgroup\expandafter\addtoarlabels@ |
| 352 |
\expandafter{\the\toks@*!C####1##1{##2}}\xyFN@\ar@}\fi |
| 353 |
\expandafter\next@\expandafter{\PATHitshape@@}}% |
| 354 |
\toks@={#1}% |
| 355 |
\def\xy@##1##2{\addtotoks@{##1}}\change@oxy@\xy@ \let\xy@@ix@=\eat@ |
| 356 |
\DNii@{}\xyFN@\PATHanchor@} |
| 357 |
\xydef@\ar@form{% |
| 358 |
\ifx \space@\next \expandafter\DN@\space{\xyFN@\ar@form}% |
| 359 |
\else\ifx ^\next \DN@ ^{\xyFN@\ar@style}\edef\arvariant@@{\string^}% |
| 360 |
\else\ifx _\next \DN@ _{\xyFN@\ar@style}\edef\arvariant@@{\string_}% |
| 361 |
\else\ifx 0\next \DN@ 0{\xyFN@\ar@style}\def\arvariant@@{0}% |
| 362 |
\else\ifx 1\next \DN@ 1{\xyFN@\ar@style}\def\arvariant@@{1}% |
| 363 |
\else\ifx 2\next \DN@ 2{\xyFN@\ar@style}\def\arvariant@@{2}% |
| 364 |
\else\ifx 3\next \DN@ 3{\xyFN@\ar@style}\def\arvariant@@{3}% |
| 365 |
\else\ifx \bgroup\next \let\next@=\ar@style |
| 366 |
\else\ifx [\next \DN@[##1]{\ar@modifiers{[##1]}}% |
| 367 |
\else\ifx *\next \DN@ *{\ar@modifiers}% |
| 368 |
\else\addLT@\ifx\next \let\next@=\ar@slide |
| 369 |
\else\ifx /\next \let\next@=\ar@curveslash |
| 370 |
\else\ifx (\next \let\next@=\ar@curveinout |
| 371 |
\else\addRQ@\ifx\next \addRQ@\DN@{\ar@curve@}% |
| 372 |
\else\addLQ@\ifx\next \addLQ@\DN@{\xyFN@\ar@curve}% |
| 373 |
\else\addDASH@\ifx\next \addDASH@\DN@{\defarstem@-\xyFN@\ar@}% |
| 374 |
\else\addEQ@\ifx\next \addEQ@\DN@{\def\arvariant@@{2}\defarstem@-\xyFN@\ar@}% |
| 375 |
\else\addDOT@\ifx\next \addDOT@\DN@{\defarstem@.\xyFN@\ar@}% |
| 376 |
\else\ifx :\next \DN@:{\def\arvariant@@{2}\defarstem@.\xyFN@\ar@}% |
| 377 |
\else\ifx ~\next \DN@~{\defarstem@~\xyFN@\ar@}% |
| 378 |
\else\ifx !\next \DN@!{\dasharstem@\xyFN@\ar@}% |
| 379 |
\else\ifx ?\next \DN@?{\ar@upsidedown\xyFN@\ar@}% |
| 380 |
\else \let\next@=\ar@error |
| 381 |
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next@} |
| 382 |
\xydef@\defarstem@#1{\edef\arstem@@{\arvariant@@{\string#1}}% |
| 383 |
\DNii@##1##{\next@}% |
| 384 |
\edef\next@##1{\def\noexpand\artail@@{\arvariant@@{##1}}}% |
| 385 |
\expandafter\nextii@\artail@@ |
| 386 |
\edef\next@##1{\def\noexpand\arhead@@{\arvariant@@{##1}}}% |
| 387 |
\expandafter\nextii@\arhead@@} |
| 388 |
\xydef@\dasharstem@{% |
| 389 |
\DN@##1##{\nextii@{##1}}\DNii@##1##2{\def\arstem@@{##1{##2##2}}}% |
| 390 |
\expandafter\next@\arstem@@} |
| 391 |
\xydef@\ar@error#1{\xyerror@{Illegal <form>ation (\meaning\next)}{}% |
| 392 |
\xyFN@\ar@} |
| 393 |
\xydef@\ar@style{% |
| 394 |
\ifx \bgroup\next \def\artail@@{{}}% |
| 395 |
\edef\arstem@@{\arvariant@@{-}}\edef\arhead@@{\arvariant@@{>}}% |
| 396 |
\expandafter\ar@i |
| 397 |
\else \resetvariant@\artail@@ \resetvariant@\arstem@@ \resetvariant@\arhead@@ |
| 398 |
\expandafter\xyFN@\expandafter\ar@ \fi} |
| 399 |
\xydef@\resetvariant@#1{% |
| 400 |
\DN@##1##{\DN@{##1}\ifx\next@\empty |
| 401 |
\DN@{\expandafter\nextii@\expandafter{\arvariant@@}}% |
| 402 |
\else \DN@{\nextii@{##1}}\fi \next@}% |
| 403 |
\DNii@##1##2{\def#1{##1{##2}}}% |
| 404 |
\expandafter\next@#1} |
| 405 |
\xydef@\ar@i#1{\DN@{#1}% |
| 406 |
\ifx\next@\empty \edef\arstem@@{\arvariant@@{}}\edef\arhead@@{\arvariant@@{}}% |
| 407 |
\DN@{\xyFN@\ar@}% |
| 408 |
\else |
| 409 |
\let\arcomponent@@=\ar@ii \let\arcomponenttype@@=\artip@ |
| 410 |
\DN@{\xyFN@\arcomponent@#1$}% |
| 411 |
\fi \next@} |
| 412 |
\xydef@\ar@ii{\ifx $\next \let\next@=\ar@iv |
| 413 |
\else \expandafter\def\expandafter\artail@@\expandafter{\the\toks@}% |
| 414 |
\let\arcomponent@@=\ar@iii \let\arcomponenttype@@=\arconn@ |
| 415 |
\DN@{\xyFN@\arcomponent@}\fi \next@} |
| 416 |
\xydef@\ar@iii{% |
| 417 |
\expandafter\def\expandafter\arstem@@\expandafter{\the\toks@}% |
| 418 |
\resetvariant@\artail@@ |
| 419 |
\let\arcomponent@@=\ar@iv \let\arcomponenttype@@=\artip@ |
| 420 |
\xyFN@\arcomponent@} |
| 421 |
\xydef@\ar@iv{% |
| 422 |
\expandafter\def\expandafter\arhead@@\expandafter{\the\toks@}% |
| 423 |
\ifx $\next \DN@ ${\xyFN@\ar@}% |
| 424 |
\else \xyerror@{illegal <arrow>: \meaning\next\space not valid}{}\fi \next@} |
| 425 |
\xydef@\ar@x{% |
| 426 |
\let\arsavedPATHafterPOS@@=\PATHafterPOS \let\PATHafterPOS=\arafterPOS@ |
| 427 |
\toks@={\ar@PATH}% |
| 428 |
\expandafter\addtotoks@\expandafter{\expandafter{\artail@@}}% |
| 429 |
\expandafter\addtotoks@\expandafter{\expandafter{\arstem@@}}% |
| 430 |
\expandafter\addtotoks@\expandafter{\expandafter{\arstemprefix@@}}% |
| 431 |
\expandafter\addtotoks@\expandafter{\expandafter{\arhead@@}}% |
| 432 |
\expandafter\addtotoks@\expandafter{\expandafter{\armodifiers@@}}% |
| 433 |
\expandafter\addtotoks@\expandafter{\expandafter{\arinit@@}}% |
| 434 |
\expandafter\addtotoks@\expandafter{\expandafter{\arexit@@}}% |
| 435 |
\expandafter\addtotoks@\expandafter{\expandafter{\arlabels@@}}% |
| 436 |
\addtotoks@{\afterar@@}% |
| 437 |
\expandafter\DNii@\expandafter{\the\toks@}\toks@={}% |
| 438 |
\nextii@} |
| 439 |
{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{% |
| 440 |
\def\next{% |
| 441 |
\afterPATH{#9}% |
| 442 |
~={#6\preconnect#5#3#2}% |
| 443 |
~/{#7}% |
| 444 |
~<{|<*h#5\dir#1}% |
| 445 |
~>{|>*h#5\dir#4}% |
| 446 |
~+{#8}% |
| 447 |
}% |
| 448 |
\next}} |
| 449 |
\xylet@\ar@PATH=\next |
| 450 |
\xydef@\arafterPOS@#1{% |
| 451 |
\arsavedPATHafterPOS@@{\let\PATHafterPOS=\arsavedPATHafterPOS@@ |
| 452 |
\DN@{#1}\expandafter\next@\arafterPOS@@}}% |
| 453 |
\xylet@\arsavedPATHafterPOS@@=\relax |
| 454 |
\xydef@\arcomponent@{% |
| 455 |
\ifx ^\next \toks@ii={^}\DN@ ^{\xyFN@\arcomponent@i}% |
| 456 |
\else\ifx _\next \toks@ii={_}\DN@ _{\xyFN@\arcomponent@i}% |
| 457 |
\else\ifx 1\next \toks@ii={1}\DN@ 1{\xyFN@\arcomponent@i}% |
| 458 |
\else\ifx 2\next \toks@ii={2}\DN@ 2{\xyFN@\arcomponent@i}% |
| 459 |
\else\ifx 3\next \toks@ii={3}\DN@ 3{\xyFN@\arcomponent@i}% |
| 460 |
\else\ifx \bgroup\next \expandafter\toks@ii\expandafter{\arvariant@@}% |
| 461 |
\let\next@=\arcomponent@i |
| 462 |
\else\ifx *\next \DN@*##1##{\arcomponent@ii{##1}}% |
| 463 |
\else \expandafter\toks@ii\expandafter{\arvariant@@}\toks@={}% |
| 464 |
\let\next@=\arcomponenttype@@ |
| 465 |
\fi\fi\fi\fi\fi\fi\fi |
| 466 |
\next@} |
| 467 |
\xydef@\arcomponent@i#1{\toks@={#1}\arcomponent@x} |
| 468 |
\xydef@\arcomponent@ii#1#2{\toks@={*#1{#2}}\xyFN@\arcomponent@@} |
| 469 |
\xydef@\artip@{% |
| 470 |
\addGT@\ifx\next \addGT@\addtotoks@ \addGT@\DN@{\xyFN@\artip@}% |
| 471 |
\else\addLT@\ifx\next \addLT@\addtotoks@ \addLT@\DN@{\xyFN@\artip@}% |
| 472 |
\else\ifx (\next \addtotoks@(\DN@({\xyFN@\artip@}% |
| 473 |
\else\ifx )\next \addtotoks@)\DN@){\xyFN@\artip@}% |
| 474 |
\else\ifx |\next \addtotoks@|\DN@|{\xyFN@\artip@}% |
| 475 |
\else\addLQ@\ifx\next \addLQ@\addtotoks@ \addLQ@\DN@{\xyFN@\artip@}% |
| 476 |
\else\addRQ@\ifx\next \addRQ@\addtotoks@ \addRQ@\DN@{\xyFN@\artip@}% |
| 477 |
\else\addPLUS@\ifx \next \addPLUS@\addtotoks@ \addPLUS@\DN@{\xyFN@\artip@}% |
| 478 |
\else\ifx /\next \addtotoks@/\DN@/{\xyFN@\artip@}% |
| 479 |
\else\ifcat A\noexpand\next \DN@##1{\addtotoks@{##1}\xyFN@\artip@}% |
| 480 |
\else\ifx\space@\next \addtotoks@{ }\expandafter\DN@\space{\xyFN@\artip@}% |
| 481 |
\else \let\next@=\arcomponent@x |
| 482 |
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next@} |
| 483 |
\xydef@\arconn@{% |
| 484 |
\addDASH@\ifx\next \addDASH@\addtotoks@ \addDASH@\DN@{\xyFN@\arconn@}% |
| 485 |
\else\addEQ@\ifx\next \addEQ@\addtotoks@ \addEQ@\DN@{\xyFN@\arconn@}% |
| 486 |
\ifx\arvariant@@\empty \def\arvariant@@{2}\fi |
| 487 |
\else\addDOT@\ifx\next \addDOT@\addtotoks@ \addDOT@\DN@{\xyFN@\arconn@}% |
| 488 |
\else\ifx :\next \addtotoks@:\DN@:{\xyFN@\arconn@}% |
| 489 |
\ifx\arvariant@@\empty \def\arvariant@@{2}\fi |
| 490 |
\else\ifx ~\next \addtotoks@~\DN@~{\xyFN@\arconn@}% |
| 491 |
\else \let\next@=\arcomponent@x |
| 492 |
\fi\fi\fi\fi\fi \next@} |
| 493 |
\xydef@\arcomponent@x{% |
| 494 |
\DN@##1{\toks@=\expandafter{\the\toks@ii{##1}}}% |
| 495 |
\expandafter\next@\expandafter{\the\toks@}% |
| 496 |
\xyFN@\arcomponent@@} |
| 497 |
\xydef@\ar@curveslash/#1/{\expandafter\ar@curve@\ar@slashing{#1}} |
| 498 |
\xydef@\ar@slashing#1{{\xy@{**{} ?+/#1/+/#1/ @+c}{\setupDirection@ |
| 499 |
\vfromslide@{#1}% |
| 500 |
\X@c=2\X@c \advance\X@c\X@p \advance\[email protected]\d@X |
| 501 |
\Y@c=2\Y@c \advance\Y@c\Y@p \advance\[email protected]\d@Y |
| 502 |
\czeroEdge@ |
| 503 |
\spushc@}}} |
| 504 |
{\xyuncatcodes \catcode`\#=6 |
| 505 |
\gdef\next(#1,#2){{+/#1 3pc/,p+/#2 3pc/}}} |
| 506 |
\xylet@\ar@curveinout@=\next |
| 507 |
\xydef@\ar@curveinout{\expandafter\ar@curve@load\ar@curveinout@} |
| 508 |
\xydef@\ar@curve{% |
| 509 |
\ifx \space@\next \expandafter\DN@\space{\xyFN@\ar@curve}% |
| 510 |
\else\ifx \bgroup\next \let\next@=\ar@curve@load |
| 511 |
\else\ifx "\next \DN@"##1"{\ar@curve@{"##1"}}% |
| 512 |
\else \xyerror@{@= <form> must be followed by \string"<id>\string" or |
| 513 |
{<control point list>}}{}% |
| 514 |
\fi\fi\fi \next@} |
| 515 |
{\xyuncatcodes \gdef\next#1#2{\def#1##1{#2{;@={##1}}}}} |
| 516 |
\next\ar@curve@load\ar@curve@ |
| 517 |
\xydef@\ar@curve@#1{\curve@check |
| 518 |
\setcurvearinit@{#1}\setcurvearexit@\arexit@@ |
| 519 |
\def\arstemprefix@@{\crvi}\xyFN@\ar@} |
| 520 |
{\xyuncatcodes \gdef\next#1{\save @(,#1\restore}} |
| 521 |
\xylet@\setcurvearinit@i=\next |
| 522 |
\xydef@\setcurvearinit@#1{% |
| 523 |
\expandafter\addtoarinit@\expandafter{\setcurvearinit@i{#1}}} |
| 524 |
{\xyuncatcodes \gdef\next#1{\def#1{\POS @i @) }}} |
| 525 |
\xylet@\setcurvearexit@=\next |
| 526 |
\xydef@\curve@check{% |
| 527 |
\xyerror@{Forms @/.../, @(...), and @`{...}, only available when curve |
| 528 |
extension loaded}{}} |
| 529 |
\xywithoption{curve}{\let\curve@check=\relax} |
| 530 |
\xydef@\ar@modifiers#1{% |
| 531 |
\expandafter\def\expandafter\armodifiers@@\expandafter{\armodifiers@@#1}% |
| 532 |
\xyFN@\ar@} |
| 533 |
{\xyuncatcodes \catcode`\#=6 \catcode`\@=11 |
| 534 |
\gdef\next<#1>{\def\arafterPOS@@{<#1>}\xyFN@\ar@}} |
| 535 |
\xylet@\ar@slide=\next |
| 536 |
\xydef@\ar@upsidedown{\let\next=\PATHlabelabove@@ |
| 537 |
\let\PATHlabelabove@@=\PATHlabelbelow@@ \let\PATHlabelbelow@@=\next} |
| 538 |
\xyendinput |