%% $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 %% %% 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 %% %% 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 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 configurations untested by the authors of \Xy-pic, who should be notified of any difficulties. \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \paragraph*{Installation} The -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 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: