summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/xypic/xyoztex.doc
blob: 4a5e34df9be1fd39e0301c50cdd8bd61ae3d7dcb (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
%% $Id: xyoztex.doc,v 3.3 1996/12/18 09:26:26 ross Exp $
%%
%% Xy-pic ``OzTeX'' driver interface 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{oztex}{OzTeX driver}{\stripRCS$Revision: 3.3 $}%
 {Ross Moore}{ross@mpce.mq.edu.au}%
 {Mathematics Department, Macquarie University, NSW~2109, Australia}

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

This driver provides the necessary interface to support the \PS\ back-end and
other \PS\ effects when using the DVI driver of versions 1.8+ of \OzTeX\ by
Andrew Trevorrow,\footnote{\OzTeX\ is a shareware implementation of \TeX\ for
Macintosh available from many bulletin boards and ftp sites; v1.5 and earlier
versions were freeware. Email contact: <akt@kagi.com>.}  "Earlier versions 
of \OzTeX\ should instead use the driver option |\xyoption{17oztex}|."

Effects such as colour, line-thickness and rotated or scaled diagrams are
only partially supported in that the effects cannot be applied to any text or
symbols placed using fonts. This is due to the nature of \OzTeX\ <driver>,
whose optimization of the placement of font-characters precludes the
applicability of such effects.  Furthermore the \PS\ dictionary must be
available in a file called |global.ps| or appended to the
|OzTeXdict.pro|. However with version 1.8 and later of \OzTeX, there is the
alternative of using the |dvips| <driver>, which does support all the \PS\
effects available in \Xy-pic.

\NOTE: To use \Xy-pic effectively with \OzTeX\ requires changing several
memory parameters. In particular a `Big-\TeX' is needed, along with an
increase in the |pool_size| parameter. Explicit instructions are contained 
in the file |INSTALL.|\-|OzTeX| of the \Xy-pic distribution.

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

\DOCMODE(
\xydef@\OzTeX@@#1{\dvimessage@{OzTeX}{#1}}

\newdriver{%
 \xyaddsupport{color}\oztexColor@@
 \xyaddsupport{crayon}\oztexCrayon@@
 \xyaddsupport{ps}\oztexPS@@
 \xyaddsupport{rotate}\oztexRotate@@
 \xyaddsupport{line}\oztexLine@@
 \xyaddsupport{frame}\oztexFrames@@
 \xyaddsupport{tile}\oztexTiles@@
 \xyaddsupport{cmtip}\relax
}
\DOCMODE)

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

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

\item colour, using \PS, but not of font-characters.

\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DOCMODE(
\xydef@\oztexColor@@{\OzTeXColours@}

\xydef@\OzTeXColours@{\OzTeXPStypes@
 \let\xylocalColor@=\xyNoColor@@ \def\xycolor@{\xycolor@@}%
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%\XYpredict@
  \xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}%
  \installPScolor@ }\else\DN@{}\fi \next@
 \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\OzTeXCrayon@@{}}%
 \else\let\next@=\xystandardcolors@\fi \next@
 \let\xycolorwarning@=\relax 
 \let\oztexColor@@=\relax
 \let\UnloadColor@@=\NoOzTeXColor@
}

\xydef@\NoOzTeXColor@{%
 \let\xylocalColor@=\xyNoColor@@
 \let\xycolor@=\xyNoColor@
 \let\xycolorwarning@=\xycolorwarning@@
 \let\oztexColor@@=\OzTeXColours@
 \let\UnloadColor@@=\UnloadColor@
 }
\DOCMODE)

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

\item crayon colours, similarly restricted.

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

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

\DOCMODE(
\xydef@\OzTeXCrayon@@{\installCrayolaColors@}
\DOCMODE)

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

\item \PS\ back-end.

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

\DOCMODE(
\xydef@\oztexPS@@{\oztexPS@}

\xydef@\oztexPSunload@{\UnloadPS@
 \def\xyPSdictname{}\UsePSdict@@false
 \let\installxyps@@=\relax
 \let\UnloadPS@@=\UnloadPS@
 \xyPSshapes@true 
 \let\oztexPS@@=\oztexPS@ }
\DOCMODE)

\DOCMODE(
\xydef@\OzTeXSpecial@#1{\special{empty.ps {#1}xy}}
\xydef@\OzTeXMacro@#1{\special{empty.ps {#1}xy}}
\xydef@\OzTeXDict@#1{\special{empty.ps @bxy{#1}stopped pop @exy}}
\xydef@\OzTeXinclude@#1{\special{#1}}
\xydef@\OzTeXraw@#1{\special{empty.ps @bxy #1 @exy}}%

\xydef@\OzTeXPStypes@{%
 \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
 \ifx\PSspecial@@\OzTeXSpecial@\else
  \let\PSspecial@@=\OzTeXSpecial@
  \let\PSmacro@@=\OzTeXMacro@
  \let\PSdict@@=\OzTeXDict@
  \let\PSraw@@=\OzTeXraw@
  \let\PSinclude@@=\OzTeXinclude@
  \let\xyPSobeylines@@=\obeyOzTeXlines@
  \let\PSspecialdict@@=\OzTeXDict@
  \OzTeX@@{PostScript}%
 \fi
% \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
 \OzTeXCurrpt@ }
 
{\catcode`\^^M=\active %
 \gdef\next{\catcode`\^^M=\active \let^^M=\space \obeyspaces}}
\xylet@\obeyOzTeXlines@=\next
\DOCMODE)

The \PS\ operators |@bxy| and |@exy| are defined in |xyps-ps| for bypassing
the mechanism used in \OzTeX\ to isolate code passed in |\special| commands.
Although it is possible (albeit difficult) to devise \PS\ to deduce the 
current location for use with the ``raw'' specials, this information cannot 
be used to do rotations and scaling as with other <driver>s. 
Hence the value of |\xyPScurrpt@@| is taken to be empty.

\DOCMODE(
\xydef@\OzTeXCurrpt@{\let\xyPScurrpt@@=\OzTeXCurrpt@@}%
\xydef@\OzTeXCurrpt@@{\PSraw@@{xyp}}
\DOCMODE)

\medskip

This avoids dumping the dictionary into the dvi-file, making sure
that instead it goes into a file, specified by |\xyPSdictname|,
which defaults to |global.ps|.

\DOCMODE(
\xydef@\oztexPS@{\OzTeXPStypes@ 
 \let\oztexPS@@=\relax
 \let\UnloadPS@@=\oztexPSunload@
 \let\installxyps@@=\@OzTeX@PS@
 \installxyps@ }

\xydef@\@OzTeX@PS@{\UsePSdict@@true
 \let\includePSmessage@=\xyOzTeXheader 
 \ifx\undefined\xyPSdictname\def\xyPSdictname{global.ps}\fi}
 
\xydef@\xyOzTeXheader#1#2#3{\UsePSdict@@true}
\DOCMODE)

The parameters |#1#2#3| of |\xyOzTeXheader| gobble tokens 
that are unnecessary with \OzTeX.

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

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

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

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

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

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

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

\item patterns and tiles, using \PS.
\DOCMODE(
\xydef@\oztexTiles@@{\OzTeXTiles@}

\xydef@\OzTeXTiles@{\OzTeXPStypes@
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
  \xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}\installPSpatterns@
  \xystandardpatterns@ }%
 \else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi
 \next@ }
\DOCMODE)

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

\item rotated/scaled diagrams and text, recognised but not supported.

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

In fact \OzTeX\ cannot support rotations and scaling. 
Instead we go through all the motions of providing \PS\ support, 
then set a flag that causes a limited number of warning messages to be 
generated as requests are made for these effects. 

\DOCMODE(
\xydef@\oztexRotate@@{\OzTeXRotate@}

\xydef@\OzTeXRotate@{\OzTeXPStypes@
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
  \xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
  \OzTeXRotScale@ \installPSrotscale@ \xyPSshapes@false }%
 \else\DN@{\xydriverfail@{rotations are}\UnloadRotate@\relax}\fi
 \next@ }
\DOCMODE)

This never worked properly. It requires too much hacking at Trevorrow's
code for little gain, since text-rotation can never work anyway.
Use the \dvips\ option instead!

\DOCMODE(
\xydef@\OzTeXRotScale@{%
 \def\xyrot@start(##1){%
  {xyp xyt ##1\space xyr}{OzXy begin gsave}}% 
 \def\xyscale@start(##1,##2){%
  {xyp xyt ##1\space##2\space xys}{OzXy begin gsave}}%
 \def\xyrot@end{grestore end}\def\xyscale@end{grestore end}}
\DOCMODE)

The default code will just do nothing as far as the output is concerned...

\DOCMODE(
\let\OzTeXRotScale@=\xyRotScale@@
\DOCMODE)

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

\end{itemize}

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

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

\DOCMODE(
\xyendinput

% $Log: xyoztex.doc,v $
% Revision 3.3  1996/12/18  09:26:26  ross
% improvements to file-loading commands
% fixed missing @ bug
%
% Revision 3.2  1995/09/19  18:21:41  ross
% Bug fix release.
%
% Revision 3.1  1995/09/05  20:36:33  ross
% Release!
%
% Revision 3.0  1995/07/07  20:13:19  ross
% Major release w/new User's Guide!
%
% Revision 2.13  1995/07/04  15:04:51  ross
% Ready for release of v3.
%
% NEW for version 3. 
\DOCMODE)

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

% Tell Emacs that this is a LaTeX document and how it is formatted:
% Local Variables:
% mode:latex
% fill-column:77
% End: