| 1 |
%% xytp-f.tex from $Id: xytp-f.doc,v 3.7 2011/03/14 20:14:00 krisrose Exp $ |
| 2 |
%% |
| 3 |
%% Xy-pic ``Frame extension'' TPIC backend support. |
| 4 |
%% Copyright (c) 1995-1996 Ross Moore <[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\xytpfloaded\empty \message{not reloaded}\endinput \fi |
| 24 |
\let\xytpfloaded=\empty \xycatcodes |
| 25 |
\xydef@\installTPICframes@{% |
| 26 |
\let\framed@body@@=\xyTPICframed@body@ |
| 27 |
\let\circled@x@@=\xyTPICcircled@x@ |
| 28 |
\let\ellipsed@x@@=\xyTPICellipsed@x@ |
| 29 |
\installTPICfills@ |
| 30 |
\xyuncatcodes} |
| 31 |
\xydef@\UseTPICframes{\installTPICframes@} |
| 32 |
\xydef@\NoTPICframes{\UnloadFrames@} |
| 33 |
\xydef@\xyTPICframed@body@{\DN@{\framed@body@}% |
| 34 |
\ifdim\R@=\z@ |
| 35 |
\ifx\framehfill\frm@solidh@@ |
| 36 |
\DN@{\xyTPICframed@rect@i\xytpic@solid@@}% |
| 37 |
\else\ifx\framehfill\frm@dashh@@ |
| 38 |
\DN@{\xyTPICframed@rect@i\xytpic@dashed@@}% |
| 39 |
\else\ifx\framehfill\frm@doth@@ |
| 40 |
\DN@{\xyTPICframed@rect@i\xytpic@dotted@@}% |
| 41 |
\fi\fi\fi\fi \next@ } |
| 42 |
\xydef@\xyTPICframed@rect@i#1{\vglue\U@c |
| 43 |
\hbox{\hglue\L@c\xyTPICrect@{#1}\hglue\R@c}\vglue\D@c} |
| 44 |
\xydef@\xyTPICcircled@x@{\DN@{\xyTPICcircled@xx{}}% |
| 45 |
\ifx\framehfill\frm@doth@@ \DN@{\xyTPICdotcirc@}% |
| 46 |
\else\ifx\framehfill\frm@dashh@@\DN@{\xyTPICdashcirc@}% |
| 47 |
\fi\fi \next@ } |
| 48 |
\xydef@\xyTPICcircled@xx#1{\vglue2\R@ |
| 49 |
\hbox{\hglue2\R@\xyTPICfullcircle@#1\hglue2\R@}\vglue2\R@} |
| 50 |
\xydef@\xyTPICdotcirc@{\let\zerodot=\framezerodot@@ |
| 51 |
\L@=\R@ \circled@x@@ } |
| 52 |
\xydef@\xyTPICdashcirc@{\L@=\R@ \circled@x@@ } |
| 53 |
\xydef@\xyTPICdotellip@{\ellipsed@x@@ } |
| 54 |
\xydef@\xyTPICdashellip@{\ellipsed@x@@ } |
| 55 |
\xydef@\xyTPICellipsed@x@#1#2{\DN@{\xyTPICellipsed@xx{}}% |
| 56 |
\ifx\framehfill\frm@doth@@\DN@{\xyTPICdotellip@}% |
| 57 |
\else\ifx\framehfill\frm@dashh@@\DN@{\xyTPICdashellip@}% |
| 58 |
\fi\fi \next@{#1}{#2}} |
| 59 |
\xydef@\xyTPICellipsed@xx#1#2#3{\vglue #3\vglue #3\relax |
| 60 |
\hbox{\L@c = #2\relax \R@c=\L@c \D@c = #3\relax \U@c=\D@c |
| 61 |
\hglue#2\hglue#2\relax \R@=#2\relax \L@=#3\relax |
| 62 |
\xyTPICfullcircle@#1\hglue#2\hglue#2\relax}% |
| 63 |
\vglue #3\vglue #3\relax} |
| 64 |
\xydef@\xyTPICrect@#1{\DNii@{\relax}\DN@{#1}\toks@={}% |
| 65 |
\ifx\next@\nextii@ \xytpic@pn0\relax\xytpic@bk |
| 66 |
\def\xytpic@style@@{\xytpic@fp}% |
| 67 |
\else\DNii@{\empty}% |
| 68 |
\ifx\next@\nextii@\def\xytpic@style@@{\xytpic@ip}\xytpic@bk |
| 69 |
\else\ifx\next@\empty\def\xytpic@style@@{\xytpic@ip}\xytpic@bk |
| 70 |
\else#1\fi\fi\fi |
| 71 |
\xytpic@pt\R@c |
| 72 |
\expandafter\addtotoks@\expandafter{\expandafter{\the\count@}}% |
| 73 |
\xytpic@pt\D@c |
| 74 |
\expandafter\addtotoks@\expandafter{\expandafter{\the\count@}}% |
| 75 |
\xytpic@pt{\L@c}% |
| 76 |
\expandafter\addtotoks@\expandafter{\expandafter{\the\count@}}% |
| 77 |
\xytpic@pt{\U@c}% |
| 78 |
\expandafter\addtotoks@\expandafter{\expandafter{\the\count@}}% |
| 79 |
\expandafter\xyTPICrect@x\the\toks@ |
| 80 |
\DNii@{\relax}\DN@{#1}\ifx\next@\nextii@ |
| 81 |
\def\xytpic@style@@{\xytpic@fp}\expandafter\xyTPICrect@x\the\toks@\fi } |
| 82 |
\xydef@\xyTPICrect@x#1#2#3#4{\xyTPIC@special{pa -#3 -#4}% |
| 83 |
\xyTPIC@special{pa -#3 #2}\xyTPIC@special{pa #1 #2}% |
| 84 |
\xyTPIC@special{pa #1 -#4}\xyTPIC@special{pa -#3 -#4}% |
| 85 |
\xytpic@style@@ } |
| 86 |
\xydef@\xyTPICoval@#1{\DN@{#1}\DNii@{\relax}% |
| 87 |
\ifx\next@\nextii@ \DN@{\xyTPICfilledoval@\relax}% |
| 88 |
\else\DNii@{\empty}\ifx\next@\nextii@ \DN@{\xyTPICfilledoval@\empty}% |
| 89 |
\else\DN@{\xyTPICoval@i{#1}}\fi\fi \next@ } |
| 90 |
\xylet@\xyTPICoval@i=\eat@ |
| 91 |
\xydef@\xyTPICfilledoval@#1{% |
| 92 |
{\advance\L@c-\R@ \advance\R@c-\R@ \xyTPICrect@{\empty}}% |
| 93 |
{\advance\U@c-\R@ \advance\D@c-\R@ \xyTPICrect@{\empty}}% |
| 94 |
\L@=\R@ \bgroup |
| 95 |
\dimen@=-\U@c \advance\dimen@\R@ \xytpic@pt\dimen@ |
| 96 |
\edef\tmp@{\the\count@}% |
| 97 |
\dimen@=-\L@c \advance\dimen@\R@ \xytpic@pt\dimen@ |
| 98 |
\edef\tmp@{\noexpand\toks@={{\the\count@}{\tmp@}}}% |
| 99 |
\setTPICcircstyle@ \xyTPICcircle@{\tmp@}\egroup |
| 100 |
\bgroup |
| 101 |
\dimen@=-\U@c \advance\dimen@\R@ \xytpic@pt\dimen@ |
| 102 |
\edef\tmp@{\the\count@}% |
| 103 |
\dimen@=\R@c \advance\dimen@-\R@ \xytpic@pt\dimen@ |
| 104 |
\edef\tmp@{\noexpand\toks@={{\the\count@}{\tmp@}}}% |
| 105 |
\setTPICcircstyle@ \xyTPICcircle@{\tmp@}\egroup |
| 106 |
\bgroup |
| 107 |
\dimen@=\D@c \advance\dimen@-\R@ \xytpic@pt\dimen@ |
| 108 |
\edef\tmp@{\the\count@}% |
| 109 |
\dimen@=-\L@c \advance\dimen@\R@ \xytpic@pt\dimen@ |
| 110 |
\edef\tmp@{\noexpand\toks@={{\the\count@}{\tmp@}}}% |
| 111 |
\setTPICcircstyle@ \xyTPICcircle@{\tmp@}\egroup |
| 112 |
\bgroup |
| 113 |
\dimen@=\D@c \advance\dimen@-\R@ \xytpic@pt\dimen@ |
| 114 |
\edef\tmp@{\the\count@}% |
| 115 |
\dimen@=\R@c \advance\dimen@-\R@ \xytpic@pt\dimen@ |
| 116 |
\edef\tmp@{\noexpand\toks@={{\the\count@}{\tmp@}}}% |
| 117 |
\setTPICcircstyle@ \xyTPICcircle@{\tmp@}\egroup |
| 118 |
\DN@{#1}\DNii@{\relax}\ifx\next@\nextii@ |
| 119 |
\def\tmp@{{\xytpic@pn0\def\xytpic@style@@{\xytpic@fp}}}% |
| 120 |
\DN@{\expandafter\xyTPICoval@i\tmp@}% |
| 121 |
\else\DN@{}\fi \next@ } |
| 122 |
\xydef@\setTPICcircstyle@{% |
| 123 |
\def\xytpic@circstyle@@{\xytpic@ia}\xytpic@bk} |
| 124 |
\xydef@\xyTPICcircle@#1{\DNii@{\relax}% |
| 125 |
\DN@{#1}\toks@={00}\ifx\next@\nextii@ |
| 126 |
\xytpic@pn0\relax\xytpic@bk \def\xytpic@circstyle@@{\xytpic@ar}% |
| 127 |
\else\DNii@{\empty}% |
| 128 |
\ifx\next@\nextii@ \setTPICcircstyle@ |
| 129 |
\else\ifx\next@\empty \setTPICcircstyle@ |
| 130 |
\else#1\fi\fi\fi |
| 131 |
\xytpic@pt\R@ |
| 132 |
\expandafter\addtotoks@\expandafter{\expandafter{\the\count@}}% |
| 133 |
\xytpic@pt\L@ |
| 134 |
\expandafter\addtotoks@\expandafter{\expandafter{\the\count@}}% |
| 135 |
\expandafter\xytpic@circstyle@@\the\toks@ 0\twoPi@} |
| 136 |
\xydef@\xyTPICellipse@{% |
| 137 |
\X@p=\R@c \advance\X@p-\L@c \divide\X@p\tw@ \R@=\R@c \advance\R@-\X@p |
| 138 |
\Y@p=\D@c \advance\Y@p-\U@c \divide\Y@p\tw@ \L@=\D@c \advance\L@-\Y@p |
| 139 |
\xyTPICcircle@} |
| 140 |
\xydef@\xyTPICrect@Special#1#2#3#4{\TPICmacro@@{#1 fp}} |
| 141 |
\xydef@\xyTPICdotrect@Special#1{\TPICmacro@@{#1 fp}} |
| 142 |
\xydef@\xyTPICdashrect@Special#1{\TPICmacro@@{#1 fp}} |
| 143 |
\xydef@\xyTPICcirc@Special#1{\TPICmacro@@{#1 ar}} |
| 144 |
\xydef@\xyTPICdotcirc@Special#1{\TPICmacro@@{#1 ar}} |
| 145 |
\xydef@\xyTPICdashcirc@Special#1{\TPICmacro@@{#1 ar}} |
| 146 |
\xydef@\xyTPICfilledRegion#1#2{\vglue\U@c |
| 147 |
\hbox{\hglue\L@c#1#2\empty\hglue\R@c}\vglue\D@c} |
| 148 |
\xydef@\filledRectangle@TPIC@@{% |
| 149 |
\ifdim\R@=\z@ \DN@{\xyTPICfilledRegion\xyTPICrect@}% |
| 150 |
\else \DN@{\xyTPICfilledRegion\xyTPICoval@}% |
| 151 |
\fi \next@ } |
| 152 |
\xydef@\filledCircle@TPIC@@#1{{\R@c=\R@ \L@c=\R@ \U@c=\R@ \D@c=\R@ |
| 153 |
\xyTPICfilledRegion\xyTPICcircle@#1{}}} |
| 154 |
\xydef@\filledEllipse@TPIC@@{\xyTPICfilledRegion\xyTPICellipse@} |
| 155 |
\xydef@\filledOval@TPIC@@{\xyTPICfilledRegion\xyTPICoval@} |
| 156 |
\xydef@\installTPICfills@{% |
| 157 |
\let\filledRectangle@@=\filledRectangle@TPIC@@ |
| 158 |
\let\filledOval@@=\filledOval@TPIC@@ |
| 159 |
\let\filledCircle@@=\filledCircle@TPIC@@ |
| 160 |
\let\filledEllipse@@=\filledEllipse@TPIC@@ |
| 161 |
} |
| 162 |
\xydef@\xyTPICfillrect@Special#1#2{% |
| 163 |
\ifx#2\relax\TPICmacro@@{#1 fp}% |
| 164 |
\else\TPICmacro@@{#1 ip}\fi} |
| 165 |
\xydef@\xyTPICfilloval@Special#1#2{% |
| 166 |
\ifx#2\relax\TPICmacro@@{#1 fp}% |
| 167 |
\else\TPICmacro@@{#1 ip}\fi} |
| 168 |
\xydef@\xyTPICfillcirc@Special#1#2{% |
| 169 |
\ifx#2\relax\TPICmacro@@{#1 ar}% |
| 170 |
\else\TPICmacro@@{#1 ai}\fi} |
| 171 |
\xydef@\xyTPICfillellipse@Special#1#2{% |
| 172 |
\ifx#2\relax\TPICmacro@@{#1 ar}% |
| 173 |
\else\TPICmacro@@{#1 ai}\fi} |
| 174 |
\endinput |