| 1 |
%% xyweb.tex from $Id: xyweb.doc,v 3.7 2011/03/14 20:14:00 krisrose Exp $ |
| 2 |
%% |
| 3 |
%% Xy-pic ``Lattice and web'' feature. |
| 4 |
%% Copyright (c) 1994-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{web}{Lattice and web feature}{\stripRCS$Revision: 3.7 $}% |
| 25 |
{Ross Moore}{[email protected]}% |
| 26 |
{Mathematics Department, Macquarie University, NSW~2109, Australia} |
| 27 |
\message{lattices,} |
| 28 |
\xynew@{count}\lattice@A |
| 29 |
\xynew@{count}\lattice@B |
| 30 |
\xydef@\latticeA{\lattice@A} |
| 31 |
\xydef@\latticeB{\lattice@B} |
| 32 |
\xydef@\xylattice#1#2#3#4{\xy@{LATTICE}{\xylattice@{#1}{#2}{#3}{#4}}}% |
| 33 |
\xydef@\xylattice@#1#2#3#4{% |
| 34 |
\lattice@A=#1\relax |
| 35 |
\loop \bgroup\lattice@B=#3\relax |
| 36 |
\innerlatticeloop@{#4}% |
| 37 |
\edef\tmp@{\egroup |
| 38 |
\X@min=\the\X@min \X@max=\the\X@max |
| 39 |
\Y@min=\the\Y@min \Y@max=\the\Y@max |
| 40 |
}\tmp@ \ifnum\lattice@A<#2\relax \advance\lattice@A\@ne |
| 41 |
\repeat } |
| 42 |
\xydef@\innerlatticeloop@#1{% |
| 43 |
\loop \enter@{\cfromthec@}\enter@{\cplusthec@}% |
| 44 |
\vfromcartesian@@ \the\lattice@A,\the\lattice@B @% |
| 45 |
\edef\latticeX{\expandafter\removePT@\the\X@c}% |
| 46 |
\edef\latticeY{\expandafter\removePT@\the\Y@c}% |
| 47 |
\leave@ \latticebody \leave@ |
| 48 |
\ifnum\lattice@B<#1\relax \advance\lattice@B\@ne |
| 49 |
\repeat } |
| 50 |
\xydef@\croplattice#1#2#3#4#5#6#7#8{\xy@{LATTICE}% |
| 51 |
{\xycroplattice@{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}}% |
| 52 |
\xydef@\xycroplattice@#1#2#3#4#5#6#7#8{% |
| 53 |
\enter@{\X@min=\the\X@min \X@max=\the\X@max |
| 54 |
\Y@min=\the\Y@min \Y@max=\the\Y@max}% |
| 55 |
\enter@{\cfromthec@}\enter@{\cplusthec@}% |
| 56 |
\vfromcartesian@@ #5,0 @\leave@ \X@min=\X@c \leave@ |
| 57 |
\enter@{\cfromthec@}\enter@{\cplusthec@}% |
| 58 |
\vfromcartesian@@ #6,0 @\leave@ \X@max=\X@c \leave@ |
| 59 |
\enter@{\cfromthec@}\enter@{\cplusthec@}% |
| 60 |
\vfromcartesian@@ 0,#7 @\leave@ \Y@min=\Y@c \leave@ |
| 61 |
\enter@{\cfromthec@}\enter@{\cplusthec@}% |
| 62 |
\vfromcartesian@@ 0,#8 @\leave@ \Y@max=\Y@c \leave@ |
| 63 |
\lattice@A=#1\relax |
| 64 |
\loop |
| 65 |
\bgroup\lattice@B=#3\relax |
| 66 |
\enter@{\cfromthec@}\innercroplatticeloop@{#4}\leave@ |
| 67 |
\egroup |
| 68 |
\ifnum\lattice@A<#2\relax \advance\lattice@A\@ne |
| 69 |
\repeat \mergecropextents@ } |
| 70 |
\xydef@\innercroplatticeloop@#1{% |
| 71 |
\loop |
| 72 |
\enter@{\cfromthec@}\enter@{\cplusthec@}% |
| 73 |
\vfromcartesian@@ \the\lattice@A,\the\lattice@B @% |
| 74 |
\edef\latticeX{\expandafter\removePT@\the\X@c}% |
| 75 |
\edef\latticeY{\expandafter\removePT@\the\Y@c}% |
| 76 |
\leave@ \DN@{\latticebody}% |
| 77 |
\ifdim\X@c<\X@min\DN@{}% |
| 78 |
\else\ifdim\X@c>\X@max\DN@{}% |
| 79 |
\else\ifdim\Y@c<\Y@min\DN@{}% |
| 80 |
\else\ifdim\Y@c>\Y@max\DN@{}% |
| 81 |
\fi\fi\fi\fi \next@ \leave@ |
| 82 |
\ifnum\lattice@B<#1\relax \advance\lattice@B\@ne |
| 83 |
\repeat } |
| 84 |
\xydef@\mergecropextents@{% |
| 85 |
\edef\tmp@{% |
| 86 |
\noexpand\ifdim\X@min>\the\X@min \X@min=\the\X@min\noexpand\fi |
| 87 |
\noexpand\ifdim\X@max<\the\X@max \X@max=\the\X@max\noexpand\fi |
| 88 |
\noexpand\ifdim\Y@min>\the\Y@min \Y@min=\the\Y@min\noexpand\fi |
| 89 |
\noexpand\ifdim\Y@max<\the\Y@max \Y@max=\the\Y@max\noexpand\fi}% |
| 90 |
\leave@ \tmp@ } |
| 91 |
\xydef@\deflatticebody@{\def\latticebody{\drop{\bullet}}} |
| 92 |
\xydef@\defaultlatticebody{\deflatticebody@} |
| 93 |
\deflatticebody@ |
| 94 |
\xyendinput |