| 1 |
%% xyxdvi.tex from $Id: xyxdvi.doc,v 3.7 2011/03/14 20:14:00 krisrose Exp $ |
| 2 |
%% |
| 3 |
%% Xy-pic ``xdvi-driver'' option. |
| 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\xyloaded\undefined \input xy \fi |
| 24 |
\xyprovide{xdvi}{XDVI driver}{\stripRCS$Revision: 3.7 $}% |
| 25 |
{Ross Moore}{[email protected]}% |
| 26 |
{Mathematics Department, Macquarie University, NSW~2109, Australia} |
| 27 |
\xydef@\xdvi@@#1{\dvimessage@{xdvi}{#1}} |
| 28 |
\newdriver{% |
| 29 |
\xyaddsupport{color}\xdviColor@@ |
| 30 |
\xyaddsupport{crayon}\xdviCrayola@@ |
| 31 |
\xyaddsupport{ps}\xdviPS@@ |
| 32 |
\xyaddsupport{rotate}\xdviRotate@@ |
| 33 |
\xyaddsupport{line}\xdviLine@@ |
| 34 |
\xyaddsupport{frame}\xdviFrames@@ |
| 35 |
\xyaddsupport{tile}\xdviTiles@@ |
| 36 |
\xyaddsupport{tpic}\xdviTPIC@ |
| 37 |
} |
| 38 |
\xydef@\xdvi@Color@{\xdviPStypes@ |
| 39 |
\let\xylocalColor@=\xyNoColor@@ |
| 40 |
\def\xycolor@{\xycolor@@}\let\xycolorwarning@=\relax |
| 41 |
\expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{% |
| 42 |
\xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}\installPScolor@ }% |
| 43 |
\else\DN@{}\fi \next@ |
| 44 |
\ifx\xycolor@@\xyNoColor@ \let\xycolor@@=\xycolor@raw@@\fi |
| 45 |
\ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\xdviCrayola@{}}% |
| 46 |
\else \DN@{\xystandardcolors@}\fi \next@ |
| 47 |
\let\xdviColor@@=\relax |
| 48 |
\let\UnloadColor@@=\NoXDVIcolor@ |
| 49 |
}% |
| 50 |
\xydef@\xdviColor@@{\xdvi@Color@} |
| 51 |
\xydef@\NoXDVIcolor@{% |
| 52 |
\def\xycolor@{\xycolor@@}% |
| 53 |
\let\xycolor@@=\xyNoColor@ |
| 54 |
\let\xylocalColor@=\xyNoColor@@ |
| 55 |
\let\xycolorwarning@=\xycolorwarning@@ |
| 56 |
\let\xdviColor@@=\xdvi@Color@ |
| 57 |
\let\UnloadColor@@=\UnloadColor@ |
| 58 |
} |
| 59 |
\xydef@\NoXDVIcolordvi@{\xywarning@{% |
| 60 |
Neither colordvi.tex nor colordvi.sty could be found.}% |
| 61 |
\xyBEcolorcheck@}% |
| 62 |
\xydef@\xdviCrayola@@{\xdviColor@@\xdviCrayola@} |
| 63 |
\xydef@\xdviCrayola@{% |
| 64 |
\let\prevxycolor@=\newxycolor@ |
| 65 |
\def\newxyXDVIcolor@##1##2##3{\prevxycolor@{##1}{}{##1}}% |
| 66 |
\let\newxycolor@=\newxyXDVIcolor@ |
| 67 |
\installCrayolaColors@ |
| 68 |
\let\newxycolor@=\prevxycolor@ }% |
| 69 |
\xydef@\xdviPS@@{\xdviPS@} |
| 70 |
\xydef@\xdviPS@unload{\UnloadPS@ |
| 71 |
\let\UnloadPS@@=\UnloadPS@ |
| 72 |
\let\xdviPS@@=\xdviPS@ } |
| 73 |
\xydef@\xdviPStypes@{% |
| 74 |
\xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}% |
| 75 |
\ifx\PSspecial@@\xdviSpecial@\else |
| 76 |
\let\PSspecial@@=\xdviSpecial@ |
| 77 |
\let\PSmacro@@=\xdviMacro@ |
| 78 |
\let\PSdict@@=\xdviDict@ |
| 79 |
\let\PSspecialdict@@=\xdviDict@ |
| 80 |
\let\PSraw@@=\xdviRaw@ |
| 81 |
\let\PSinclude@@=\xdviInclude@ |
| 82 |
\let\xyPSobeylines@@=\obeyXDVIlines@ |
| 83 |
\let\xyPScurrpt@@=\xdviCurrpt@@ |
| 84 |
\xdvi@@{PostScript}% |
| 85 |
\fi \XYpredict@ } |
| 86 |
\xywarnifdefined\xdviSpecial@ |
| 87 |
\xywarnifdefined\xdviMacro@ |
| 88 |
\xywarnifdefined\xdviDict@ |
| 89 |
\xywarnifdefined\xdviInclude@ |
| 90 |
\xywarnifdefined\xdviRaw@ |
| 91 |
{\catcode`\"=11 \catcode`\!=11 \catcode`\:=11 |
| 92 |
\gdef\xdviSpecial@#1{\special{ps:: SDict begin #1 end}} |
| 93 |
\gdef\xdviMacro@#1{\firstPS@@\special{" {#1}xy}} |
| 94 |
\gdef\xdviDict@#1{\special{! #1}} |
| 95 |
\gdef\xdviInclude@#1{\special{header=#1}} |
| 96 |
\gdef\xdviRaw@#1{\special{ps: SDict begin #1 end}} |
| 97 |
\catcode`\^^M=\active |
| 98 |
\gdef\next{\catcode`\^^M=\active \let^^M=\space }}% |
| 99 |
\xylet@\obeyXDVIlines@=\next |
| 100 |
\xydef@\xdviCurrpt@{\let\xyPScurrpt@@=\xdviCurrpt@@}% |
| 101 |
\xydef@\xdviCurrpt@@{\PSraw@@{xyp}} |
| 102 |
\xydef@\xdviPS@{\xdviPStypes@ |
| 103 |
\let\xdviPS@@=\PSspecials@true |
| 104 |
\let\UnloadPS@@=\xdviPS@unload |
| 105 |
\let\installxyps@@=\relax \installxyps@ } |
| 106 |
\xydef@\xdviRotate@@{\xdviRotate@} |
| 107 |
\xydef@\xdviRotate@{\xdviPStypes@ |
| 108 |
\expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{% |
| 109 |
\xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}% |
| 110 |
\xdviCurrpt@ \xdviRotScale@ \installPSrotscale@ }% |
| 111 |
\else\DN@{\xydriverfail@{rotations are}UnloadRotate@\relax}\fi |
| 112 |
\next@ } |
| 113 |
\xydef@\xdviRotScale@{% |
| 114 |
\def\xyrot@start(##1){{xyct ##1\space xyrs }}% |
| 115 |
\def\xyrot@end{}% |
| 116 |
\def\xyscale@start(##1,##2){{xyct ##1\space##2\space xyss }}% |
| 117 |
\def\xyscale@end{}} |
| 118 |
\xydef@\xdviLine@@{\xdviLine@} |
| 119 |
\xydef@\xdviLine@{\xdviPStypes@ |
| 120 |
\expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{% |
| 121 |
\xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}\installPSline@ }% |
| 122 |
\else\DN@{\xydriverfail@{line-widths are}\UnloadLine@\relax}\fi |
| 123 |
\next@ } |
| 124 |
\xydef@\xdviFrames@@{\xdviFrames@} |
| 125 |
\xydef@\xdviFrames@{\xdviPStypes@ |
| 126 |
\expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{% |
| 127 |
\xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}\installPSframes@ }% |
| 128 |
\else\DN@{\xydriverfail@{frames are}\UnloadFrames@\relax}\fi |
| 129 |
\next@ } |
| 130 |
\xydef@\xdviTiles@@{\xdviTiles@} |
| 131 |
\xydef@\xdviTiles@{\xdviPStypes@ |
| 132 |
\expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{% |
| 133 |
\xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}\installPSpatterns@ }% |
| 134 |
\else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi |
| 135 |
\next@ } |
| 136 |
\xydef@\xdviTPIC@@{\xdviTPIC@} |
| 137 |
\xydef@\xdviTPIC@{\setupxyTPIC@} |
| 138 |
\xyendinput |