summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/xypic/xydvitops.doc
blob: c6e0c0a642354ad14e0b1f3b35086b086dbe6c98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
%% $Id: xydvitops.doc,v 3.3 1996/12/18 09:14:36 ross Exp $
%%
%% Xy-pic ``DVITOPS-driver'' option.
%% Copyright (c) 1995-1996	Ross Moore	<ross@mpce.mq.edu.au>
%%
%% 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-1996	Kristoffer H. Rose	<krisrose@brics.dk>
%%
%% 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, write to the Free Software Foundation, Inc.,
%% 675 Mass Ave, Cambridge, MA 02139, USA.
%%
\ifx\xyloaded\undefined \input xy \fi

\xyprovide{dvitops}{DVITOPS driver}{\stripRCS$Revision: 3.3 $}%
 {Ross Moore}{ross@mpce.mq.edu.au}%
 {Mathematics Department, Macquarie University, NSW~2109, Australia}

\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\DVITOPS{{\sc dvitops}}
This file provides support for the \DVITOPS\ driver by James 
Clark. As of September 1995, it has not been fully tested.

\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph*{Header:}\leavevmode
\DOCHEADER

\DOCMODE(
\xydef@\dvitops@@#1{\dvimessage@{DVITOPS}{#1}}

\newdriver{%
 \xyaddsupport{color}\dvitopsColor@@
 \xyaddsupport{crayon}\dvitopsCrayon@@
 \xyaddsupport{ps}\dvitopsPS@@
 \xyaddsupport{rotate}\dvitopsRotate@@
 \xyaddsupport{line}\dvitopsLine@@
 \xyaddsupport{frame}\dvitopsFrames@@
 \xyaddsupport{tile}\dvitopsTiles@@
% \xyaddsupport{tpic}\dvitopsTPIC@@
 \xyaddsupport{cmtip}\relax
}
\DOCMODE)

\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Supported |\special| effects are...
%
\begin{itemize}

\item colour, using direct color specials for |gray|, |rgb| and |hsb| colour
 models; and \PS\ colour within diagrams;

\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\DVITOPS\ has a method for using colours locally, however it only colours 
``regions'', which cannot be nested. To use this within \Xy-pic\ 
diagrams would be just asking for trouble.

\DOCMODE(
\xydef@\dvitopsColor@@{\dvitops@Color@}

\xydef@\dvitops@Color@{\dvitopsPStypes@ 
 \let\xylocalColor@=\xyDVITOPScolor@ 
 \let\xycolor@push\xycolor@push@@
 \def\xycolor@{\xycolor@@}\let\xycolorwarning@=\relax
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
  \xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}\xycatcodes
  \installPScolor@ }\else\DN@{}\fi \next@
 \ifx\xycolor@@\xyNoColor@ \let\xycolor@@=\xycolor@raw@@\fi
 \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\dvitopsCrayon@{}}%
 \else\let\next@=\xystandardcolors@
 \fi \next@
 \let\dvitops@Color@@=\relax
 \let\UnloadColor@@=\NoDVITOPScolor@
 }%

\xydef@\NoDVITOPScolor@{%
 \def\xycolor@{\xycolor@@}%
 \let\xycolor@@=\xyNoColor@
 \let\xylocalColor@=\xyNoColor@@
 \let\xycolorwarning@=\xycolorwarning@@
 \let\dvitops@Color@@=\dvitops@Color@
 }
\DOCMODE)

