%% $Id: xydvips.doc,v 3.3 1996/12/18 09:13:14 ross Exp $ %% %% Xy-pic ``dvips-driver'' option. %% Copyright (c) 1995-1996 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-1996 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. %% \ifx\xyloaded\undefined \input xy \fi \xyprovide{dvips}{DVIPS driver}{\stripRCS$Revision: 3.3 $}% {Ross Moore}{ross@mpce.mq.edu.au}% {Mathematics Department, Macquarie University, NSW~2109, Australia} \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% This driver provides support for "all extensions" when using the \dvips\ driver by Tomas Rokicki~\cite{dvips}. It has been tested with dvips version~5.55a and dvipsk version~5.58f. \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \paragraph*{Header:}\leavevmode \DOCHEADER \paragraph*{Driver installation} \DOCMODE( \xydef@\dvips@@#1{\dvimessage@{dvips}{#1}} \newdriver{% \xyaddsupport{color}\dvipsColor@@ \xyaddsupport{crayon}\dvipsCrayola@@ \xyaddsupport{ps}\dvipsPS@@ \xyaddsupport{rotate}\dvipsRotate@@ \xyaddsupport{line}\dvipsLine@@ \xyaddsupport{frame}\dvipsFrames@@ \xyaddsupport{tile}\dvipsTiles@@ \xyaddsupport{tpic}\dvipsTPIC@ \xyaddsupport{emtex}\dvipsEM@ \xyaddsupport{cmtip}\relax } \DOCMODE) \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Supported |\special| effects are... % \begin{itemize} \item colour, using direct color specials and \PS. \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DVIPS uses the colour-stack method, due to Tomas Rokicki. \DOCMODE( \xydef@\dvips@Color@{\dvipsPStypes@ \let\xylocalColor@=\xystackcolor@ \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}}\installPScolor@ }% \else\DN@{}\fi \next@ \ifx\xycolor@@\xyNoColor@ \let\xycolor@@=\xycolor@raw@@\fi \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\dvipsCrayola@{}}% \else \DN@{\xystandardcolors@}\fi \next@ \let\dvipsColor@@=\relax \let\UnloadColor@@=\NoDVIPScolor@ }% \xydef@\dvipsColor@@{\dvips@Color@} \xydef@\NoDVIPScolor@{% \def\xycolor@{\xycolor@@}% \let\xycolor@@=\xyNoColor@ \let\xylocalColor@=\xyNoColor@@ \let\xycolorwarning@=\xycolorwarning@@ \let\dvipsColor@@=\dvips@Color@ \let\UnloadColor@@=\UnloadColor@ } \DOCMODE) If neither support file |colordvi.tex| nor |colordvi.sty| can be found, then the normal colour support will not be available. However the colour support for the \PS\ back-end can still be used. \DOCMODE( \xydef@\NoDVIPScolordvi@{\xywarning@{% Neither colordvi.tex nor colordvi.sty could be found.}% \xyBEcolorcheck@}% \DOCMODE) \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \item crayon colours. \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% The 68 colours that |dvips| recognizes by name are not loaded unless the |crayon| option has been requested. \DOCMODE( \xydef@\dvipsCrayola@@{\dvipsColor@@\dvipsCrayola@} \xydef@\dvipsCrayola@{% \let\prevxycolor@=\newxycolor@ \def\newxyDVIPScolor@##1##2##3{\prevxycolor@{##1}{}{##1}}% \let\newxycolor@=\newxyDVIPScolor@ \dvipsInclude@{color.pro}% % \xyinputorelse@{colordvi.tex}% % {\NoDVIPScolordvi@\let\newxycolor@=\prevxycolor@}% \installCrayolaColors@ \let\newxycolor@=\prevxycolor@ }% \DOCMODE) Although any order of loading options: |ps|, |dvips|, |color| and |crayon| produces the desired result visually, the \PS\ code can be different with different loading order. The most easily readable is obtained when |crayon| is requested last. \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \item \PS\ back-end. \DOCMODE( \xydef@\dvipsPS@@{\dvipsPS@} \xydef@\dvipsPS@unload{\UnloadPS@ \let\UnloadPS@@=\UnloadPS@ \let\dvipsPS@@=\dvipsPS@ } \DOCMODE) \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |dvips| has three kinds of \PS\ |\special| which can be used. These may be used with various features other than just the \PS\ backend. \DOCMODE( \xydef@\dvipsPStypes@{% \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}% \ifx\PSspecial@@\dvipsSpecial@\else \let\PSspecial@@=\dvipsSpecial@ \let\PSmacro@@=\dvipsMacro@ \let\PSdict@@=\dvipsDict@ \let\PSspecialdict@@=\dvipsDict@ \let\PSraw@@=\dvipsRaw@ \let\PSinclude@@=\dvipsInclude@ \let\xyPSobeylines@@=\obeyDVIPSlines@ \let\xyPScurrpt@@=\dvipsCurrpt@@ \dvips@@{PostScript}% \fi % \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}% \XYpredict@ } \xywarnifdefined\dvipsSpecial@ \xywarnifdefined\dvipsMacro@ \xywarnifdefined\dvipsDict@ \xywarnifdefined\dvipsInclude@ \xywarnifdefined\dvipsRaw@ {\catcode`\"=11 \catcode`\!=11 \catcode`\:=11 \gdef\dvipsSpecial@#1{\special{ps:: SDict begin #1 end}} \gdef\dvipsMacro@#1{\firstPS@@\special{" {#1}xy}} % \gdef\dvipsDict@#1{\special{! mark{#1}stopped cleartomark}} \gdef\dvipsDict@#1{\special{! #1}} \gdef\dvipsInclude@#1{\special{header=#1}} \gdef\dvipsRaw@#1{\special{ps: SDict begin #1 end}} \catcode`\^^M=\active % \gdef\next{\catcode`\^^M=\active \let^^M=\space }}% \xylet@\obeyDVIPSlines@=\next \DOCMODE) All the \PS\ definitions passed to |dvips| by reading the dictionary file are stored in a \PS\ dictionary which it defines, called |SDict|. This must be the current dictionary whenever an \Xy-ps command is to be executed. This will be the case whenever the |\special{" |{\it commands}|}| or |\special{! |{\it commands}|}| forms are used, but not when the |\special{ps:: |{\it commands}|}| form is used. Thus the |\dvipsSpecial@| macro includes code to open |SDict| and close it when finished; so also does the |\dvipsRaw@| type, since this is used with \Xy-pic\ \PS\ operators whose definitions have been placed within |SDict|. The |currentpoint| is defined for the ``raw'' specials. \DOCMODE( \xydef@\dvipsCurrpt@{\let\xyPScurrpt@@=\dvipsCurrpt@@}% \xydef@\dvipsCurrpt@@{\PSraw@@{xyp}} \DOCMODE) The \PS\ operator called |xyp| is defined in |xyps-ps| for storing the location read from |currentpoint|. \medskip This installs the \PS\ backend. \DOCMODE( \xydef@\dvipsPS@{\dvipsPStypes@ \let\dvipsPS@@=\PSspecials@true \let\UnloadPS@@=\dvipsPS@unload \let\installxyps@@=\relax \installxyps@ } \DOCMODE) \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \item rotated/scaled diagrams and text, using \PS. \DOCMODE( \xydef@\dvipsRotate@@{\dvipsRotate@} \xydef@\dvipsRotate@{\dvipsPStypes@ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{% \xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}% \dvipsCurrpt@ \dvipsRotScale@ \installPSrotscale@ }% \else\DN@{\xydriverfail@{rotations are}UnloadRotate@\relax}\fi \next@ } \xydef@\dvipsRotScale@{% \def\xyrot@start(##1){{xyct ##1\space xyrs }}% \def\xyrot@end{}% \def\xyscale@start(##1,##2){{xyct ##1\space##2\space xyss }}% \def\xyscale@end{}} \DOCMODE) \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \item variable line-widths and poly-lines, using \PS. \DOCMODE( \xydef@\dvipsLine@@{\dvipsLine@} \xydef@\dvipsLine@{\dvipsPStypes@ \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@\dvipsFrames@@{\dvipsFrames@} \xydef@\dvipsFrames@{\dvipsPStypes@ \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@\dvipsTiles@@{\dvipsTiles@} \xydef@\dvipsTiles@{\dvipsPStypes@ \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@\dvipsTPIC@@{\dvipsTPIC@} \xydef@\dvipsTPIC@{\setupxyTPIC@} \DOCMODE) \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \item em-\TeX\ drawing commands. \DOCMODE( \xydef@\dvipsEM@@{\dvipsEM@} \xydef@\dvipsEM@{\setupxyEMTeX@} \DOCMODE) \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \end{itemize} \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \paragraph*{The end \& Log}\leavevmode \DOCMODE( \xyendinput % $Log: xydvips.doc,v $ % Revision 3.3 1996/12/18 09:13:14 ross % minor improvements to file-loading commands % % Revision 3.2 1995/09/19 18:20:20 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: