| 1 |
%% xytile.tex from $Id: xytile.doc,v 3.8 2011/03/14 20:14:00 krisrose Exp $ |
| 2 |
%% |
| 3 |
%% Xy-pic ``Pattern and Tile extension'' option. |
| 4 |
%% Copyright (c) 1993-1997 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{tile}{Pattern and Tile extension}{\stripRCS$Revision: 3.8 $}% |
| 25 |
{Ross Moore}{[email protected]}% |
| 26 |
{Mathematics Department, Macquarie University, NSW~2109, Australia} |
| 27 |
\xydef@\xypatternwarning@@{\xypatternmessage@ |
| 28 |
\gdef\xypatternwarning@{\xypatternmessage@ |
| 29 |
\xywarning@{...no further pattern warnings will be given.}% |
| 30 |
\global\let\xypatternwarning@=\relax }} |
| 31 |
\xylet@\xypatternwarning@=\xypatternwarning@@ |
| 32 |
\xydef@\xypatternmessage@{% |
| 33 |
\xywarning@{Current driver does not support patterns.}}% |
| 34 |
\xydef@\newxypattern{\begingroup\xycatcodes\newxypattern@i} |
| 35 |
\xydef@\newxypattern@i#1#2{\edef\next@{\endgroup |
| 36 |
\noexpand\newxyPattern{#1}{}{#2}{}}\next@} |
| 37 |
\xydef@\newxyPattern#1#2#3#4{\newxypattern@{#1}{#2}{#3}{#4}{}} |
| 38 |
\xydef@\newxypattern@#1#2#3#4#5{% |
| 39 |
\expandafter\let\expandafter\next@\csname shape [#1]\endcsname |
| 40 |
\ifx\next@\relax |
| 41 |
\DN@{#4}\ifx\next@\empty |
| 42 |
\DN@{#2}\ifx\next@\empty |
| 43 |
\DN@{\newxystyle{#1}{\xylocalpattern@{}{#3}\xypattern@{#3}}}% |
| 44 |
\else |
| 45 |
\DN@{\newxystyle{#1}{\xylocalpattern@{#2}{#3}\xypattern@{#2 #3}}}% |
| 46 |
\fi |
| 47 |
\else\DN@{#2#3}\ifx\next@\empty |
| 48 |
\DN@{\newxystyle{#1}{\xylocalpattern@{#4}{}\xypattern@{#4}}}% |
| 49 |
\else |
| 50 |
\DN@{\newxystyle{#1}{\xylocalpattern@{#2}{#3}\xypattern@{#4}}}% |
| 51 |
\fi\fi |
| 52 |
\else \def\tmp@{\relax}\DNii@{#5}% |
| 53 |
\ifx\nextii@\tmp@ |
| 54 |
\DN@{#4}\ifx\next@\empty |
| 55 |
\DN@{#2}\ifx\next@\empty |
| 56 |
\DN@{\newxystyle{#1}{\xylocalpattern@{}{#3}\xypattern@{#3}}}% |
| 57 |
\else |
| 58 |
\DN@{\newxystyle{#1}{\xylocalpattern@{#2}{#3}\xypattern@{#2 #3}}}% |
| 59 |
\fi |
| 60 |
\else |
| 61 |
\DN@{#2#3}\ifx\next@\empty |
| 62 |
\DN@{\newxystyle{#1}{\xylocalpattern@{#4}{}\xypattern@{#4}}}% |
| 63 |
\else |
| 64 |
\DN@{\newxystyle{#1}{\xylocalpattern@{#2}{#3}\xypattern@{#4}}}% |
| 65 |
\fi\fi |
| 66 |
\else\DN@{}\fi\fi \next@\relax } |
| 67 |
\xydef@\xyNopattern@#1{} |
| 68 |
\xylet@\xypattern@@=\xyNopattern@ |
| 69 |
\xydef@\xyNopattern@@#1#2{\xypatternwarning@} |
| 70 |
\xylet@\xypattern@=\xypattern@@ |
| 71 |
\xylet@\xylocalpattern@=\xyNopattern@@ |
| 72 |
\xydef@\Unloadpattern@{% |
| 73 |
\let\xylocalpattern@=\xyNopattern@@ |
| 74 |
\let\xypattern@=\xyNopattern@ |
| 75 |
\let\xypatternwarning@=\xypatternwarning@@ } |
| 76 |
\Unloadpattern@ |
| 77 |
\xydef@\xystandardpatterns@{}% |
| 78 |
\xynew@{read}{\xypatread@} |
| 79 |
\xydef@\defaultpattfile@{} |
| 80 |
\xydef@\xygetfilepatterns@#1{\DN@{#1}% |
| 81 |
\ifx\next@\empty |
| 82 |
\ifx\defaultpattfile@\empty \xywarning@{No pattern file specified.}% |
| 83 |
\else \DN@{\expandafter\openpattfile@\expandafter{\defaultpattfile@}}\fi |
| 84 |
\else \DN@{\openpattfile@{#1}}\fi \next@ } |
| 85 |
\xydef@\openpattfile@#1{\openin\xypatread@=#1.xyp |
| 86 |
\ifeof\xypatread@\xywarning@{No patterns in file: #1.xyp}% |
| 87 |
\closein\xypatread@ |
| 88 |
\else \expandafter \xyreadpatfile@ \fi }% |
| 89 |
\xydef@\UsePatternFile#1{\def\defaultpattfile@{#1}} |
| 90 |
\xydef@\LoadAllPatterns{\let\parsepattern@=\parsepattern@@ |
| 91 |
\xygetfilepatterns@ } |
| 92 |
\xydef@\LoadPattern#1{\let\parsepattern@=\filepattern@@ |
| 93 |
\def\pattname@{#1}\xygetfilepatterns@} |
| 94 |
\xydef@\AliasPattern#1#2{\let\parsepattern@=\aliaspattern@@ |
| 95 |
\def\aliasname@{#1}\def\pattname@{#2}\xygetfilepatterns@} |
| 96 |
\xydef@\xyreadpatfile@{% |
| 97 |
\loop@ \bgroup\xycatcodes |
| 98 |
\global\read\xypatread@ to\xypatline@ |
| 99 |
\ifeof\xypatread@ \aftergroup\endpatread@ |
| 100 |
\else\aftergroup\morepatread@\fi \edef\next@{% |
| 101 |
\egroup\noexpand\getxypattern@{\xypatline@!!!}\relax}\next@ |
| 102 |
\repeat@ } |
| 103 |
\xydef@\endpatread@{\closein\xypatread@\iffalse} |
| 104 |
\xydef@\morepatread@{\iftrue} |
| 105 |
\xydef@\getxypattern@#1{\def\next{#1}\getxypattern@@} |
| 106 |
\xydef@\getxypattern@@{\DN@{!!!}\ifx\next\next@\DN@{}% |
| 107 |
\else\DN@{\expandafter\parsepattern@\next}\fi \next@ } |
| 108 |
\xydef@\parsepattern@@#1 #2!#3\relax{\newxypattern{#1}{#2}} |
| 109 |
\xydef@\filepattern@@#1 #2!#3\relax{\DN@{#1}% |
| 110 |
\ifx\next@\pattname@ |
| 111 |
\DN@{\expandafter\foundpattern@\expandafter{\pattname@}{#2}}% |
| 112 |
\else\DN@{}\fi \next@ } |
| 113 |
\xydef@\foundpattern@#1#2{\newxypattern{#1}{#2}\endpatread@\fi |
| 114 |
\expandafter\eat@} |
| 115 |
\xydef@\aliaspattern@@#1 #2!#3\relax{\DN@{#1}% |
| 116 |
\ifx\next@\pattname@ |
| 117 |
\DN@{\expandafter\foundpattern@\expandafter{\aliasname@}{#2}}% |
| 118 |
\else\DN@{}\fi \next@ } |
| 119 |
\DN@{\xyaddunsupport{tile}\Unloadpattern@}% |
| 120 |
\ifx\xyeverywithoption@tile@\undefined |
| 121 |
\else\ifx\xyeverywithoption@tile@\empty |
| 122 |
\else |
| 123 |
\DN@{\xysetup@@{\xywithoption{tile}{\xyeverywithoption@tile@\xydriversloaded@@}}}% |
| 124 |
\fi\fi \next@ |
| 125 |
\xyendinput |