\DOCMODE(
\xydef@\xyDVITOPScolor@{\bgroup \DN@##1##2{\egroup}%
 \ifInvisible@\else\ifHidden@\else\DNii@{\no@@}\ifx\nextii@\Connect@@ 
 \else\DN@{\xyDVITOPScolor@i}\fi\fi\fi \next@ }

\xydef@\xyDVITOPScolor@i#1#2{\checkXyStyle@ 
 \DN@{#2}\ifx\next@\empty
  \def\tmp@##1{\DN@{\xycolor@begin##1\xycolor@end{#1}}}%
 \else\DNii@{gray}\ifx\next@\nextii@
  \def\tmp@##1{\DN@{\xycolor@begin##1\xycolor@end{gray}{#1}}}%
 \else\DNii@{rgb}\ifx\next@\nextii@
  \def\tmp@##1{\DN@{\xycolor@begin##1\xycolor@end{rgbcolor}{#1}}}%
 \else\DNii@{hsb}\ifx\next@\nextii@
  \def\tmp@##1{\DN@{\xycolor@begin##1\xycolor@end{hsbcolor}{#1}}}%
 \else \DN@{\xywarning@{DVITOPS cannot support color: #2 #1}}%
 \fi\fi\fi\fi
 \toks@={\egroup \let\xy@style@=\relax \def\Drop@@}%
 \expandafter\tmp@\expandafter{\Drop@@}%
 \expandafter\addtotoks@\expandafter{\expandafter{\next@}\def\Connect@@}%
  \expandafter\tmp@\expandafter{\Connect@@}%
 \expandafter\addtotoks@\expandafter{\expandafter{\next@}}%
 \the\toks@ }%

\xydef@\xycolor@begin{\dvitopsBegin@{color}}
\xydef@\xycolor@end{\dvitopsEnd@{color}\dvitopsColor@x}
\DOCMODE)

\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item crayon colours.

\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The 68 colours are those that |dvips| recognizes by name, 
thanks to Tomas Rokicki. 

\DOCMODE(
\xydef@\dvitopsCrayon@@{\dvitopsColor@@\dvitopsCrayon@}
\xydef@\dvitopsCrayon@{\installCrayolaColors@}%
\DOCMODE)

\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item \PS\ back-end.
\DOCMODE(
\xydef@\dvitopsPS@@{\dvipsPS@}

\xydef@\dvitopsPS@unload{\UnloadPS@
 \let\UnloadPS@@=\UnloadPS@
 \let\dvitopsPS@@=\dvitopsPS@ }
\DOCMODE)

\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\DVITOPS\ has two kinds of |\special| which can be used; `inline' and 
`prolog' for including header files. Also there are the `begin' and `end'
types for defining regions.

\DOCMODE(
\xydef@\dvitopsPStypes@{%
 \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
 \ifx\PSspecial@@\dvitopsSpecial@\else
  \let\PSspecial@@=\dvitopsSpecial@
  \let\PSmacro@@=\dvitopsMacro@
  \let\PSdict@@=\dvitopsDict@
  \let\PSspecialdict@@=\dvitopsDict@
  \let\PSraw@@=\dvitopsRaw@
  \let\PSinclude@@=\dvitopsInclude@
  \let\xyPSobeylines@@=\obeyDVIPSlines@
  \let\xyPScurrpt@@=\dvitopsCurrpt@@
  \dvitops@@{PostScript}%
 \fi
% \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
 \XYpredict@ }

\xywarnifdefined\dvitopsSpecial@
\xywarnifdefined\dvitopsMacro@
\xywarnifdefined\dvitopsDict@
\xywarnifdefined\dvitopsInclude@
\xywarnifdefined\dvitopsRaw@
\xywarnifdefined\dvitopsOrigin@
\xywarnifdefined\dvitopsBegin@
\xywarnifdefined\dvitopsEnd@
\xywarnifdefined\dvitopsRotate@x
\xywarnifdefined\dvitopsTransform@x
\xywarnifdefined\dvitopsColor@x
{\catcode`\:=11
 \gdef\dvitopsSpecial@#1{\special{dvitops: inline #1}}
 \gdef\dvitopsMacro@#1{\special{dvitops: inline {#1}xy}}
 \gdef\dvitopsDict@#1{\special{dvitops: inline #1}}
 \gdef\dvitopsInclude@#1{\special{dvitops: prolog #1}}
 \gdef\dvitopsRaw@#1{\special{dvitops: inline #1}}
%
 \gdef\dvitopsOrigin@#1{\special{dvitops: origin #1}}
 \gdef\dvitopsBegin@#1{\special{dvitops: begin #1}}
 \gdef\dvitopsEnd@#1{\special{dvitops: end #1}}
 \gdef\dvitopsRotate@x#1{\special{dvitops: rotate #1}}
 \gdef\dvitopsTransform@x#1{\special{dvitops: transform #1}}
 \gdef\dvitopsColor@x#1#2{\special{dvitops: #1 color #2}}
}

\catcode`\^^M=\active %
 \gdef\next{\catcode`\^^M=\active \let^^M=\space }}%
\xylet@\obeyDVIPSlines@=\next
\DOCMODE)

Rotations and transformations use a different mechanism, so |\xyPScurrpt@@|
can be set to |\relax|. 

\DOCMODE(
\xydef@\dvitopsCurrpt@{\global\let\xyPScurrpt@@=\relax}%
\DOCMODE)

