| 1 |
%% xypsdict.tex from $Id: xypsdict.doc,v 3.11 2011/03/14 20:14:00 krisrose Exp $ |
| 2 |
%% |
| 3 |
%% Xy-pic ``PostScript backend prolog''. |
| 4 |
%% Copyright (c) 1995-1997 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 |
%% As a special exception, you may use this file and all files derived |
| 24 |
%% from it without restrictions. This special exception was added with |
| 25 |
%% version 3.7 of Xy-pic. |
| 26 |
\begingroup \xycatcodes% |
| 27 |
\count@=\xydashl@\relax \count@@=\xydashw@\relax% |
| 28 |
\XYpredict@\relax \xycatcodes \xyPSobeylines@@% |
| 29 |
\PSdict@@{/XYdict where pop begin XYdict begin}% |
| 30 |
\PSdict@@{% |
| 31 |
/xysize 10 def /T true def /F false def |
| 32 |
/dimendiv{65536 div}bind def |
| 33 |
/xysegl \number\count@\space dimendiv def |
| 34 |
/xyopp{1 -1 scale}bind def |
| 35 |
/xynormwidth{\number\count@@\space dimendiv pscorrect}bind def |
| 36 |
/xywidth{xynormwidth setlinewidth}bind def |
| 37 |
}% |
| 38 |
\PSdict@@{% |
| 39 |
/xyfont{4096 add 64 div round 64 mul 4096 sub}def /xydt 0.01 def |
| 40 |
/xysdfont{4096 add 32 div round 32 mul 4096 sub}def |
| 41 |
/xydots{xywidth 1 setlinecap [xydt 2] 0 setdash}bind def |
| 42 |
/f /xyfont load def /fs /xysdfont load def}% |
| 43 |
\PSdict@@{% |
| 44 |
/xyCheckDir{dup 8 div 3 mul 3 -1 roll sub neg exch div 360 mul |
| 45 |
dup dup XYdirection sub 180 div round 180 mul XYdirection add |
| 46 |
dup 3 -1 roll sub abs 10 gt not{exch}if pop}def |
| 47 |
}% |
| 48 |
\ifdim\xydashw@=0pt\xydashw@=.4pt\fi\count@@=\xydashw@\relax% |
| 49 |
\PSdict@@{% |
| 50 |
/xyrulth{\number\count@@\space dimendiv pscorrect setlinewidth |
| 51 |
0 setlinecap}bind def |
| 52 |
}% |
| 53 |
\PSdict@@{% |
| 54 |
/gsavexy{gsave xypspt XYdirection rotate xywidth newpath 0 0 moveto}def |
| 55 |
/gchksavexy{gsave xypspt setupDirection xywidth newpath 0 0 moveto}def |
| 56 |
}% |
| 57 |
\PSdict@@{% |
| 58 |
/xyswap{XYdirection 180 add /XYdirection exch def}def |
| 59 |
/xyline{gstartxy setupDirection rlineto xystroke}def |
| 60 |
}% |
| 61 |
\PSdict@@{% |
| 62 |
/dash{exch gchksavexy xysegl XYdirection dup |
| 63 |
-90 lt{pop neg}{90 gt{neg}if}ifelse exch{neg}if |
| 64 |
0 rlineto xystroke}def |
| 65 |
/stopper{gstartxy setupDirection 0 xysegl 2 div rmoveto |
| 66 |
0 xysegl neg rlineto xystroke }def |
| 67 |
/d /dash load def /st /stopper load def}% |
| 68 |
\PSdict@@{% |
| 69 |
/solid{gstartxy xydash neg exch neg exch rlineto xystroke}def |
| 70 |
/dashed{gstartxy 2 copy dup mul exch dup mul add sqrt dup |
| 71 |
xysegl add xysegl 2 mul div round 2 mul 1 sub div [ exch dup ] 0 setdash |
| 72 |
neg exch neg exch rlineto xystroke}def |
| 73 |
/l /solid load def /dd /dashed load def}% |
| 74 |
\PSdict@@{% |
| 75 |
/dot{gstartxy 2 setlinecap [xydt 2] 0 setdash |
| 76 |
1 0 rlineto xystroke}def |
| 77 |
/dotted{gstartxy 2 copy dup mul exch dup mul add sqrt dup |
| 78 |
2 div round 1 add div 2 setlinecap [xydt 3 -1 roll] 0 setdash |
| 79 |
neg exch neg exch rlineto 0 0 rlineto xystroke}def |
| 80 |
/p /dot load def /dt /dotted load def}% |
| 81 |
\PSdict@@{% |
| 82 |
/cubic{gstartxy docubic} def |
| 83 |
/docubic{chkvalid |
| 84 |
{chkcubedge 8 -2 roll moveto curveto xystroke pop} |
| 85 |
{cleartomark grestore}ifelse}def |
| 86 |
/chkcubedge{2 copy 1.0 eq{0.0 eq{pop pop}{cubicedge}ifelse} |
| 87 |
{pop cubicedge}ifelse}def |
| 88 |
/bz /cubic load def}% |
| 89 |
\PSdict@@{% |
| 90 |
/dotcubic{gstartxy 1 setlinecap [xydt 2] 0 setdash docubic}def |
| 91 |
/dashcubic{gstartxy [5 5] 0 setdash docubic}def |
| 92 |
/bt /dotcubic load def /bd /dashcubic load def}% |
| 93 |
\PSdict@@{% |
| 94 |
/squine{gstartxy dosquine}def |
| 95 |
/dosquine{chkvalid |
| 96 |
{chksquedge 2 copy moveto xysq2cub curveto xystroke pop} |
| 97 |
{cleartomark grestore}ifelse}def |
| 98 |
/q /squine load def}% |
| 99 |
\PSdict@@{% |
| 100 |
/chkvalid{2 copy lt{dup 1 gt{false}{true}ifelse}{false}ifelse}def |
| 101 |
}% |
| 102 |
\PSdict@@{% |
| 103 |
/chksquedge{2 copy 1.0 eq{0.0 eq{pop pop}{squineedge}ifelse} |
| 104 |
{pop squineedge}ifelse}def |
| 105 |
/xysq2cub{xysq2cubit 6 1 roll xysq2cubit 6 1 roll 3 index 3 index |
| 106 |
xysq2cubit 6 1 roll xysq2cubit 6 1 roll pop pop}def |
| 107 |
/xysq2cubit{2 index 2 mul add 3 div}def |
| 108 |
}% |
| 109 |
\PSdict@@{% |
| 110 |
/dotsquine{gstartxy 1 setlinecap [xydt 2] 0 setdash dosquine}def |
| 111 |
/dashsquine{gstartxy [5 5] 0 setdash dosquine}def |
| 112 |
/qt /dotsquine load def /qd /dashsquine load def}% |
| 113 |
\PSdict@@{% |
| 114 |
/xy4mul{8 copy |
| 115 |
5 -1 roll mul 5 1 roll 6 -1 roll mul 6 1 roll |
| 116 |
3 -1 roll mul exch 4 -1 roll mul 3 1 roll |
| 117 |
add 3 1 roll add exch 10 2 roll |
| 118 |
7 -1 roll mul 7 1 roll 4 -1 roll mul 5 1 roll |
| 119 |
4 -1 roll mul 4 1 roll mul add 3 1 roll add |
| 120 |
exch 3 -1 roll }def |
| 121 |
}% |
| 122 |
\PSdict@@{% |
| 123 |
/xy44mul{4 copy 16 4 roll exch 3 1 roll 4 copy 12 4 roll |
| 124 |
xy4mul 12 4 roll xy4mul 12 -4 roll 4 copy 16 4 roll |
| 125 |
8 4 roll xy4mul 12 4 roll xy4mul}def |
| 126 |
}% |
| 127 |
\PSdict@@{% |
| 128 |
/cubicedge{10 2 roll exch 8 1 roll 3 -1 roll dup dup 9 2 roll |
| 129 |
5 -1 roll dup dup 9 1 roll 8 3 roll |
| 130 |
4 1 roll dup dup 5 3 roll dup dup 5 1 roll 3 -1 roll |
| 131 |
18 -2 roll 2 copy 1 sub neg 4 1 roll 1 sub neg exch 4 1 roll |
| 132 |
xy444mul |
| 133 |
pop pop pop 13 1 roll pop pop pop 9 1 roll 10 1 roll |
| 134 |
pop 8 1 roll 7 1 roll 8 1 roll pop 5 1 roll 3 1 roll}def |
| 135 |
}% |
| 136 |
\PSdict@@{% |
| 137 |
/xy444mul{4 copy 24 4 roll 12 -4 roll 16 4 roll 4 copy 16 4 roll |
| 138 |
xy44mul 20 8 roll xy44mul |
| 139 |
12 -4 roll 4 -1 roll 7 1 roll exch 4 1 roll exch 6 -1 roll exch |
| 140 |
4 2 roll 16 8 roll 8 4 roll |
| 141 |
4 -1 roll 7 1 roll exch 4 1 roll exch 6 -1 roll exch 4 2 roll |
| 142 |
8 4 roll 16 4 roll 8 4 roll 20 -4 roll exch 3 1 roll |
| 143 |
4 copy 20 4 roll 4 copy 16 4 roll 4 copy 12 4 roll |
| 144 |
xy4mul 28 4 roll xy4mul 20 4 roll xy4mul 12 4 roll xy4mul}def |
| 145 |
}% |
| 146 |
\PSdict@@{% |
| 147 |
/squineedge{8 2 roll |
| 148 |
exch 5 1 roll 3 -1 roll dup 6 2 roll 1 index exch |
| 149 |
10 -2 roll 2 copy 1 sub neg 4 1 roll 1 sub neg exch 4 1 roll |
| 150 |
xy44mul 4 1 roll pop 5 1 roll 6 1 roll 3 -1 roll pop}def |
| 151 |
}% |
| 152 |
\PSdict@@{% |
| 153 |
/xyshort{2 copy abs exch abs add xysegl .5 mul lt |
| 154 |
{pop pop grestore}{rlineto xystroke}ifelse}def |
| 155 |
}% |
| 156 |
\PSdict@@{% |
| 157 |
/tipwidth{xywidth xynormwidth dup currentlinewidth exch div |
| 158 |
sqrt dup dup scale mul setlinewidth 1 setlinecap}def |
| 159 |
}% |
| 160 |
\PSdict@@{% |
| 161 |
/halftip{tipwidth xysize 10 div 0 0 moveto |
| 162 |
-.25 0 3 -1 roll -2.5 mul 0 xysize 2 div neg |
| 163 |
dup .62 mul 2 div neg curveto}bind def |
| 164 |
}% |
| 165 |
\PSdict@@{/atip{gchksavexy halftip xystroke}def |
| 166 |
/btip{gchksavexy xyopp halftip xystroke}def |
| 167 |
/tip{gchksavexy gsave halftip stroke grestore |
| 168 |
xyopp halftip xystroke}def |
| 169 |
/t /tip load def /a /atip load def /b /btip load def}% |
| 170 |
\PSdict@@{/cmatip{gchksavexy halfcmtip xystroke}def |
| 171 |
/cmbtip{gchksavexy xyopp halfcmtip xystroke}def |
| 172 |
/cmtip{gchksavexy gsave halfcmtip stroke grestore |
| 173 |
xyopp halfcmtip xystroke}def |
| 174 |
/halfcmtip{tipwidth 0 0 moveto |
| 175 |
-.1333 0 .25 neg dup .125 3 -1 roll .25 curveto}bind def |
| 176 |
/ct /cmtip load def /ca /cmatip load def /cb /cmbtip load def}% |
| 177 |
\PSdict@@{% |
| 178 |
/xyfscale{/xyfsize exch def}def /xyfsize{10}def |
| 179 |
/eu{-0.0551 0.0643 -0.0976 0.1386 -0.125 0.2188}def |
| 180 |
/cm{-0.105 0.0437 -0.1804 0.1380 -0.2 0.25}def |
| 181 |
/XY{-0.1753 0.0181 -0.3452 0.0708 -0.5 0.155}def |
| 182 |
/tipstart{3 -1 roll gchksavexy exch xyfscale tipwidth dup XYdict exch |
| 183 |
known{dup /xy eq{pop /XY}if}{pop /XY}ifelse XYdict exch get}def |
| 184 |
/tipend{halfxytip xystroke}def |
| 185 |
/halfxytip{1 1 6{pop xyfsize mul 6 1 roll}for 0 0 moveto curveto}def |
| 186 |
/A{tipstart D}def /B{tipstart C}def /C{xyopp D}def /D{exec tipend}def |
| 187 |
/AB{tipstart dup gsave exec halfxytip stroke grestore C}def |
| 188 |
}% |
| 189 |
\PSdict@@{% |
| 190 |
/Tip{exch gchksavexy /xyfsize{10}def tipwidth gsave |
| 191 |
dup XYdict exch known{dup /xy eq{pop /XT}if}{pop /XT}ifelse |
| 192 |
XYdict exch get dup |
| 193 |
halfTip stroke grestore xyopp halfTip xystroke}def |
| 194 |
/XT{360 32 div neg}def /Xt{-1 .31 mul 1 atan}def |
| 195 |
/ET{360 64 div 5 mul neg}def /Et{-1 .31 mul 1 atan}def |
| 196 |
/halfTip{exec rotate XY halfxytip}def /halfTtip{halfTip}def |
| 197 |
/Ttip{exch gchksavexy /xyfsize{10}def tipwidth gsave |
| 198 |
dup XYdict exch known{dup /xy eq{pop /Xt}if}{pop /Xt}ifelse |
| 199 |
XYdict exch get dup |
| 200 |
halfTtip stroke grestore xyopp halfTtip xystroke}def |
| 201 |
/tt /Tip load def /tT /Ttip load def}% |
| 202 |
\PSdict@@{/halfturn{xysegl 2 div dup dup neg exch rmoveto |
| 203 |
0 exch dup exch -180 -90 arc}bind def |
| 204 |
/aturn{gchksavexy halfturn xystroke}def |
| 205 |
/bturn{gchksavexy xyopp halfturn xystroke}def |
| 206 |
/ta /aturn load def /tb /bturn load def}% |
| 207 |
\dimen@=\xybsqll@\relax\count@=\dimen@% |
| 208 |
\PSdict@@{% |
| 209 |
/xysqll \the\count@\space dimendiv def |
| 210 |
/squigl{gchksavexy xysqll dup neg 0 rmoveto |
| 211 |
2 div dup dup neg dup 3 -1 roll |
| 212 |
2 sqrt mul dup 5 1 roll |
| 213 |
135 45 arcn dup 3 -1 roll -135 -45 arc |
| 214 |
xystroke}def |
| 215 |
/g /squigl load def}% |
| 216 |
\PSdict@@{/fullhook{0 xysegl 2 div dup -90 90 arcn}bind def |
| 217 |
/halfhook{xysegl 2 div dup 0 exch 180 90 arcn}bind def |
| 218 |
}% |
| 219 |
\PSdict@@{/ahook{gchksavexy fullhook xystroke}def |
| 220 |
/bhook{gchksavexy xyopp fullhook xystroke}def |
| 221 |
/hook{gchksavexy gsave halfhook stroke grestore |
| 222 |
xyopp halfhook xystroke}def |
| 223 |
/h /hook load def /ha /ahook load def /hb /bhook load def}% |
| 224 |
\PSdict@@{% |
| 225 |
/xyqcirc{dup dup neg exch translate newpath |
| 226 |
dup neg 0 exch moveto 0 0 3 -1 roll -90 0 arc}bind def |
| 227 |
}% |
| 228 |
\PSdict@@{% |
| 229 |
/circ{gstartxy |
| 230 |
3 copy pop 2 copy cos mul 3 1 roll sin mul |
| 231 |
rmoveto 0 0 5 2 roll arc xystroke}bind def |
| 232 |
/o /circ load def}% |
| 233 |
\PSdict@@{% |
| 234 |
/circhar{gsave dup 3 gt{7 sub neg}if dup |
| 235 |
3 eq{pop dup 2 sqrt -2 div mul}{dup 1 eq{pop dup 2 sqrt 2 div mul} |
| 236 |
{0 eq{dup}{0}ifelse}ifelse}ifelse |
| 237 |
0 translate 3 1 roll circ grestore}bind def |
| 238 |
/c /circhar load def}% |
| 239 |
\PSdict@@{end end}% |
| 240 |
\endgroup% |
| 241 |
\endinput |