| 1 |
%% xyemtex.tex from $Id: xyemtex.doc,v 3.7 2011/03/14 20:14:00 krisrose Exp $ |
| 2 |
%% |
| 3 |
%% Xy-pic ``em-TeX'' back-end extension. |
| 4 |
%% Copyright (c) 1995-1996 Ross Moore <[email protected]> |
| 5 |
%% |
| 6 |
%% This file is part of the Xy-pic package for graphs and diagrams in TeX. |
| 7 |
%% See the companion README and INSTALL files for further information. |
| 8 |
%% Copyright (c) 1991-2011 Kristoffer H. Rose <[email protected]> |
| 9 |
%% |
| 10 |
%% The Xy-pic package is free software; you can redistribute it and/or modify |
| 11 |
%% it under the terms of the GNU General Public License as published by the |
| 12 |
%% Free Software Foundation; either version 2 of the License, or (at your |
| 13 |
%% option) any later version. |
| 14 |
%% |
| 15 |
%% The Xy-pic package is distributed in the hope that it will be useful, but |
| 16 |
%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 17 |
%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 18 |
%% for more details. |
| 19 |
%% |
| 20 |
%% You should have received a copy of the GNU General Public License along |
| 21 |
%% with this package; if not, see http://www.gnu.org/licenses/. |
| 22 |
%% |
| 23 |
\ifx\xyloaded\undefined \input xy \fi |
| 24 |
\xyprovide{emtex}{em-TeX backend}{\stripRCS$Revision: 3.7 $}% |
| 25 |
{Ross Moore}{[email protected]}% |
| 26 |
{Mathematics Department, Macquarie University, NSW~2109, Australia} |
| 27 |
\xynew@{if}\ifEMspecials@ |
| 28 |
\xydef@\UseEMspecials{\EMspecials@true} |
| 29 |
\xydef@\NoEMspecials{\EMspecials@false} |
| 30 |
\xydef@\xyemtex@lineto{\xyEM@special{lineto}} |
| 31 |
\xydef@\xyemtex@moveto{\xyEM@special{moveto}} |
| 32 |
\xydef@\xyemtex@line#1{\xyEM@special{line #1}} |
| 33 |
\xydef@\xyemtex@point#1{\xyEM@special{point #1}} |
| 34 |
\xydef@\xyemtex@pen#1{\addtostyletoks@{\xyEM@special{linewidth #1}}} |
| 35 |
{\catcode`:=12 \gdef\next#1{\special{em:#1}}} |
| 36 |
\xylet@\xyEM@special=\next |
| 37 |
{\catcode`:=12 \gdef\next#1{% |
| 38 |
\W@{EM:#1 (\the\X@p,\the\Y@p),(\the\X@c,\the\Y@c)}\special{em:#1}}} |
| 39 |
\xylet@\xyEM@noisy=\next |
| 40 |
\xydef@\NoisyEMTeX{\let\xyEM@special=\xyEM@noisy} |
| 41 |
\xydef@\EMalternative@#1#2{% |
| 42 |
\expandafter\global\expandafter\let\csname origxy#2@\endcsname=#1% |
| 43 |
\xdef#1{\noexpand\ifEMspecials@ |
| 44 |
\noexpand\expandafter\expandafter\noexpand\csname xyemtex@#2@\endcsname |
| 45 |
\noexpand\else |
| 46 |
\noexpand\expandafter\expandafter\noexpand\csname origxy#2@\endcsname |
| 47 |
\noexpand\fi}}% |
| 48 |
\xydef@\setupxyEMTeX@{\xywarning@{using em-TeX specials}% |
| 49 |
\EMalternative@{\solid@}{solid}% |
| 50 |
\EMalternative@{\splinesolid@}{splinesolid}% |
| 51 |
\let\setupxyEM@=\reloadxyEM@ |
| 52 |
\activateEM@ } |
| 53 |
\xydef@\xyunloadEM@{\xywarning@{EM specials turned off}% |
| 54 |
\xywithoption{line}{\xysetup@@\uninstallEMline@ }% |
| 55 |
\EMspecials@false |
| 56 |
\let\setupxyEM@=\reloadxyEM@ } |
| 57 |
\xydef@\activateEM@{% |
| 58 |
\xywithoption{line}{\xysetup@@\installEMline@}% |
| 59 |
\EMspecials@true } |
| 60 |
\xydef@\reloadxyEM@{\xywarning@{EM specials back on}\activateEM@ } |
| 61 |
\xydef@\xyemtex@solid@{% |
| 62 |
\ifInvisible@ \let\next@=\no@@ |
| 63 |
\else \DN@{\xyEMstraight@}\fi |
| 64 |
\next@ } |
| 65 |
\xydef@\xyEMstraight@{\setupDirection@ |
| 66 |
\edef\Creset@@{\cfromthec@ \pfromthep@ \DirectionfromtheDirection@}% |
| 67 |
\DN@##1##2{\def\checkoverlap@@{% |
| 68 |
\ifdim##1\X@p>##1\X@c \let\next@=\relax \fi |
| 69 |
\ifdim##2\Y@p>##2\Y@c \let\next@=\relax \fi}}% |
| 70 |
\edef\nextii@{{\sd@X}{\sd@Y}}\expandafter\next@\nextii@ |
| 71 |
\noCshavep@@ \edef\Cshavep@@{\pfromthep@ \noexpand\resetDirection@}% |
| 72 |
\noCshavec@@ \edef\Cshavec@@{\cfromthec@ \noexpand\resetDirection@}% |
| 73 |
\ifHidden@\else |
| 74 |
\ifdim\Y@c>\Y@max \Y@max=\Y@c \fi \ifdim\Y@p>\Y@max \Y@max=\Y@p \fi |
| 75 |
\ifdim\Y@c<\Y@min \Y@min=\Y@c \fi \ifdim\Y@p<\Y@min \Y@min=\Y@p \fi |
| 76 |
\ifdim\X@c>\X@max \X@max=\X@c \fi \ifdim\X@p>\X@max \X@max=\X@p \fi |
| 77 |
\ifdim\X@c<\X@min \X@min=\X@c \fi \ifdim\X@p<\X@min \X@min=\X@p \fi \fi |
| 78 |
\ifInvisible@\let\next@=\relax \else |
| 79 |
\DN@{% |
| 80 |
\setboxz@h{\kern\X@p \raise\Y@p\hbox{\xyemtex@moveto}}% |
| 81 |
\ht\z@=\z@ \wd\z@=\z@ \dp\z@=\z@ |
| 82 |
\setboxz@h{\boxz@ \kern\X@c \raise\Y@c\hbox{\xyemtex@lineto}}% |
| 83 |
\ht\z@=\z@ \wd\z@=\z@ \dp\z@=\z@ {\Drop@@}}% |
| 84 |
\fi |
| 85 |
\checkoverlap@@ |
| 86 |
\ifdim\d@X=\z@ \ifdim\d@Y=\z@ \DN@{\relax}\fi\fi \next@ |
| 87 |
\def\Cslidep@@{\noCslidep@@}\def\Cslidec@@{\noCslidec@@}% |
| 88 |
\def\Calong@@{\noCalong@@}\Creset@@ } |
| 89 |
\xydef@\xyemtex@splinesolid@{\setbox\splinebox@=\copy\voidb@x |
| 90 |
\multiply\splinetol@\thr@@ |
| 91 |
\gdef\splineextra@@{\xyemtex@moveto\gdef\splineextra@@{\xyemtex@lineto}}% |
| 92 |
\def\xycrvdrop@{ }\def\xycrvconn@{}\splineset@@ } |
| 93 |
\xydef@\xyEMlinewidth@#1{\dimen@=#1\relax\edef\next@{\the\dimen@}} |
| 94 |
\xydef@\installEMline@{% |
| 95 |
\let\xylinewidth@@=\xylinewidth@ |
| 96 |
\let\xylineSpecial@@=\xyemtex@pen |
| 97 |
\let\transxyline@@=\xyEMlinewidth@ } |
| 98 |
\xydef@\uninstallEMline@{\UnloadLine@\relax}% |
| 99 |
\xydef@\UseEMlinewidth{\installEMline@}% |
| 100 |
\xydef@\NoEMlinewidth{\uninstallEMline@}% |
| 101 |
\xyendinput |