blob: d70d6f84abae318283fc47fb123c71d1683c31af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
%% xyline.tex from $Id: xyline.doc,v 3.10 2011/03/14 20:14:00 krisrose Exp $
%%
%% Xy-pic ``Line Width'' extension.
%% Copyright (c) 1993-1996 Ross Moore <ross.moore@mq.edu.au>
%%
%% 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-2011 Kristoffer H. Rose <krisrose@tug.org>
%%
%% 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, see http://www.gnu.org/licenses/.
%%
\ifx\xyloaded\undefined \input xy \fi
\xyprovide{line}{Line styles extension}{\stripRCS$Revision: 3.10 $}%
{Ross Moore}{ross.moore@mq.edu.au}%
{Mathematics Department, Macquarie University, NSW~2109, Australia}
\xydefcsname@{*stylechar@|@}#1{\xyFN@\xywidthchar@#1@@}%
\xydefcsname@{style [thinner]}{\xyshape@thinner@}
\xydefcsname@{style [thicker]}{\xyshape@thicker@}
\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@}%
\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@ *@@{\recoverXyStyle@}%
\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@}
\xydef@\xylinecap@{2}
\xydef@\xylinejoin@{2}
\xydef@\xylinemiter@{10}
\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@}
\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@}}
\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}}}
\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@
\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@
\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@
\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@}}%
\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}}@@}
\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 }
\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@ }
\xylet@\xy@polystyle@@=\xypolynospec@
\xydef@\UninstallPolylines@{%
\UnloadpolySpecials@
\let\xy@polystyle@@=\xypolynospec@ }
\UninstallPolylines@
\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@}@@}%
\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}
\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@
\xydef@\transxyline@#1{\edef\next@{\removePT@#1}}
\xylet@\transxyline@@=\DN@
\xylet@\xylineSpecial@@=\eat@
\xyendinput
|