%% $Id: xyline.doc,v 3.6 1998/03/06 01:28:05 krisrose Exp $ %% %% Xy-pic ``Line Width'' extension. %% Copyright (c) 1993-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{line}{Line styles extension}{\stripRCS$Revision: 3.6 $}% {Ross Moore}{ross@mpce.mq.edu.au}% {Mathematics Department, Macquarie University, NSW~2109, Australia} \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% This extension provides the ability to request various effects related to the appearance of straight lines; \eg. thickness, non-standard dashing, and colour. \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \paragraph*{Header:}\leavevmode \DOCHEADER \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% These are effects which are not normally available within \TeX. Instead they require a suitable `back-end' option to provide the necessary |\special| commands, or extra fonts, together with appropriate commands to implement the effects. Thus $$ \xy *+\txt<.8\hsize>{Using this extension will have no effect on the output unless used with a backend that explicitly supports it.} *\frm{-} \endxy $$ The extension provides special effects that can be used with any \Xy-pic , by defining |[||]| modifiers. The modification is local to the currently being built, so will have no effect if this object is never actually used. \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \paragraph*{Adjusting line thickness} The following table lists the modifiers primarily to alter the thickness of lines used by \Xy-pic. They come in two types --- either a single keyword, or using the key-character |||| with the following text parsed. % \begin{defs}% |[thicker]| & double line thickness \cr |[thinner]| & halve line thickness \cr |[||(||)]| & multiple of usual thickness\cr |[||<||>]| & set thickness to \cr |[||||]| & also sets to \cr |[||=||]| & make |[||]| set current style settings\cr |[||*]| & reuse previous style\cr |[butt]| & butt cap at ends\cr |[roundcap]| & round cap at ends\cr |[projcap]| & projecting square cap.\cr \end{defs} % \noindent Later settings of the linewidth override earlier settings; multiple calls to |[thicker]| and |[thinner]| compound, but the other variants set an absolute thickness. The line-thickness specification affects arrow-tips as well as the thickness of straight lines and curves. Three kinds of line-caps are available; they are discussed below in the section on `poly-lines'. % \begin{code} \xy/r8pc/:*++\txt\huge{C}="c" ,0*++\txt\huge{P}="p", ,"p",{\ar@*{[|(1)]}"p";"c"<20pt>} ,"p",{\ar@*{[|(4)]}"p";"c"<14pt>} ,"p",{\ar@*{[|(10)]}"p";"c"<4pt>} ,"p",{\ar@*{[|(20)]}"p";"c"<-16pt>} \endxy \end{code} $$\docode$$ \medskip \displaycode % Using the \PS\ back-end, the size of the arrow-head grows aesthetically with the thickness of the line used to draw it. This growth varies as the square-root of the thickness; thus for very thick lines (20+ times normal) the arrowhead begins to merge with the stem. \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Load the |style| extension to establish the necessary infra-structure. \DOCMODE( %\xydefcsname@{shape [|...]}#1{\xyFN@\xywidthchar@#1@@}% \xydefcsname@{*stylechar@|@}#1{\xyFN@\xywidthchar@#1@@}% %\xydefcsname@{shape [thinner]}{\xyshape@thinner@} %\xydefcsname@{shape [thicker]}{\xyshape@thicker@} \xydefcsname@{style [thinner]}{\xyshape@thinner@} \xydefcsname@{style [thicker]}{\xyshape@thicker@} \DOCMODE) \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \paragraph*{Implementation} Record the line thickness locally in a dimen register. The initial value is read from the |xydash10| font. Each time |\xylinethick@| is changed, its previous value is stored as the expansion of |\xyprevwidth@@|, in case this is needed by a specific back-end. \DOCMODE( \xynew@{dimen}\xylinethick@ \xylinethick@=\xydashw@ \xydef@\xyshape@thicker@{\xylinewidth@i{\multiply\xylinethick@\tw@}} \xydef@\xyshape@thinner@{\xylinewidth@i{\divide\xylinethick@\tw@}} \xydef@\xylinewidth@i#1{\edef\xyprevwidth@@{\the\xylinethick@}% #1\edef\next@{\xylinethick@=\the\xylinethick@}% \edef\next@ii{\noexpand\addtotoks@{% \noexpand\xylinewidth@@{\next@}{\xyprevwidth@@}}}% \next@ii } \xydef@\xywidthchar@{% \ifx \space@\next \expandafter\DN@\space{\xyFN@\xywidthchar@}%gobble spaces % \else\ifx @\next \DN@ @@{\addtotoks@{\checkXyStyle@}}% \else\ifx @\next \DN@ @@{\checkXyStyle@}% \else\ifx (\next \DN@ (##1)##2@@{% \xylinewidth@i{\xylinethick@=##1\xydashw@}}% \else\addLT@\ifx \next \addGT@{\addLT@\DN@ ##1}##2@@{% \xylinewidth@i{\xylinethick@=##1\relax}}% % \else\ifx *\next \DN@ *@@{\addtotoks@{\checkXyStyle@}}% % \else\ifx *\next \DN@ *@@{\checkXyStyle@}% \else\ifx *\next \DN@ *@@{\recoverXyStyle@}% % \else\addEQ@\ifx \next \addEQ@\DN@##1@@{% % \addtotoks@{\checkXyStyle@\xynamestyle@{##1}}}% \else\addEQ@\ifx \next \addEQ@\DN@##1@@{\checkXyStyle@ \addtotoks@{\xynamestyle@{##1}}}% \else\ifx C\next \DN@ C##1@@{\xysetlinecap@{##1}@}% \else\ifx J\next \DN@ J##1@@{\xysetlinejoin@{##1}@}% \else\ifx M\next \DN@ M(##1)@@{\xymiterlimit@{##1}@}% \else \DN@##1@@{\xylinewidth@i{\xylinethick@=##1\relax}}% \fi\fi\fi\fi\fi\fi\fi\fi\fi \next@} \DOCMODE) \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% The diagram in figure~??g[xyrotate.doc:rotate and flips], page~??gp[xyrotate.doc:rotate and flips], uses different line-thicknesses and colours. \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \paragraph*{Poly-lines} By a `poly-line' we mean a path built from straight line segments having no gaps where each segment abuts the next. The poly-line could be the edges of a polygon, either closed or open if the end-points are different. The reason for considering a poly-line as a separate , rather than simply as a built from straight lines, becomes apparent only when the lines have appreciable thickness. Then there are several standard ways to fashion the `joins' (where segments meet). Also the shape of the `caps' at either end of the poly-line can be altered. The following modifiers are used to determine the shapes of the line `caps' and `joins': % \begin{defs}% |[||J||]| & join style, = 0, 1 or 2\cr |[mitre]| & mitre-join, same as |[||J0]|\cr |[roundjoin]| & round join, same as |[||J1]|\cr |[bevel]| & bevel-join, same as |[||J2]|\cr |[||C||]| & end-cap, = 0, 1 or 2\cr |[butt]| & ``butt'' cap, same as |[||C0]|\cr |[roundcap]| & round cap, same as |[||C1]|\cr |[projcap]| & ``projecting square'' cap,\hfil\break same as |[||C2]|\cr |[||M(||)]| & set mitrelimit to $\ge1$\cr \end{defs} % \noindent These effects are currently implemented only with the \PS\ back-end or when using |\xypolyline| (described below) with a \PS\ . In this case the `cap' setting can be applied to any segment, straight or curved, whether part of a poly-line or not; however the `join' setting applies only to poly-lines. Arrow-tips are not affected. The defaults are to use round joins and round-cap ends. Adjusting the miter-limit affects how far miters are allowed to protrude when two wide lines meet at small angles. The is in units of the line-thickness. Higher values mean using bevels only at smaller angles, while the value of 1 is equivalent to using bevels at all angles. The default miter-limit is 10. \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Current values are stored in case these are needed within nested portions of diagrams. \DOCMODE( \xydef@\xylinecap@{2} \xydef@\xylinejoin@{2} \xydef@\xylinemiter@{10} \DOCMODE) %These are simple methods that alter the stored values. % %\DOCMODE( %\xydef@\xysetlinecap@@#1{\xylinestyle@{C}{#1}{\def\xylinecap@{#1}}} %\xydef@\xysetlinejoin@@#1{\xylinestyle@{J}{#1}{\def\xylinejoin@{#1}}} %\xydef@\xysetmiterlimit@@#1{\xylinestyle@{M}{#1}{\def\xylinemiter@{#1}}} %\DOCMODE) % %Finally we need the interface to pass the new values to a . % %\DOCMODE( %\xydef@\xynolinestyle@@#1#2#3{\let\next=#1\relax #3% % \ifx\next C\DN@{\xyundefinedLine@{linecap}{#2}@@}% % \else\ifx\next J\DN@{\xyundefinedLine@{linejoin}{#2}@@}% % \else\ifx\next M\DN@{\xyundefinedLine@{miterlimit}{#2}@@}% % \fi\fi\fi \next@ } % %\xylet@\xylinestyle@\xynolinestyle@@ %\DOCMODE) \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Recognise keywords for `line-caps' and `line-joins': \DOCMODE( \xydefcsname@{style [bevel]}{\xyshape@bevel@} \xydefcsname@{style [roundjoin]}{\xyshape@rdjoin@} \xydefcsname@{style [miter]}{\xyshape@miter@} % \xydefcsname@{style [butt]}{\xyshape@butt@} \xydefcsname@{style [roundcap]}{\xyshape@rdcap@} \xydefcsname@{style [projcap]}{\xyshape@projcap@} \DOCMODE) \DOCMODE( \xydef@\xyshape@butt@{\xysetlinecap@@0} \xydef@\xyshape@rdcap@{\xysetlinecap@@1} \xydef@\xyshape@projcap@{\xysetlinecap@@2} \xydef@\xyshape@miter@{\xysetlinejoin@@0} \xydef@\xyshape@rdjoin@{\xysetlinejoin@@1} \xydef@\xyshape@bevel@{\xysetlinejoin@@2} \xydef@\xysetlinecap@#1@{\DN@ii{#1}\count@=#1\relax \expandafter\DN@\expandafter{\the\count@}% \ifx\next@\next@ii\else \xywarning@{ignoring extra tokens in line-cap: \next@}\fi \expandafter\xysetlinecap@@\expandafter{\next@}} \xydef@\xysetlinejoin@#1@{\DN@ii{#1}\count@=#1\relax \expandafter\DN@\expandafter{\the\count@}% \ifx\next@\next@ii\else \xywarning@{ignoring extra tokens in line-join: \next@}\fi \expandafter\xysetlinejoin@@\expandafter{\next@}} \xydef@\xysetmiterlimit@#1@{\DN@ii{#1}\dimen@=#1\p@\relax \edef\next@{\expandafter\removePT@\the\dimen@}% \ifx\next@\next@ii\else \xywarning@{ignoring extra tokens in miter-limit: \next@}\fi \expandafter\xysetmiterlimit@@\expandafter{\next@}} \DOCMODE) \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% These use the more sophisticated approach that is easier to adjust for different s. \DOCMODE( \xydef@\xysetlinecap@@#1{\xy@linecap@i{\def\xylinecap@{#1}}} \xydef@\xysetlinejoin@@#1{\xy@linejoin@i{\def\xylinejoin@{#1}}} \xydef@\xysetmiterlimit@@#1{% \xy@linemiter@i{\def\xylinemiter@{#1}}} \xydef@\xy@linecap@i#1{#1\addtotoks@{\xy@linecap@@{#1}}} \xydef@\xy@linejoin@i#1{#1\addtotoks@{\xy@linejoin@{#1}}} \xydef@\xy@linemiter@i#1{#1\addtotoks@{\xy@linemiter@{#1}}} \DOCMODE) Implementation of line-caps: \DOCMODE( \xydef@\xy@linecap@#1{\checkXyStyle@ \edef\xyprevcap@@{\xylinecap@}% #1\let\prexylinecap@=\prexylinecap@@ \let\postxylinecap@=\postxylinecap@@ \applyLIFOstyle@\prexylinecap@{\xylinecap@}% \postxylinecap@{\xyprevcap@@}} \xydef@\prexylinecap@@{\let\prexylinecap@=\eat@ \let\postxylinecap@=\postxylinecap@@ \outputxylinecap@ } \xydef@\postxylinecap@@{\let\postxylinecap@=\eat@ \let\prexylinecap@=\prexylinecap@@ \resetxylinecap@@ } \xylet@\prexylinecap@=\prexylinecap@@ \xylet@\postxylinecap@=\postxylinecap@@ \xydef@\outputxylinecap@#1{\xycapSpecial@@{#1}} \xydef@\resetxylinecap@#1{\resetxylinecap@i{#1}\outputxylinecap@{#1}} \xydef@\resetxylinecap@i#1{\def\xylinecap@{#1}} \xylet@\resetxylinecap@@=\resetxylinecap@ \xylet@\xycapSpecial@@=\eat@ \DOCMODE) Implementation of line-joins: \DOCMODE( \xydef@\xy@linejoin@#1{\checkXyStyle@ \edef\xyprevjoin@@{\xylinejoin@}#1% \let\prexylinejoin@=\prexylinejoin@@ \let\postxylinejoin@=\postxylinejoin@@ \applyLIFOstyle@\prexylinejoin@{\xylinejoin@}% \postxylinecap@{\xyprevjoin@@}} \xydef@\prexylinejoin@@{\let\prexylinejoin@=\eat@ \let\postxylinejoin@=\postxylinejoin@@ \outputxylinejoin@ } \xydef@\postxylinejoin@@{\let\postxylinejoin@=\eat@ \let\prexylinejoin@=\prexylinejoin@@ \resetxylinejoin@@ } \xylet@\prexylinejoin@=\prexylinejoin@@ \xylet@\postxylinejoin@=\postxylinejoin@@ \xydef@\outputxylinejoin@#1{\xyjoinSpecial@@{#1}} \xydef@\resetxylinejoin@#1{\resetxylinejoin@i{#1}\outputxylinejoin@{#1}} \xydef@\resetxylinejoin@i#1{\def\xylinejoin@{#1}} \xylet@\resetxylinejoin@@=\resetxylinejoin@ \xylet@\xyjoinSpecial@@=\eat@ \DOCMODE) Implementation of miter-limit: \DOCMODE( \xydef@\xy@linemiter@#1{\checkXyStyle@ \edef\xyprevmiter@@{\xylinemiter@}#1% \let\prexylinemiter@=\prexylinemiter@@ \let\postxylinemiter@=\postxylinemiter@@ \applyLIFOstyle@\prexylinemiter@{\xylinemiter@}% \postxylinecap@{\xyprevmiter@@}} \xydef@\prexylinemiter@@{\let\prexylinemiter@=\eat@ \let\postxylinemiter@=\postxylinemiter@@ \outputxylinemiter@ } \xydef@\postxylinemiter@@{\let\postxylinemiter@=\eat@ \let\prexylinemiter@=\prexylinemiter@@ \resetxylinemiter@@ } \xylet@\prexylinemiter@=\prexylinemiter@@ \xylet@\postxylinemiter@=\postxylinemiter@@ \xydef@\outputxylinemiter@#1{\xymiterSpecial@@{#1}} \xydef@\resetxylinemiter@#1{\resetxylinemiter@i{#1}\outputxylinemiter@{#1}} \xydef@\resetxylinemiter@i#1{\def\xylinemiter@{#1}} \xylet@\resetxylinemiter@@=\resetxylinemiter@ \xylet@\xymiterSpecial@@=\eat@ \DOCMODE) \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% The path taken by the `poly-line' this is read as the list of itions in the current `stack', ignoring size extents. The macro |\xypolyline| is used as a ; it reads the itions from the stack, but leaves the stack intact for later use. \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Implementation of `poly-lines'. \DOCMODE( \xydef@\xypolyline#1{\xypolyline@{#1}} \xydef@\xypolyline@#1{\hbox\bgroup \enter@{\pfromthep@ \basefromthebase@ \cfromthec@}% \def\xyps@list{}\edef\smapp@@{\s@bot}% \smapxy@i{\enter@{\pfromthep@ \basefromthebase@ }% \edef\xyps@list{\expandafter\removePT@\the\X@c\space \expandafter\removePT@\the\Y@c\space \xyps@list}\leave@}% \leave@ \xy@polystyle@@{#1}\xydopoly@style\egroup \def\Drop@@{\styledboxz@}\def\Connect@@{\styledboxz@}}% \DOCMODE) \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% The following diagram illustrates the use of line-thickness, line-joins and line-caps with poly-lines. It contains an example of each of the styles. \begin{code} \xycompileto{poly}% {/r4pc/:,*[|<5pt>][thicker]\xybox{% *+(3,2){}="X" ;@={p+CU,p+LU,p+LD,p+RD,p+RU,p+CU} ,{0*[miter]\xypolyline{}} ,{\xypolyline{*}},@i@) ,"X",*+(2.5,1.5){}="X" ,@={!CU,!LU,!LD,!RD,!RU,!CU} ,{0*[gray][roundjoin]\xypolyline{}} ,{0*[gray]\xypolyline{*}},@i@) ,"X",*+(2,1){}="X" ,@={!CU,!LU,!LD,!RD,!RU,!CU} ,{0*[white]\xypolyline{*}} ,{0*[bevel]\xypolyline{}},@i@) ,"X"-(.7,0)*++\txt\LARGE{A}="a" ,"X"+(.7,0)*++\txt\LARGE{B}="b" ,{\ar@{-}@*{[butt][thinner]}"a";"b"<1pc>} ,{\ar@{-}@*{[roundcap][thinner]}"a";"b"} ,{\ar@{-}@*{[projcap][thinner]}"a";"b"<-1pc>} }} \end{code} $$\docode$$ \displaycode \noindent Note the use of |{0*[...]\xypolyline{..}}| to apply style-modifiers to a polyline. The |@={!..}| method for loading the stack gives equivalent results to using |;@={p+..}|, since |\xypolyline| ignores the edge extents of each in the stack. Note also that the argument |#1| to |\xypolyline| affects what is typeset. Allowable arguments are: % \begin{defs} |\xypolyline{}| & solid line\cr |\xypolyline{.}| & dotted line\cr |\xypolyline{-}| & dashed line\cr |\xypolyline{*}| & fill enclosed polygon\cr |\xypolyline{?}| & fill enclosed polygon using even-odd rule\cr |\xypolyline{{*}}| & use |\dir{*}| for lines\cr |\xypolyline{}|\kern-20pt & \kern20pt using |\dir{}| \cr \end{defs} \noindent The latter cases one has |**\dir{...}| being used to connect the vertices of the polyline, with |{{*}}| being needed to get |**\dir{*}|. Similarly |**\dir| is used when a is not available to specifically support polylines; in particular the two `fill' options |*| and |?| will result in a dotted polygon outline the region intended to be filled. In all cases it is up to the user to load the stack before calling |\xypolyline{|\dots|}|. A particularly common case is the outline of an existing \Xy-pic , as in the example above. Future extensions to |\frm| will provide a simplified mechanism whereby the user need not call |\xypolyline| explicitly for such effects. \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \DOCMODE( \xylet@\xypolyline@Special=\eat@ \xylet@\xypolyfill@Special=\eat@ \xylet@\xypolyeofill@Special=\eat@ \xylet@\xypolydot@Special=\eat@ \xylet@\xypolydash@Special=\eat@ \xydef@\UnloadpolySpecials@{% \let\xypolyline@Special=\eat@ \let\xypolyfill@Special=\eat@ \let\xypolyeofill@Special=\eat@ \let\xypolydot@Special=\eat@ \let\xypolydash@Special=\eat@ } \xydef@\xy@polystyle@#1{% \let\poly@style@@=\xypolyline@Special \DNii@{#1}\ifx\nextii@\empty \else\DN@{*}\ifx\next@\nextii@ \let\poly@style@@=\xypolyfill@Special \else\DN@{?}\ifx\next@\nextii@ \let\poly@style@@=\xypolyeofill@Special \else\expandafter\DN@\expandafter{\addDOT@{}}\ifx\next@\nextii@ \let\poly@style@@=\xypolydot@Special \else\expandafter\DN@\expandafter{\addDASH@{}}\ifx\next@\nextii@ \let\poly@style@@=\xypolydash@Special \else\DN@{{*}}\ifx\next@\nextii@ \def\poly@style@@{\xypolystraight@{*}}% \else \def\poly@style@@{\xypolystraight@{#1}}% \fi\fi\fi\fi\fi\fi } \xydef@\xydopoly@style{\expandafter\poly@style@@\expandafter{\xyps@list}} \xydef@\xynopolystyle@#1#2{\xyundefinedLine@{polyline}{{#1}}@@} \DOCMODE) \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% When there is no special support this handles the various cases using ordinary thin line types. \DOCMODE( \xydef@\xypolynospec@#1{\DNii@{#1}% \ifx\nextii@\empty\def\poly@style@@{\xypolystraight@{-}}% \else\DN@{.}\ifx\next@\nextii@ \def\poly@style@@{\xypolystraight@{.}}% \else\DN@{-}\ifx\next@\nextii@ \def\poly@style@@{\xypolystraight@{--}}% \else\DN@{*}\ifx\next@\nextii@ \def\poly@style@@{\xypolystraight@{.}}% \else\DN@{?}\ifx\next@\nextii@ \def\poly@style@@{\xypolystraight@{.}}% \else\DN@{{*}}\ifx\next@\nextii@ \def\poly@style@@{\xypolystraight@{*}}% \else \def\poly@style@@{\xypolystraight@{#1}}% \fi\fi\fi\fi\fi\fi } \DOCMODE) Gobble the collected positions in |{\xyps@list}|; recover the vertices from the stack, then set straight lines in the appropriate style. \DOCMODE( \xydef@\xypolystraight@#1#2{% \enter@{\pfromthep@ \basefromthebase@ \cfromthec@}% \edef\smapp@@{\s@bot}\csname S@0\endcsname\czeroEdge@\pfromc@\def\smapp@@{0}% \smapxy@i{\czeroEdge@\enter@{\pfromthec@}{\connect@\dir{#1}}\leave@}\leave@ } \DOCMODE) \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Initially poly-lines are uninstalled, until loaded by a . \DOCMODE( \xylet@\xy@polystyle@@=\xypolynospec@ \xydef@\UninstallPolylines@{% \UnloadpolySpecials@ \let\xy@polystyle@@=\xypolynospec@ } \UninstallPolylines@ \DOCMODE) \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \paragraph*{Installation} Initially there is no support for the actual effects. \DOCMODE( \xydef@\xyundefinedLine@#1#2@@{% \xywarning@{The #1 #2 effect is not implemented with the current driver.}}% \xydef@\xynolinewidth@#1#2{% \xyundefinedLine@{linewidth}{\the\xylinethick@}@@}% \xydef@\xynolinecap@#1{\xyundefinedLine@{linecap}{\xylinecap@}@@}% \xydef@\xynolinejoin@#1{\xyundefinedLine@{linejoin}{\xylinejoin@}@@}% \xydef@\xynolinemiter@#1{\xyundefinedLine@{miterlimit}{\xylinemiter@}@@}% \DOCMODE) Nothing further can be done unless allowed by a specific , which must establish an alternative expansions to be bound to |\xylinewidth@@| and the other hooks. \DOCMODE( \xylet@\xylinewidth@@=\xynolinewidth@ \xylet@\xy@linecap@@=\xynolinecap@ \xylet@\xy@linejoin@@=\xynolinejoin@ \xylet@\xy@linemiter@@=\xynolinemiter@ \xydef@\UnloadLine@#1{% \ifx#1\relax\else\xyunload@{line width extension}\fi \let\resetxyline@@=\resetxyline@ \let\resetxylinecap@@=\resetxylinecap@ \let\resetxylinejoin@@=\resetxylinejoin@ \let\resetxylinemiter@@=\resetxylinemiter@ \let\transxyline@@=\DN@ \let\xylineSpecial@@=\eat@ \let\xycapSpecial@@=\eat@ \let\xyjoinSpecial@@=\eat@ \let\xymiterSpecial@@=\eat@ \let\xylinewidth@@=\xynolinewidth@ \let\xy@linecap@@=\xynolinecap@ \let\xy@linejoin@@=\xynolinejoin@ \let\xy@linemiter@@=\xynolinemiter@ \UninstallPolylines@ } \xyaddunsupport{line}{\UnloadLine@\relax} \DOCMODE) \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% This is a possible alternative for |\xylinewidth@@|. Indeed it is used with the \PS\ support, which then redefines just |\xylineSpecial@@|. \DOCMODE( \xydef@\xylinewidth@#1#2{\checkXyStyle@ #1\let\prexyline@=\prexyline@@ \let\postxyline@=\postxyline@@ \applyLIFOstyle@\prexyline@{\the\xylinethick@}\postxyline@{#2}} \xydef@\prexyline@@{\let\prexyline@=\eat@ \let\postxyline@=\postxyline@@ \outputxyline@ } \xydef@\postxyline@@{\let\postxyline@=\eat@ \let\prexyline@=\prexyline@@ \resetxyline@@ } \xylet@\prexyline@=\prexyline@@ \xylet@\postxyline@=\postxyline@@ \xydef@\resetxyline@#1{\resetxyline@i{#1}\outputxyline@{#1}} \xydef@\resetxyline@i#1{\xylinethick@=#1\relax} \xydef@\outputxyline@#1{\transxyline@@{#1}% \expandafter\xylineSpecial@@\expandafter{\next@}} \xylet@\resetxyline@@=\resetxyline@ \DOCMODE) These need to be rebound by a back-end which supports variation in the line-thickness. \DOCMODE( \xydef@\transxyline@#1{\edef\next@{\removePT@#1}} \xylet@\transxyline@@=\DN@ \xylet@\xylineSpecial@@=\eat@ \DOCMODE) \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \paragraph*{The end \& Log}\leavevmode \DOCMODE( \xyendinput % $Log: xyline.doc,v $ % Revision 3.6 1998/03/06 01:28:05 krisrose % Releasing (with Y&Y fonts). % % Revision 3.3 1996/12/18 09:22:29 ross % adjustments for styles now within the kernel code % fixed problem with line-widths % % Revision 3.2 1995/09/19 18:21:41 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. % % Revision 2.12 1994/10/25 03:01:14 ross % Final 3beta release [bug fixes & AMS-LaTeX fitting]. % % Revision 2.11 1994/07/05 09:27:49 ross % fixed documentation bug % % Revision 2.10 1994/06/15 12:46:03 ross % Second release 3beta. % Colour and line style saving works; label colouring bug fixed. % % Revision 2.9 1994/06/09 14:39:49 ross % Release 3beta. % % NEW for version 2.9 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: