%% xyv2.tex from $Id: xyv2.doc,v 3.8 2011/03/14 20:14:00 krisrose Exp $ %% %% Xy-pic ``Version 2 compatibility'' feature. %% Copyright (c) 1993-1995 Kristoffer H. Rose %% %% This file is part of the Xy-pic package for graphs and diagrams in TeX. %% See the companion README and INSTALL files for further information. %% Copyright (c) 1991-2011 Kristoffer H. Rose %% %% The Xy-pic package is free software; you can redistribute it and/or modify %% it under the terms of the GNU General Public License as published by the %% Free Software Foundation; either version 2 of the License, or (at your %% option) any later version. %% %% The Xy-pic package is distributed in the hope that it will be useful, but %% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY %% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License %% for more details. %% %% You should have received a copy of the GNU General Public License along %% with this package; if not, see http://www.gnu.org/licenses/. %% \ifx\xyloaded\undefined \input xy \fi \xyprovide{v2}{Version 2 Compatibility}{\stripRCS$Revision: 3.8 $}% {Kristoffer H.~Rose}{krisrose@tug.org}% {IBM T.~ J.\ Watson Research Center, P.O.~Box 704, Yorktown Heights, NY 10598 (USA)} \xylet@\XY=\Xy \ifx\redefine\undefined \let\redefine=\def \fi \ifx\define\undefined \let\define=\xydef@ \fi \ifx\dsize\undefined \let\dsize=\displaystyle \fi \ifx\tsize\undefined \let\dsize=\textstyle \fi \ifx\ssize\undefined \let\ssize=\scriptstyle \fi \ifx\sssize\undefined \let\sssize=\scriptscriptstyle \fi \ifx\text\undefined \def\text{\relax\textC}% \xydef@\textC#1{\relax \ifmmode\mathchoice {\hbox{\the\textfont0\relax#1}}% {\hbox{\the\textfont0\relax#1}}% {\hbox{\the\scriptfont0\relax#1}}% {\hbox{\the\scriptscriptfont0\relax#1}}% \else{\relax#1}\fi} \fi \xydef@\Text{\relax\xyFN@\Text@} \xydef@\TextC{\relax\textC}% \xydef@\Text@{% \addLT@\ifx\next \addGT@{\addLT@\DN@##1}{\A@=##1\Text@i}% \else \DN@{\A@=\maxdimen \Text@i}\fi \next@} \xydef@\Text@i#1{% \ifmmode \mathchoice {\expandafter\Text@ii\the\textfont0{#1}}% {\expandafter\Text@ii\the\textfont0{#1}}% {\expandafter\Text@ii\the\scriptfont0{#1}}% {\expandafter\Text@ii\the\scriptscriptfont0{#1}}% \else \leavevmode \expandafter\Text@ii\the\textfont0{#1}% \fi\ignorespaces} \xydef@\Text@ii{\hbox\bgroup \txt@i} \xylet@\cL=\L@c \xylet@\cR=\R@c \xylet@\cD=\D@c \xylet@\cH=\U@c \xylet@\Xc=\X@c \xylet@\Yc=\Y@c \xylet@\Uc=\U@c \xylet@\Dc=\D@c \xylet@\Lc=\L@c \xylet@\Rc=\R@c \xylet@\Xp=\X@p \xylet@\Yp=\Y@p \xylet@\Up=\U@p \xylet@\Dp=\D@p \xylet@\Lp=\L@p \xylet@\Rp=\R@p \xylet@\dX=\d@X \xylet@\dY=\d@Y \xylet@\Xorigin=\X@origin \xylet@\Yorigin=\Y@origin \xylet@\Xxbase =\X@xbase \xylet@\Yxbase =\Y@xbase \xylet@\Xybase =\X@ybase \xylet@\Yybase =\Y@ybase \xylet@\Xmin=\X@min \xylet@\Ymin=\Y@min \xylet@\Xmax=\X@max \xylet@\Ymax=\Y@max \xydef@\go{\aftergo{}} \xydef@\aftergo#1{\xy@\aftergo{\enter@\pfromthec@}\afterPOS{\xy@@\leave@#1}} \xydef@\merge{\POS.p\relax} \xydef@\swap{\xy@\swap\swap@} \xydef@\Drop{\expandafter\drop\entrymodifiers@} \xydef@\none{\xy@\none{}\ignorespaces} \xydef@\solid{\connect h\dir{-}} \xydef@\Solid{\connect h\dir2{-}} \xydef@\Ssolid{\connect h\dir3{-}} \xydef@\dashed{\connect h\dir{--}} \xydef@\Dashed{\connect h\dir2{--}} \xydef@\Ddashed{\connect h\dir3{--}} \xydef@\dotted{\connect h\dir{.}} \xydef@\Dotted{\connect h\dir2{.}} \xydef@\Ddotted{\connect h\dir3{.}} \xydef@\dottedwith#1{\connect h{#1}} \xydef@\notip{\dir{}} \xydef@\stop{\dir{|}} \xydef@\astop{\dir^{|}} \xydef@\bstop{\dir_{|}} \xydef@\tip{\dir{>}} \xydef@\atip{\dir^{>}} \xydef@\btip{\dir_{>}} \xydef@\Tip{\dir2{>}} \xywarnifdefined\aTip \xywarnifdefined\bTip {\xyuncatcodes \gdef\aTip{\object=<5pt>:(32,-1)\dir^{>}} \gdef\bTip{\object=<5pt>:(32,+1)\dir_{>}}} \xydef@\Ttip{\dir3{>}} \xydef@\ahook{\dir^{(}} \xydef@\bhook{\dir_{(}} \xydef@\aturn{\dir^{'}} \xydef@\bturn{\dir_{'}} \xydef@\rotate{\hbox\bgroup \DN@{\ifx (\next \DN@(####1){\rotate@ii{####1}}% \else \DN@{\rotate@i}\fi\next@}\xyFN@\next@} \xydef@\rotate@i#1{\reverseDirection@ #1\OBJECT@x} \xydef@\rotate@ii#1#2{\dimen@=#1\p@ \ifdim \dimen@=-\p@ \aboveDirection@\xydashl@ \else\ifdim\dimen@= \p@ \belowDirection@\xydashl@ \else\ifdim\dimen@<-1.5\p@ \advance\dimen@-2\p@ \edef\next@{\expandafter\removePT@\the\dimen@}\vDirection@(-1,\next@){1pc}% \else\ifdim\dimen@<-.5\p@ \vDirection@(#1,-1){1pc}% \else\ifdim\dimen@< .5\p@ \vDirection@( 1,#1){1pc}% \else\ifdim\dimen@<1.5\p@ \vDirection@(#1, 1){1pc}% \else \dimen@=-\dimen@ \advance\dimen@2\p@ \edef\next@{\expandafter\removePT@\the\dimen@}\vDirection@(-1,\next@){1pc}% \fi\fi\fi\fi\fi\fi #2\OBJECT@x} \xydef@\squash#1{% \ifmmode\setboxz@h{\m@th${\mathstrut}#1{\mathstrut}$}\else\setboxz@h{#1}\fi \setboxz@h{\kern-.5\wdz@ \dimen@=.5\ht\z@ \advance\dimen@-.5\dp\z@ \lower\dimen@\boxz@}% \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@} \xydef@\grow{% \DN@{\ifx <\next \DN@<####1>{\dimen@=####1\grow@\empty}% \else \DN@{\dimen@=2\p@ \grow@\empty}\fi\next@}\xyFN@\next@} \xydef@\grow@#1#{\grow@@{#1}} \xydef@\grow@@#1#2{\relax \ifmmode \setboxz@h{\kern\dimen@ \m@th$#2$\kern\dimen@}% \else \setboxz@h{\kern\dimen@ {#2}\kern\dimen@}\fi \dimen@ii=\ht\z@ \advance\dimen@ii\dimen@ \ht\z@=\dimen@ii \dimen@ii=\dp\z@ \advance\dimen@ii\dimen@ \dp\z@=\dimen@ii \boxz@} \xydef@\squarify{\addEQ@{\addPLUS@\object}} \xydef@\qc{\corn@@} \xyrequire{frame}\xycatcodes \xydef@\framed{\relax\convertframed{-}} \xydef@\Framed{\relax\convertframed{=}} \xydef@\circled{\relax\convertframed{o}} \xydef@\Circled{\relax\convertframed{oo}} \xydef@\convertframed#1{\DNii@##1@{\drop\frm##1{#1}}\xyFN@\convertframed@i} \xydef@\convertframed@i{% \addLT@\ifx \next \addGT@{\addLT@\DN@##1}{\addGT@{\addLT@{\nextii@}##1}@}% \else \DN@{\nextii@ @}\fi \next@} \xydef@\dotframed{\relax\drop\frm{.}} \xydef@\dashframed{\relax\drop\frm{--}} \xydef@\rounddashframed{\relax\drop\frm{o-}} \xydef@\filled{\DN@{% \addLT@\ifx \next \addGT@{\addLT@\DN@####1}{\xy@@{\frame@fill@@{####1}}}% \else \DN@{\xy@@{\frame@fill@@\z@}}% \fi\next@}\xyFN@\next@} \xydef@\Filled{\DN@{% \addLT@\ifx \next \addGT@{\addLT@\DN@####1}{\xy@@{\frame@emph@@{####1}}}% \else \DN@{\xy@@{\frame@emph@@\z@}}% \fi\next@}\xyFN@\next@} \xyrequire{matrix}\xycatcodes \xydef@\diagram#1\enddiagram{\relax\diagram@\diagram@@{#1}} \xydef@\diagram@{\relax \ifmmode \DN@##1##2{\vcenter{\oldxymatrix@true \xy##1{\xymatrix{##2}}\endxy}}% \else\DN@##1##2{{\oldxymatrix@true \xy/u.8ex/##1{\xymatrix{##2}}\endxy}}% \fi \next@} \xydef@\LaTeXdiagrams{\def\diagram{\ltxdiagram@\diagram@@}% \def\diagramnocompile{\ltxdiagram@\literal@}% \def\diagramcompileto##1{\ltxdiagram@{\NoCompileMatrices\xycompileto{##1}}}} \xydef@\ltxdiagram@#1#2\end#3{\relax \DN@{#3}\DNii@{diagram}\ifx\next@\nextii@\diagram@{#1}{#2}\end{diagram}% \else\xyerr@{Put \string{\string} around \string\begin...\string\end\space within diagrams}\fi} \xylet@\diagram@@=\literal@ \xydef@\NoisyDiagrams{} \xydef@\spreaddiagramrows#1{\addPLUS@\xymatrixrowsep{#1}} \xydef@\spreaddiagramcolumns#1{\addPLUS@\xymatrixcolsep{#1}} \xyrequire{arrow}\xycatcodes \xylet@\arrow=\ar {\xyuncatcodes \gdef\morPHISM#1#2#3{\PATH~={\oldconnect{#1}}~<{|<*{#3}}~>{|>*{#2}}}} \xydef@\morphism{\relax\morPHISM} \xylet@\connect@iii=\connect \xydef@\oldconnect#1{% \let\PATHlabelabove@@=\PATHlabelabove@ \let\PATHlabelbelow@@=\PATHlabelbelow@ \let\connect=\preconnect#1\let\connect=\connect@iii} \xydef@\definemorphism#1#2#3#4{% \xydefcsname@{x#1}{\morphism{#2}{#3}{#4}}% \xydefcsname@{u#1}{\morphism{#2}{#3}{#4}[u]}% \xydefcsname@{d#1}{\morphism{#2}{#3}{#4}[d]}% \xydefcsname@{l#1}{\morphism{#2}{#3}{#4}[l]}% \xydefcsname@{r#1}{\morphism{#2}{#3}{#4}[r]}% \xydefcsname@{uu#1}{\morphism{#2}{#3}{#4}[uu]}% \xydefcsname@{dd#1}{\morphism{#2}{#3}{#4}[dd]}% \xydefcsname@{ll#1}{\morphism{#2}{#3}{#4}[ll]}% \xydefcsname@{rr#1}{\morphism{#2}{#3}{#4}[rr]}% \xydefcsname@{ur#1}{\morphism{#2}{#3}{#4}[ur]}% \xydefcsname@{ul#1}{\morphism{#2}{#3}{#4}[ul]}% \xydefcsname@{dr#1}{\morphism{#2}{#3}{#4}[dr]}% \xydefcsname@{dl#1}{\morphism{#2}{#3}{#4}[dl]}% \xydefcsname@{uul#1}{\morphism{#2}{#3}{#4}[uul]}% \xydefcsname@{uur#1}{\morphism{#2}{#3}{#4}[uur]}% \xydefcsname@{ull#1}{\morphism{#2}{#3}{#4}[ull]}% \xydefcsname@{urr#1}{\morphism{#2}{#3}{#4}[urr]}% \xydefcsname@{ddl#1}{\morphism{#2}{#3}{#4}[ddl]}% \xydefcsname@{ddr#1}{\morphism{#2}{#3}{#4}[ddr]}% \xydefcsname@{dll#1}{\morphism{#2}{#3}{#4}[dll]}% \xydefcsname@{drr#1}{\morphism{#2}{#3}{#4}[drr]}% \xydefcsname@{uull#1}{\morphism{#2}{#3}{#4}[uull]}% \xydefcsname@{uurr#1}{\morphism{#2}{#3}{#4}[uurr]}% \xydefcsname@{ddll#1}{\morphism{#2}{#3}{#4}[ddll]}% \xydefcsname@{ddrr#1}{\morphism{#2}{#3}{#4}[ddrr]}} \definemorphism{to}\solid\tip\notip \definemorphism{line}\solid\notip\notip \definemorphism{dashed}\dashed\notip\notip \definemorphism{dotted}\dotted\notip\notip \definemorphism{double}\Solid\notip\notip \xywarnifdefined\xyviitoi \xywarnifdefined\xyviitoii \xydef@\XXtoY@#1#2#3#4#5{\save;[#3]\relax \xy@@{% \dimen@=\turnradius@ \ifdim#1<#2\relax \dimen@ii=#2\else\dimen@ii=#1\fi \advance\dimen@\ifdim\dimen@>\dimen@ii +\dimen@\else +\dimen@ii\fi \edef\xyviitoi{\the\dimen@}\leave@}% \xto ~{[#3]} `#4[#3]#5/#4\xyviitoi/ `[#3]} \xydef@\toXY@#1#2#3#4#5{\xy@@{\idfromc@{@}% \dimen@=\turnradius@ \dimen@ii=#1\relax \advance\dimen@\ifdim\dimen@>\dimen@ii +\dimen@\else +\dimen@ii\fi \edef\xyviitoi{\the\dimen@}% \dimen@=\turnradius@ \dimen@ii=#2\relax \advance\dimen@\ifdim\dimen@>\dimen@ii +\dimen@\else +\dimen@ii\fi \edef\xyviitoii{\the\dimen@}}% \morphism\solid{\object #4:(-1,0)\dir{>}}\notip ~{`"@" "@"} `#3"@"#5/#3\xyviitoi/#5/#4\p@/ `"@"#5/#4\xyviitoii/} \xyuncatcodes \catcode64=11 \xydef@\lltod{\XXtoY@\D@c\D@p{ll}{d}+} \xydef@\lltou{\XXtoY@\U@c\U@p{ll}{u}+} \xydef@\rrtod{\XXtoY@\D@c\D@p{rr}{d}+} \xydef@\rrtou{\XXtoY@\U@c\U@p{rr}{u}+} \xydef@\ddtol{\XXtoY@\L@c\L@p{dd}{l}+} \xydef@\ddtor{\XXtoY@\R@c\R@p{dd}{r}+} \xydef@\uutol{\XXtoY@\L@c\L@p{uu}{l}+} \xydef@\uutor{\XXtoY@\R@c\R@p{uu}{r}+} \xydef@\told{\toXY@\L@c\D@c{l}{d}+} \xydef@\tolu{\toXY@\L@c\U@c{l}{u}+} \xydef@\tord{\toXY@\R@c\D@c{r}{d}+} \xydef@\toru{\toXY@\R@c\U@c{r}{u}+} \xydef@\todl{\toXY@\D@c\L@c{d}{l}+} \xydef@\todr{\toXY@\D@c\R@c{d}{r}+} \xydef@\toul{\toXY@\U@c\L@c{u}{l}+} \xydef@\tour{\toXY@\U@c\R@c{u}{r}+} \xycatcodes \xydef@\TurnRadius{\addEQ@\turnradius} \xydef@\diagramcompileto#1#2\enddiagram{\relax \diagram@{\NoCompileMatrices\xycompileto{#1}}{#2}} \xydef@\diagramnocompile#1\enddiagram{\relax\diagram@\literal@{#1}} \xydef@\CompileAllDiagrams#1{\CompilePrefix{#1}\CompileMatrices} \xydef@\NoCompileAllDiagrams{\NoCompileMatrices} \xydef@\ReCompileAllDiagrams{\CompileMatrices} \xyendinput