\medskip

This installs the \PS\ backend.

\DOCMODE(
\xydef@\dvitopsPS@{\dvitopsPStypes@ 
 \let\installxyps@@=\relax \installxyps@ }
\DOCMODE)

\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item rotated/scaled diagrams and text, using \DVITOPS\ specials;
 however these may not be nested.

\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\DOCMODE(
\xydef@\dvitopsRotate@@{\dvitopsRotate@}

\xydef@\dvitopsRotate@{\dvitopsPStypes@
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty
  \DN@{\xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
  \installDVITOPSrotate@ }%
 \else\DN@{\xydriverfail@{rotations are}\UnloadRotate@\relax}\fi
 \next@ }

\xydef@\dvitopsRotScale@{%
 \def\xyrot@start{\dvitopsBegin@{rot}\dvitopsOrigin@{rot}}%
 \def\xyrot@end(##1){\dvitopsEnd@{rot}\dvitopsRotate@x{##1}}%
 \def\xyscale@start{\dvitopsBegin@{scal}\dvitopsOrigin@{scal}}%
 \def\xyscale@end(##1,##2){%
  \dvitopsEnd@{scal}\dvitopsTransform@x{##1 0 ##2 0}}%
 }

\xydef@\installDVITOPSrotate@{\installPSstyle@
 \let\xyRotate@@=\dvitopsRotate@
 \let\doSpecialRotate@@=\dvitopsSpecialRotate@
 \let\xyscale@@=\dvitopsScale@
 \dvitopsCurrpt@
 \dvitopsRotScale@ \xyPSshapes@true }

\xydef@\UnloadDVITOPSrotate@{\UnloadRotate@\relax}
\DOCMODE)

\DOCMODE(
 \xydef@\dvitopsRotate@#1{\xyPSsplitPS@
  {\dvitopsBegin@{rot}\dvitopsOrigin@{rot}}%
  {\dvitopsEnd@{rot}\dvitopsRotate@x{#1}}}%

 \xydef@\dvitopsScale@#1#2{\xyPSsplitPS@
  {\dvitopsBegin@{scal}\dvitopsOrigin@{scal}}%
  {\dvitopsEnd@{scal}\dvitopsTransform@x{#1 0 #2 0}}}

 \xydef@\dvitopsSpecialRotate@#1@@{\dvitopsRotate@{#1}}
\DOCMODE)

\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item variable line-widths and poly-lines, using \PS.
\DOCMODE(
\xydef@\dvitopsLine@@{\dvitopsLine@}

\xydef@\dvitopsLine@{\dvitopsPStypes@ 
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
  \xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}\installPSline@ }%
 \else\DN@{\xydriverfail@{line-widths are}\UnloadLine@\relax}\fi
 \next@ }
\DOCMODE)

\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item extra frames and fills, using \PS.
\DOCMODE(
\xydef@\dvitopsFrames@@{\dvitopsFrames@}

\xydef@\dvitopsFrames@{\dvitopsPStypes@
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
  \xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}\installPSframes@ }%
 \else\DN@{\xydriverfail@{frames are}\UnloadFrames@\relax}\fi
 \next@ }
\DOCMODE)

\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item patterns and tiles, using \PS\ 
\DOCMODE(
\xydef@\dvitopsTiles@{\dvitopsPStypes@ 
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
  \xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}\installPSpatterns@ }%
 \else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi
 \next@ }
\DOCMODE)

\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item \TPIC\ drawing commands.
\DOCMODE(
\xydef@\dvitopsTPIC@@{\dvitopsTPIC@}

\xydef@\dvitopsTPIC@{\setupxyTPIC@}
\DOCMODE)

\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{itemize}

\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\paragraph*{The end \& Log}\leavevmode

\DOCMODE(
\xyendinput

% $Log: xydvitops.doc,v $
% Revision 3.3  1996/12/18  09:14:36  ross
% minor improvements to file-loading commands
%
% Revision 3.2  1995/09/19  18:21:41  ross
% Bug fix release.
%
% Revision 3.1  1995/09/05  20:28:57  ross
% Releasing version 3.1!
%
% NEW for version 3. 
\DOCMODE)

\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Tell Emacs that this is a LaTeX document and how it is formatted:
% Local Variables:
% mode:latex
% fill-prefix:"\t"
% fill-column:77
% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
% End: