summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/xypic/xyps-f.doc
blob: fc3794d58151edcf5de9d1d039420eb3804fcacb (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
%% $Id: xyps-f.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
%%
%% Xy-pic ``Frame extension'' PostScript backend support.
%% Copyright (c) 1995-1997	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-1997	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.
%%
%% As a special exception, you may use this file and all files derived
%% from it without restrictions.  This special exception was added with
%% version 3.7 of Xy-pic.
%%
\expandafter\ifx\csname xyps-floaded\endcsname\empty
 \message{not reloaded}\endinput \fi
\expandafter\let\csname xyps-floaded\endcsname=\empty \xycatcodes

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

\subsection{Frames}

The included file |xyps-f.tex| (version \stripRCS$Revision: 3.7 $) provides
\PS\ support for the effects defined in the |frame| extension described
in~\S??g[:frame].  It implements some effects otherwise unattainable.

This file is loaded and its effects are activated automatically whenever
|\xyoption{frame}| is requested and the current <driver> supports \PS\
effects for frames. Should there be any need to turn off this support, the
following commands are available; they obey usual \TeX\ groupings.
%
\begin{defs}
|\NoPSframes| & remove \PS\ support\kern-50pt \cr
|\UsePSframes| & reinstate \PS.
\end{defs}
%
Without \PS\ support ellipses may be shown as circles and all filled
regions may be represented as black rectangles.
These commands are provided primarily for testing and trouble-shooting; 
\eg~with <driver> configurations untested by the authors of \Xy-pic, 
who should be notified of any difficulties. 

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

\paragraph*{Installation}

The <driver>-file must call the following macro to rebind control sequences 
defined in |xyframe|, thereby allowing the \PS\ methods to be used.

\DOCMODE(
\xydef@\installPSframes@{%
 \let\framed@body@@=\xyPSframed@body@
 \let\circled@x@@=\xyPScircled@x@
 \let\ellipsed@x@@=\xyPSellipsed@x@
 \installPSfills@
 \xyuncatcodes}

\xydef@\UsePSframes{\installPSframes@}
\xydef@\NoPSframes{\UnloadFrames@}
\DOCMODE)

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

\paragraph*{Frames: solid, dotted and dashed}

For solid frames use \PS\ ovals, otherwise adjust the spacing between dashes 
or dots according to the lengths, both vertical and horizontal.

\DOCMODE(
\xydef@\xyPSframed@body@{\DN@{\framed@body@}%
 \ifx\framehfill\frm@solidh@@
  \DN@{\xyPSframed@oval@\xyPSoval@Special}%
% \else\ifdim\frmradius@@=\z@\else
 \else\ifdim\R@=\z@\else
  \ifx\framehfill\frm@dashh@@
   \DN@{\xyPSframed@oval@\xyPSdashoval@Special}%
  \else\ifx\framehfill\frm@doth@@
   \DN@{\xyPSframed@oval@\xyPSdotoval@Special}%
  \fi\fi
 \fi\fi \next@ }

\xydef@\xyPSframed@oval@#1{\vglue\U@c
	\hbox{\hglue\L@c\xypsoval@#1\hglue\R@c}\vglue\D@c}


\xydef@\xyPScircled@x@{\DN@{\xyPScircled@x@@\xyPScirc@Special}%
 \ifx\framehfill\frm@doth@@
  \DN@{\xyPScircled@x@@\xyPSdotcirc@Special}%
 \else\ifx\framehfill\frm@dashh@@
  \DN@{\xyPScircled@x@@\xyPSdashcirc@Special}%
 \fi\fi \next@ }

\xydef@\xyPScircled@x@@#1{\vglue2\R@
 \hbox{\hglue2\R@\xypscircle@#1\hglue2\R@}%
 \vglue2\R@}
\DOCMODE)

In practice the parameters |#1| and |#2| will hold <dimen>s.

\DOCMODE(
\xydef@\xyPSellipsed@x@#1#2{%
 \DN@{\xyPSellipsed@x@@\xyPScirc@Special}%
 \ifx\framehfill\frm@doth@@
  \DN@{\xyPSellipsed@x@@\xyPSdotcirc@Special}%
 \else\ifx\framehfill\frm@dashh@@
  \DN@{\xyPSellipsed@x@@\xyPSdashcirc@Special}%
 \fi\fi \next@{#1}{#2}}

\xydef@\xyPSellipsed@x@@#1#2#3{\vglue #3\vglue #3\relax
 \hbox{\L@c = #2\relax \R@c=\L@c \D@c = #3\relax \U@c=\D@c 
  \hglue#2\hglue#2\relax\xypsellipse@#1\hglue#2\hglue#2\relax}%
 \vglue #3\vglue #3\relax}
\DOCMODE)


These may be used for dashed frames.

\DOCMODE(
\xydef@\xyPSdashhfill@{{\SemiDirectionChar=95 \Direction=3072 \xyPSdash@}}
\xydef@\xyPSdashvfill@{{\SemiDirection=31 \Direction=1023 \xyPSdash@}}
\DOCMODE)

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

\paragraph*{ovals and circles}

The width, height, corner-radius are available as |\dimen@i|, |\dimen@ii| 
and |\R@| respectively; we only need |\R@| here, 
since the extents hold the real information that we need. 

\DOCMODE(
\xydef@\xypsoval@#1{%
 \dimen@=\L@c \advance\dimen@\R@c
 \dimen@ii=\U@c \advance\dimen@ii\D@c 
 \ifdim\dimen@ii<\dimen@ \relax \dimen@=\dimen@ii\fi \divide\dimen@\tw@
% \R@=\frmradius@@
 \ifdim\R@>\dimen@ \relax \R@=\dimen@ \fi
 \D@c=-\D@c \L@c=-\L@c 
 \edef\tmp@{\expandafter\removePT@\the\R@
  \space\expandafter\removePT@\the\R@c 
  \space\expandafter\removePT@\the\D@c 
  \space\expandafter\removePT@\the\L@c 
  \space\expandafter\removePT@\the\U@c }%
 \expandafter#1\expandafter{\tmp@}}

\xydef@\xypscircle@#1{\dimen@=\R@
 \edef\tmp@{\expandafter\removePT@\the\dimen@}%
 \expandafter#1\expandafter{\tmp@}}

\xydef@\xypsellipse@#1{\edef\tmp@{%
  \expandafter\removePT@\the\U@c \space
  \expandafter\removePT@\the\D@c \space
  \expandafter\removePT@\the\L@c \space
  \expandafter\removePT@\the\R@c }%
 \expandafter#1\expandafter{\tmp@}}

\xydef@\xyPSoval@Special#1{\PSmacro@{#1 ov}}
\xydef@\xyPScirc@Special#1{\PSmacro@{#1 ox}}
\xydef@\xyPSdotcirc@Special#1{\PSmacro@{#1 ot}}
\xydef@\xyPSdashcirc@Special#1{\PSmacro@{#1 od}}
\xydef@\xyPSdotoval@Special#1{\PSmacro@{#1 vt}}
\xydef@\xyPSdashoval@Special#1{\PSmacro@{#1 vd}}
\DOCMODE)

The \PS\ operators |ov|, |ox| etc.  are defined within |xyps-pro|, 
having scope limited to |XYdict| and sub-dictionaries.

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

\paragraph*{Filled regions}

\DOCMODE(
\xydef@\xyPSfilledRegion#1#2{\setboxz@h{\lower\D@c\vbox{%
 \vglue\U@c\hbox{#1#2\empty\hglue\L@c\hglue\R@c}\vglue\D@c}}%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}

\xydef@\filledRectangle@PS{%
 \xyPSfilledRegion{\xypsoval@\xyPSfilloval@Special}}
\xydef@\filledCircle@PS#1{{\R@c=\R@ \L@c=\R@ \U@c=\R@ \D@c=\R@
 \xyPSfilledRegion{\xypscircle@\xyPSfillcirc@Special}#1}}
\xydef@\filledEllipse@PS{%
 \xyPSfilledRegion{\xypsellipse@\xyPSfillellipse@Special}}
\xydef@\filledOval@PS{%
 \xyPSfilledRegion{\xypsoval@\xyPSfilloval@Special}}

\xydef@\frame@emph@PS#1{\filled@{#1}\relax}

\xydef@\installPSfills@{%
 \let\frame@emph@@=\frame@emph@PS
 \let\filledRectangle@@=\filledRectangle@PS
 \let\filledOval@@=\filledOval@PS
 \let\filledCircle@@=\filledCircle@PS
 \let\filledEllipse@@=\filledEllipse@PS
}
\DOCMODE)

Rectangles are treated as a special case of ovals.
The |#2| parameter signifies whether the outline of the object 
should also be stroked (|#2|=|\relax|) after being filled.
Such a stroke is always in black.

\DOCMODE(
%\xydef@\xyPSfillrect@Special#1#2{%
% \ifx#2\relax\PSmacro@{#1 sfr}%
% \else\PSmacro@{#1 fr}\fi}
\xydef@\xyPSfilloval@Special#1#2{%
 \ifx#2\relax\PSmacro@{#1 sfo}%
 \else\PSmacro@{#1 fo}\fi}
\xydef@\xyPSfillcirc@Special#1#2{%
 \ifx#2\relax\PSmacro@{#1 sfc}%
 \else\PSmacro@{#1 fc}\fi}
\xydef@\xyPSfillellipse@Special#1#2{%
 \ifx#2\relax\PSmacro@{#1 sfe}%
 \else\PSmacro@{#1 fe}\fi}
\DOCMODE)

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

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

\DOCMODE(
\endinput

% $Log: xyps-f.doc,v $
% Revision 3.7  1999/02/16 15:12:50  krisrose
% Interim release (Y&Y fonts now free).
%
% Revision 3.4  1997/05/18 01:13:24  ross
% Essential bugfixes.
%
% Revision 3.3  1996/12/18  10:07:22  ross
% cosmetic changes to macro-names
%
% 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.0 by by Ross Moore.
\DOCMODE)

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

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