Debian Codegraph @

texmf-dist/tex/generic/pstricks/pstricks.tex

raw
1 %% pstricks.tex
2 %% COPYRIGHT 1993, 1994, 1999 by Timothy Van Zandt
3 %% COPYRIGHT 2000-2003 by Denis Girou.
4 %% Copyright 2004- by Herbert Voss <[email protected]>
5 %
6 % This work may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, either version 1.3
8 % of this license or (at your option) any later version.
9 % The latest version of this license is in
10 % http://www.latex-project.org/lppl.txt
11 % and version 1.3 or later is part of all distributions of LaTeX
12 % version 2003/12/01 or later.
13 %
14 % This work has the LPPL maintenance status "maintained".
15 %
16 % This Current Maintainer of this work is Herbert Voss
17 %
18 \csname PSTricksLoaded\endcsname
19 \let\PSTricksLoaded\endinput
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21 %% !! loading additional TeX packages see line 43,44 and 77ff
22 %% !! loading config file pstricks.con line 445
23 %% !! loading pro files line 458ff
24 %% !! fileversion and date see line 84f
25 %% !! loaded arrow stuff line 1482
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27 %
28 \edef\PstAtCode{\the\catcode`\@}
29 \catcode`\@=11\relax
30
31 \newif\if@pstLaTeX
32 \@pstLaTeXtrue
33 %
34 %\if@check@engine
35 \ifx\c@lor@to@ps\@undefined
36 \def\c@lor@to@ps{\PSTricks_Not_Configured_For_This_Format}% message for a pdflatex run
37 \fi
38 %\fi
39 \expandafter\ifx\csname @latexerr\endcsname\relax % do we have TeX? then @latexerr isn't defined
40 \@pstLaTeXfalse
41 \input pstricks-tex.def
42 \fi
43
44 \let\ifpstUndefined\@ifundefined
45
46 %\catcode`\@=\PstAtCode\relax
47 \ifx\PSTXKeyLoaded\endinput\else\input pst-xkey.tex \fi
48 \ifx\PSTFPloaded\endinput\else\input pst-fp.tex\fi
49 %
50 %\catcode`\@=11\relax
51 \def\XKV@ch@ckch@ice#1#2#3{% bugfix for xkeyval
52 \def\XKV@tempa{#1}%
53 \ifx\XKV@tempa\@nnil\let\XKV@tempa\@empty\else
54 \def\XKV@tempa{\def#1{#2}}%
55 \fi
56 % \in@{,#2,}{,#3,}%
57 \begingroup\edef\x{\endgroup\noexpand\in@{,#2,}}\x{,#3,}%
58 %\expandafter\in@\expandafter{\expandafter,#2,}{,#3,}% --- hv 2012-04-27
59 \ifin@
60 \ifXKV@pl
61 \XKV@addtomacro@n\XKV@tempa\@firstoftwo
62 \else
63 \XKV@addtomacro@n\XKV@tempa\@firstofone
64 \fi
65 \else
66 \ifXKV@pl
67 \XKV@addtomacro@n\XKV@tempa\@secondoftwo
68 \else
69 \XKV@toks{#2}%
70 \XKV@err{value `\the\XKV@toks' is not allowed}%
71 \XKV@addtomacro@n\XKV@tempa\@gobble
72 \fi
73 \fi
74 \XKV@tempa
75 }
76 %
77 \def\ProvidesPackageRCS#1{\typeout{Loading #1}}% needed for the pgf packages
78 %\@ifnextchar[\ProvidesPackageRCS@i{\ProvidesPackageRCS@i[] }}%$
79 %\def\ProvidesPackageRCS@i[#1]#2{}
80
81 \ifx\pgfkeysloaded\relax\else
82 \if@pstLaTeX
83 \RequirePackage{pgffor} % pgffor depends on pgfkeys
84 \else % format is plaintex
85 \input pgffor.tex
86 \fi
87 \fi
88
89 \let\pgfforeach\foreach
90 %
91 \def\fileversion{3.22A}
92 \def\filedate{2025/12/13}
93 \pst@addfams{pstricks}
94 %
95 %\define@boolkey[psset]{pstricks}[Pst@]{useURWfonts}[true]{}
96 %\psset{useURWfonts}
97 %
98 % stolen from latex.ltx to make it TeX compatible
99 \newcount\psLoopIndex
100 \long\def\@fornoop#1\@@#2#3{}
101 \long\def\@for#1:=#2\do#3{%
102 \pst@cntm=0
103 \expandafter\def\expandafter\@fortmp\expandafter{#2}%
104 \ifx\@fortmp\@empty \else
105 \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi}
106 %
107 \long\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx#4\@nnil \else
108 #5\def#4{#2}\ifx#4\@nnil \else\global\advance\psLoopIndex by \@ne\relax
109 #5\@iforloop #3\@@#4{#5}\fi\fi}
110 %
111 \long\def\@iforloop#1,#2\@@#3#4{\global\advance\psLoopIndex by \@ne\relax%
112 \def#3{#1}\ifx #3\@nnil
113 \expandafter\@fornoop \else
114 #4\relax\expandafter\@iforloop\fi#2\@@#3{#4}}
115 %
116 \long\def\psforeach#1#2#3{%
117 \global\psLoopIndex=0\relax
118 \if$\ifnum9<1#2$\else\fi\psforeach@ii{#1}{#2}{#3}%
119 \else \expandafter\psforeach@i#2,..,,..,\@nil{#1}{#3}\fi}
120 \long\def\psforeach@i#1,#2,..,#3,..,#4\@nil#5#6{%
121 \ifx\relax#3\relax\psforeach@ii{#5}{#1,#2}{#6}%
122 \else\psforeach@iii{#5}{#1}{#2}{#3}{#6}\fi}
123 \long\def\psforeach@ii#1#2#3{%
124 \begingroup
125 \edef\reserved@a{#2}%
126 \@for#1:=\reserved@a\do{#3}%
127 \endgroup}
128 \long\def\psforeach@iii#1#2#3#4#5{%
129 \pstFPsub\pst@tempA{#3}{#2}%
130 \pst@dimm=\pst@tempA pt%
131 \pstFPstripZeros{\pst@tempA}\pst@tempB%
132 \def\pst@tempA{#2}%
133 \def\pst@tempa{#2}%
134 \pst@dimn=#4pt%
135 \loop
136 \pst@dimm=\pst@tempA pt
137 \ifdim\pst@dimm<\pst@dimn
138 \pstFPadd\pst@tempA{\pst@tempA}{\pst@tempB}%
139 \pstFPstripZeros{\pst@tempA}\pst@tempA%
140 \edef\pst@tempa{\pst@tempa,\pst@tempA}%
141 \repeat%
142 \psforeach@ii{#1}{\pst@tempa}{#5}}
143 %
144 \long\def\psForeach#1#2#3{% without grouping the contents
145 \global\psLoopIndex=0\relax%
146 \if$\ifnum9<1#2$\else\fi\psforeach@ii{#1}{#2}{#3}%
147 \else \expandafter\psForeach@i#2,..,,..,\@nil{#1}{#3}\fi}
148 \long\def\psForeach@i#1,#2,..,#3,..,#4\@nil#5#6{%
149 \ifx\relax#3\relax\psForeach@ii{#5}{#1,#2}{#6}%
150 \else\psForeach@iii{#5}{#1}{#2}{#3}{#6}\fi%
151 }
152 \long\def\psForeach@ii#1#2#3{%
153 \edef\reserved@a{#2}%
154 \@for#1:=\reserved@a\do{#3}}
155 \long\def\psForeach@iii#1#2#3#4#5{%
156 \pstFPsub\pst@tempA{#3}{#2}%
157 \pst@dimm=\pst@tempA pt%
158 \pstFPstripZeros{\pst@tempA}\pst@tempB%
159 \def\pst@tempA{#2}%
160 \def\pst@tempa{#2}%
161 \pst@dimn=#4pt%
162 \loop%
163 \pst@dimm=\pst@tempA pt%
164 \ifdim\pst@dimm<\pst@dimn%
165 \pstFPadd\pst@tempA{\pst@tempA}{\pst@tempB}%
166 \pstFPstripZeros{\pst@tempA}\pst@tempA
167 \edef\pst@tempa{\pst@tempa,\pst@tempA}%
168 \repeat%
169 \psForeach@ii{#1}{\pst@tempa}{#5}
170 }
171
172 \def\psrecur@i#1{\csname ps@rn#1\psrecur@i}
173 \long\def\ps@rnm#1{\endcsname{#1}#1\global\advance\psLoopIndex by \@ne}
174 \long\def\ps@rn#1{}
175 \def\psLoop#1{\global\psLoopIndex=0\relax%
176 \csname ps@rn\expandafter\psrecur@i
177 \romannumeral\number\number#1 000\endcsname\endcsname}
178
179 %
180 % hv 2007-10-16 to fix the bug in pst-node with \\[name=...]
181 % hv fix bug with empty fnodes in psmatrix
182 \def\ps@ifnextchar#1#2#3{%
183 \let\reserved@d= #1%
184 \def\reserved@a{#2}\def\reserved@b{#3}%
185 \futurelet\@let@token\ps@ifnch}
186 \def\ps@ifnch{%
187 \ifx\@let@token\reserved@d \let\reserved@b\reserved@a \fi
188 \reserved@b
189 }
190 \def\pshskip#1{\vrule \@width\z@\nobreak \hskip #1\hskip \z@skip}
191 % end bugfix
192 \typeout{`PSTricks' v\fileversion\space\space <\filedate> (tvz,hv)}
193 \def\@pstrickserr#1#2{%
194 \begingroup
195 \newlinechar`\^^J
196 \edef\pst@tempc{#2}%
197 \expandafter\errhelp\expandafter{\pst@tempc}%
198 \typeout{%
199 PSTricks error. \space See User's Guide for further information.^^J
200 \@spaces\@spaces\@spaces\@spaces
201 Type \space H <return> \space for immediate help.}%
202 \errmessage{#1}%
203 \endgroup}
204 \def\@ehpa{%
205 Your command was ignored. Default value substituted.^^J
206 Type \space <return> \space to procede.}
207 \def\@ehpb{%
208 Your command was ignored. Will recover best I can.^^J
209 Type \space <return> \space to procede.}
210 \def\@ehpc{%
211 You better fix this before proceding.^^J
212 See the PSTricks User's Guide or ask your system administrator for help.^^J
213 Type \space X <return> \space to quit.}
214 \def\@ehpd{%
215 Not allowed optional argument.^^J
216 Will proceed with the default setting.^^J
217 Type \space X <return> \space to quit.}
218 \def\pst@misplaced#1{\@pstrickserr{Misplaced \string#1 command}\@ehpb}
219 \newdimen\pst@dima
220 \newdimen\pst@dimb
221 \newdimen\pst@dimc
222 \newdimen\pst@dimd
223 \newdimen\pst@dimg
224 \newdimen\pst@dimh
225 \newdimen\pst@dimm
226 \newdimen\pst@dimn
227 \newdimen\pst@dimo
228 \newdimen\pst@dimp
229 \chardef\f@ur=4
230 %
231 \newbox\pst@hbox
232 \newbox\pst@ibox
233 \newbox\pst@boxg
234 \newcount\pst@cnta
235 \newcount\pst@cntb
236 \newcount\pst@cntc
237 \newcount\pst@cntd
238 \newcount\pst@cntg
239 \newcount\pst@cnth
240 \newcount\pst@cntm
241 \newcount\pst@cntn
242 \newcount\pst@cnto
243 \newcount\pst@cntp
244 \newcount\@zero\@zero=0\relax
245 %
246 \newif\ifPst@SpecialLength
247 \Pst@SpecialLengthfalse
248 %
249 \newif\if@pst
250 \newtoks\pst@toks
251 \newif\if@star
252 \def\pst@ifstar#1{%
253 \@ifnextchar*{\@startrue\def\ps@next*{#1}\ps@next}{\@starfalse#1}}
254 %
255 \def\pst@expandafter#1#2{%
256 \def\ps@next{#1}%
257 \edef\@tempa{#2}%
258 \ifx\@tempa\@empty
259 \@pstrickserr{Unexpected empty argument!}\@ehpb
260 \def\@tempa{\@empty}%
261 \fi
262 \expandafter\ps@next\@tempa}
263 %
264 \def\pst@dimtonum#1#2{\edef#2{\pst@@dimtonum#1}}
265 \def\pst@@dimtonum#1{\expandafter\pst@@@dimtonum\the#1}
266 {\catcode`\p=12 \catcode`\t=12 \global\@namedef{pst@@@dimtonum}#1pt{#1}}
267 %
268 \def\pst@getdimdim#1 #2 #3\@nil{%
269 \def\pst@tempA{#2}%
270 \ifx\pst@tempA\@empty
271 \pssetlength\pst@dimn{#1}%
272 \pst@dimm=\z@%
273 \else%
274 \pssetlength\pst@dimm{#1}%
275 \pssetlength\pst@dimn{#2}%
276 \fi%
277 }
278 \def\pst@getxdimdim#1 #2 #3\@nil{%
279 \def\pst@tempA{#2}%
280 \ifx\pst@tempA\@empty
281 \pssetxlength\pst@dimn{#1}%
282 \pst@dimm=\z@
283 \else%
284 \pssetxlength\pst@dimm{#1}%
285 \pssetxlength\pst@dimn{#2}%
286 \fi%
287 }
288 \def\pst@getydimdim#1 #2 #3\@nil{%
289 \def\pst@tempA{#2}%
290 \ifx\pst@tempA\@empty
291 \pssetylength\pst@dimn{#1}%
292 \pst@dimm=\z@%
293 \else
294 \pssetylength\pst@dimm{#1}%
295 \pssetylength\pst@dimn{#2}%
296 \fi}
297 %
298 % A modulo macro for integer values
299 % \pst@mod{34}{6}\value ==> \value is 4
300 %
301 \def\pst@mod#1#2#3{%
302 \begingroup%
303 \pst@cntm=#1\pst@cntn=#2\relax%
304 \pst@cnto=\pst@cntm%
305 \divide\pst@cntm by \pst@cntn%
306 \multiply\pst@cntn by \pst@cntm%
307 \advance\pst@cnto by -\pst@cntn%
308 \edef\value{\endgroup\def\noexpand#3{\number\pst@cnto}}\value%
309 }
310 \def\pst@max#1#2#3{%
311 \begingroup%
312 \pst@cntm=#1\pst@cntn=#2\relax%
313 \ifnum\pst@cntm<\pst@cntn\pst@cntm=\pst@cntn\fi
314 \global#3=\the\pst@cntm%
315 \endgroup%
316 }
317 \def\pst@maxdim#1#2#3{%
318 \begingroup%
319 \pst@dimm=#1\pst@dimn=#2\relax%
320 \ifdim\pst@dimm<\pst@dimn\pst@dimm=\pst@dimn\fi
321 \global#3=\the\pst@dimm%
322 \endgroup%
323 }
324 \def\pst@mindim#1#2#3{%
325 \begingroup%
326 \pst@dimm=#1\pst@dimn=#2\relax%
327 \ifdim\pst@dimm>\pst@dimn\pst@dimm=\pst@dimn\fi
328 \global#3=\the\pst@dimm%
329 \endgroup%
330 }
331 \def\pst@abs#1#2{%
332 \begingroup%
333 \pst@cntm=#1\relax%
334 \ifnum\pst@cntm<\z@\pst@cntm=-\pst@cntm\fi%
335 \global#2=\the\pst@cntm
336 \endgroup%
337 }
338 \def\pst@absdim#1#2{%
339 \begingroup%
340 \pst@dimm=#1\relax%
341 \ifdim\pst@dimm<\z@\pst@dimm=-\pst@dimm\fi%
342 \global#2=\the\pst@dimm%
343 \endgroup%
344 }
345 %
346 \def\pst@pyth#1#2#3{% from pst-3d
347 \begingroup
348 \pst@dima=#1\relax
349 \ifnum\pst@dima<\z@ \pst@dima=-\pst@dima\fi% dima=abs(x)
350 \pst@dimb=#2\relax
351 \ifnum\pst@dimb<\z@ \pst@dimb=-\pst@dimb\fi% dimb=abs(y)
352 \advance\pst@dimb\pst@dima % dimb=s=abs(x)+abs(y)
353 \ifnum\pst@dimb=\z@
354 \global\pst@dimg=\z@ % dimg=z=sqrt(x^2+y^2)
355 \else
356 \multiply\pst@dima 8\relax % dima= 8abs(x)
357 \pst@@divide\pst@dima\pst@dimb % dimg =8t=8abs(x)/s
358 \advance\pst@dimg -4pt % dimg = 4tau = (8t-4)
359 \multiply\pst@dimg 2
360 \pst@dimtonum\pst@dimg\pst@tempa
361 \pst@dima=\pst@tempa\pst@dimg % dima=(8tau)^2
362 \advance\pst@dima 64pt % dima=u=[64+(8tau)^2]/2
363 \divide\pst@dima 2\relax % =(8f)^2
364 \pst@dimd=7pt % initial guess at sqrt(u)
365 \pst@@pyth\pst@@pyth\pst@@pyth % dimd=sqrt(u)
366 \pst@dimtonum\pst@dimd\pst@tempa
367 \global\pst@dimg=\pst@tempa\pst@dimb
368 \global\divide\pst@dimg 8 % dimg=z=(8f)*s/8
369 \fi
370 \endgroup
371 #3=\pst@dimg}
372 %
373 \def\pst@@pyth{% dimd = g <-- (g + u/g)/2
374 \pst@@divide\pst@dima\pst@dimd
375 \advance\pst@dimd\pst@dimg
376 \divide\pst@dimd 2\relax}
377 %
378 % ----- the old pst@pyth begin ----- did not use dimens
379 \def\pst@Pyth#1#2#3{\ifdim#1>#2\pst@@Pyth#1#2#3\else\pst@@Pyth#2#1#3\fi}
380 \def\pst@@Pyth#1#2#3{%
381 \ifdim4#1>9#2\relax
382 #3=#1\advance#3 .2122#2%
383 \else
384 #3=.8384#1\advance#3 .5758#2%
385 \fi%
386 }
387 % ----- the old pst@pyth end -----
388 %
389 %------ new version \pst@divide ̣-------- by Michael Sharpe
390 \def\pst@divide#1#2#3{%
391 \pst@@divide{#1}{#2}%
392 \advance\pst@dimg \pst@cnta pt%
393 \pst@dimtonum\pst@dimg{#3}%
394 }
395 \def\pst@@divide#1#2{%
396 \pst@dimg=#1\relax%
397 \pst@dimh=#2\relax%
398 \pst@cnth=\pst@dimh%
399 \pst@cntg=\pst@dimg%
400 \pst@cnta=\pst@cntg%
401 \divide\pst@cnta\pst@cnth%
402 \advance\pst@dimg -\pst@cnta\pst@dimh%
403 \pst@cntm=67108863\relax %2^26 -1
404 \pst@@@divide\pst@@@divide\pst@@@divide\pst@@@divide%
405 \divide\pst@dimg\pst@cnth%
406 }%
407 \def\pst@@@divide{%
408 \ifnum%
409 \ifnum\pst@dimg<\z@-\fi\pst@dimg<\pst@cntm%
410 \multiply\pst@dimg\sixt@@n%
411 \else%
412 \divide\pst@cnth\sixt@@n%
413 \fi%
414 }%
415 %
416 %-------------- the old version ----------
417 \iffalse
418 \def\pst@divide#1#2#3{%
419 \pst@@divide{#1}{#2}%
420 \pst@dimtonum\pst@dimg{#3}%
421 }
422 \def\pst@@divide#1#2{%
423 \pst@dimg=#1\relax
424 \pst@dimh=#2\relax
425 \pst@cntg=\pst@dimh
426 \pst@cnth=67108863
427 \pst@@@divide\pst@@@divide\pst@@@divide\pst@@@divide
428 \divide\pst@dimg\pst@cntg%
429 }
430 \def\pst@@@divide{%
431 \ifnum
432 \ifnum\pst@dimg<\z@-\fi\pst@dimg<\pst@cnth
433 \multiply\pst@dimg\sixt@@n
434 \else
435 \divide\pst@cntg\sixt@@n
436 \fi%
437 }
438 \fi
439 %-------------- end old version ---------------
440 %
441 \def\pst@configerr#1{\@pstrickserr{\string#1 not defined in pstricks.con}\@ehpc}
442
443 \newif\ifPSTlualatex
444
445 \ifdefined\directlua
446 \ifdefined\app@cmd@latex % do we have auto-pst-pdf-lua loaded?
447 \PSTlualatexfalse %
448 \typeout{--- We are running lualatex or dvilualatex with auto-pst-pdf-lua ---}%
449 \else
450 \ifnum\outputmode=1
451 \PSTlualatextrue %
452 \typeout{--- We are running lualatex with luapstricks ---}%
453 \else
454 \PSTlualatexfalse %
455 \typeout{--- We are running dvilualatex without luapstricks ---}%
456 \fi
457 \fi
458 \else
459 \typeout{--- We are running latex or xelatex ---}%
460 \PSTlualatexfalse
461 \fi
462 \ifPSTlualatex
463 \directlua{require'luapstricks'}%
464 \def\pstdriver{LuaLaTeX}%
465 \def\pstverb{\luaPST}%
466 \def\pstVerb{\luaPST direct}%
467 \def\pstunit{1bp}%
468 \def\pstverbscale{}%
469 \def\pstnodescale{}%
470 \def\pstheader{\luaPST immediate file}%
471 \def\c@lor@to@ps#1\@@{\luaPSTcolor{#1}}
472 % \AltClipMode % now done after the definition of \AltClipMode, see below
473 % Not sure if we need ``neg'' here or not
474 % \def\pstrotate{CP CP translate 3 -1 roll neg rotate \tx@NET}
475 \else
476 \def\pstVerb#1{\pst@configerr\pstVerb}%
477 \def\pstverb#1{\pst@configerr\pstverb}%
478 \def\pstverbscale{\pst@configerr\pstverbscale}%
479 \def\pstrotate{\pst@configerr\pstrotate}%
480 \def\pstheader#1{\pst@configerr\pstheader}%
481 \def\pstdriver{\pst@configerr\pstdriver}%
482 \@ifundefined{pstcustomize}%
483 {\def\pstcustomize{\endinput\let\pstcustomize\relax}}{}%
484 \input pstricks.con % local config file
485 \fi
486 %
487 \newif\ifPSTricks
488 \PSTrickstrue
489 \def\PSTricksOff{%
490 \def\pstheader##1{}%
491 \def\pstverb##1{}%
492 \def\pstVerb##1{}%
493 \PSTricksfalse%
494 }
495 \@ifundefined{pst@def}{\def\pst@def#1<#2>{\@namedef{tx@#1}{#2 }}}{}
496 \@ifundefined{pst@ATH}{\def\pst@ATH<#1>{}}{}
497 %
498 \pstheader{pstricks.pro}
499 \pstheader{pst-algparser.pro}
500 \pstheader{pst-tools.pro}
501 %
502 \def\pst@dict{tx@Dict begin }
503 \def\pst@theheaders{pstricks.pro, pst-algparser.pro}
504 \def\pst@Verb#1{\pstVerb{\pst@dict #1 end}}
505 \def\tx@Atan{Atan }
506 \def\tx@Div{Div }
507 \def\tx@NET{NET }
508 \def\tx@Pyth{Pyth }
509 \def\tx@PtoC{PtoC }
510 \def\tx@PathLength@{PathLength@ }
511 \def\tx@PathLength{PathLength }
512 \pst@dimg=\pstunit\relax
513 \ifdim\pst@dimg=1bp
514 \def\pst@stp{.996264 dup scale}
515 \else
516 \edef\pst@stp{1 \pst@@dimtonum\pst@dimg\space div dup scale}
517 \fi
518 \def\tx@STP{STP }
519 \def\tx@STV{STV }
520 %
521 %--------------------------------------- PS stuff ---------------------------------
522 % on stack x y
523 \pst@def{UserCoor}< \pst@number\psyunit div exch \pst@number\psxunit div exch >
524 \pst@def{ScreenCoor}< \pst@number\psyunit mul exch \pst@number\psxunit mul exch >
525 %--------------------------------------- PS stuff end -----------------------------
526 %
527 \def\pst@number#1{\pst@@dimtonum#1\space}
528 %
529 %-----------------------% hv 20100413
530 \def\pst@strip@dot#1{\expandafter\pst@strip@dot@i#1..\@nil}
531 \def\pst@strip@dot@i#1.#2.#3\@nil{%
532 \ifnum1#2>10\relax #1.#2\else#1\fi}
533 %-----------------------% hv 20100413
534 \def\pst@checknum#1#2{%
535 \edef\ps@next{#1}%
536 \ifx\ps@next\@empty
537 \let\pst@num\z@
538 \else
539 \expandafter\pst@@checknum\ps@next..\@nil
540 \fi
541 \ifcase\pst@num\relax
542 \@pstrickserr{Bad number: `#1'. 0 substituted.}\@ehpa
543 \def#2{0 }%
544 \or% 1
545 \edef#2{\ifnum\pst@num=\tw@-\fi\the\pst@cntg.%
546 \expandafter\@gobble\the\pst@cnth\space}%
547 \or% 2
548 \edef#2{\ifnum\pst@num=\tw@-\fi\the\pst@cntg.%
549 \expandafter\@gobble\the\pst@cnth\space}%
550 \or% 3
551 \edef#2{\pst@tempA\space}%
552 \fi}
553 \def\pst@@checknum{%
554 \@ifnextchar-%
555 {\let\pst@num\tw@\expandafter\pst@@@checknum\@gobble}%
556 {\@ifnextchar !%
557 {\def\pst@num{3}\pst@@@@@checknum}
558 {\let\pst@num\@ne\pst@@@checknum}}%
559 }
560 \def\pst@@@checknum#1.#2.#3\@nil{%
561 \afterassignment\pst@@@@checknum\pst@cntg=0#1\relax\@nil%
562 \afterassignment\pst@@@@checknum\pst@cnth=1#2\relax\@nil}
563 \def\pst@@@@checknum#1\relax\@nil{\ifx\@nil#1\@nil\else\let\pst@num\z@\fi}
564 %
565 \def\pst@@@@@checknum#1#2.#3\@nil{\def\pst@tempA{#2}}% PostScript Notation with !<code>
566 %
567 \def\pst@getnumii#1 #2 #3\@nil{%
568 \pst@checknum{#1}\pst@tempg%
569 \ifx\relax#2\relax\let\pst@temph\pst@tempg\else\pst@checknum{#2}\pst@temph\fi}
570 \def\pst@getnumiii#1 #2 #3 #4\@nil{%
571 \pst@checknum{#1}\pst@tempg%
572 \pst@checknum{#2}\pst@temph%
573 \pst@checknum{#3}\pst@tempi}
574 \def\pst@getnumiv#1 #2 #3 #4 #5\@nil{%
575 \pst@checknum{#1}\pst@tempg%
576 \pst@checknum{#2}\pst@temph%
577 \pst@checknum{#3}\pst@tempi%
578 \pst@checknum{#4}\pst@tempj}
579 %
580 \def\pst@getdimnum#1 #2 #3\@nil{%
581 \pssetlength\pst@dimg{#1}%
582 \pst@checknum{#2}\pst@tempg%
583 }
584 \def\pst@getscale#1#2{% read and check a scale input x [y]
585 \edef\pst@tempg{#1}%
586 \ifx\pst@tempg\@none
587 \def#2{}%
588 \else
589 \pst@expandafter\pst@getnumii{#1 #1} {} {} {}\@nil
590 \ifdim\pst@tempg\p@=\z@
591 \@pstrickserr{Bad scaling argument `#1'}\@ehpa
592 \def#2{}%
593 \else
594 \ifdim\pst@temph\p@=\z@
595 \@pstrickserr{Bad scaling argument `#1'}\@ehpa
596 \def#2{}%
597 \else
598 \edef#2{\pst@tempg\space \pst@temph\space scale }%
599 \fi
600 \fi
601 \fi%
602 }
603 \def\pst@getint#1#2{% read and check an integer
604 \pst@cntg=#1\relax
605 \edef#2{\the\pst@cntg\space}%
606 }
607 \begingroup
608 \catcode`\{=12
609 \catcode`\}=12
610 \catcode`\[=1
611 \catcode`\]=2
612 \gdef\pslbrace[{ ]
613 \gdef\psrbrace[} ]
614 \endgroup
615 %
616 %
617 \input pstricks-color
618 %
619 %
620 \def\pst@grestore{
621 currentpoint
622 matrix currentmatrix
623 currentfont
624 grestore
625 setfont
626 setmatrix
627 moveto
628 }
629 \define@boolkey[psset]{pstricks}[Pst@]{draft}[true]{}
630 \define@key[psset]{pstricks}{bgcolor}{\def\pst@bgcolor{#1}}% background for pspicture
631 \psset[pstricks]{bgcolor={},draft=false}% \pst@bgcolor is \@empty
632
633 \define@key[psset]{pstricks}{style}{%
634 \@ifundefined{pscs@#1}%
635 {\@pstrickserr{Custom style `#1' undefined}\@ehpa}%
636 {\@nameuse{pscs@#1}}%
637 }
638 \def\newpsstyle{\@ifnextchar[\newpsstyle@ii{\newpsstyle@ii[]}}%% hv 2016-12-23
639 %
640 %\def\newpsstyle@i#1#2{\@namedef{pscs@#1}{%
641 % \def\pst@tempA{#2}%
642 % \ifx\pst@tempA\@empty\else\psset{#2}\fi}}
643 %
644 \def\newpsstyle@ii[#1]#2#3{%
645 \@namedef{pscs@#2}{\if$#1$\psset{#3}\else\psset[#1]{#3}\fi}}%% end
646 %
647 \def\addto@psstyle#1#2{%
648 \pst@toks=\expandafter{#1#2}%
649 \edef#1{\the\pst@toks}}
650 \def\addtopsstyle#1#2{%
651 \def\pst@tempA{#2}%
652 \ifx\pst@tempA\@empty\else
653 \@ifundefined{pscs@#1}%
654 {\newpsstyle{#1}{#2}}%
655 {\expandafter\addto@psstyle\csname pscs@#1\endcsname{\psset{#2}}}%
656 \fi}
657 %------------ hv 1.16 end -------------------
658 %
659 \def\@none{none}
660 %
661 \newdimen\psunit \psunit 1cm
662 \newdimen\psxunit \psxunit 1cm
663 \newdimen\psyunit \psyunit 1cm
664 \let\psrunit\psunit
665 %
666 \def\pstunit@off{\let\@psunit\ignorespaces\ignorespaces}
667 %
668 \def\pssetlength#1#2{%
669 \let\@psunit\psunit
670 \afterassignment\pstunit@off
671 #1 #2\@psunit%
672 }
673 \def\psaddtolength#1#2{%
674 \let\@psunit\psunit
675 \afterassignment\pstunit@off
676 \advance#1 #2\@psunit%
677 }
678 \def\pssetxlength#1#2{%
679 \let\@psunit\psxunit
680 \ifpst@useCalc
681 \edef\@@temp{\pscalculate{#2}}%
682 \afterassignment\pstunit@off
683 #1 \@@temp\@psunit
684 \else
685 \afterassignment\pstunit@off
686 #1 #2\@psunit
687 \fi
688 }
689 \def\pssetylength#1#2{%
690 \let\@psunit\psyunit
691 \ifpst@useCalc
692 \edef\@@temp{\pscalculate{#2}}%
693 \afterassignment\pstunit@off
694 #1 \@@temp\@psunit
695 \else
696 \afterassignment\pstunit@off
697 #1 #2\@psunit
698 \fi
699 }
700 \define@key[psset]{pstricks}{unit}[1cm]{%
701 \pssetlength\psunit{#1}%
702 \psxunit=\psunit%
703 \psyunit=\psunit%
704 }
705 \define@key[psset]{pstricks}{runit}[1cm]{\pssetlength\psrunit{#1}}
706 \define@key[psset]{pstricks}{xunit}[1cm]{\pssetxlength\psxunit{#1}}
707 \define@key[psset]{pstricks}{yunit}[1cm]{\pssetylength\psyunit{#1}}
708 %
709 \define@key[psset]{pstricks}{PstDebug}[0]{\pst@getint{#1}\Pst@Debug}% hv 2004-06-22
710 \psset[pstricks]{PstDebug=0}
711 \def\psDEBUG{\@ifnextchar[\psDEBUG@i{\psDEBUG@i[PSTricks]}}%
712 \def\psDEBUG@i[#1]#2{\ifnum\Pst@Debug>0 \expandafter\typeout{<#1>: #2}\fi}%
713 %
714 \def\pst@getlength#1#2{%
715 \pssetlength\pst@dimg{#1}%
716 \edef#2{\pst@number\pst@dimg}%
717 }
718 \def\pst@@getlength#1#2{%
719 \pssetlength\pst@dimg{#1}%
720 \edef#2{\number\pst@dimg sp}%
721 }
722 \def\pst@getcoor#1#2{\pst@@getcoor{#1}\let#2\pst@coor}
723 \def\pst@coor{0 0 }
724 %
725 \def\pst@getcoors#1#2{%
726 \def\pst@aftercoors{\addto@pscode{#1 \pst@coors }#2}%
727 \def\pst@coors{}%
728 \pst@@getcoors
729 }
730 \def\pst@@getcoors(#1){%
731 \pst@@getcoor{#1}%
732 \edef\pst@coors{\pst@coor\pst@coors}%
733 \@ifnextchar({\pst@@getcoors}{\pst@aftercoors}%
734 }
735 %
736 \newcount\pst@C@@rType% 0: default cartesian coordinates and angles
737 %
738 \def\pst@getangle#1#2{\pst@@getangle{#1}\let#2\pst@angle}
739 \def\pst@angle{0 }
740 %
741 \def\cartesian@coor#1,#2,#3\@nil{%
742 \pssetxlength\pst@dimg{#1}%
743 \pssetylength\pst@dimh{#2}%
744 \edef\pst@coor{\pst@number\pst@dimg \pst@number\pst@dimh}%
745 }
746 \def\NormalCoor{%
747 \def\pst@@getcoor##1{\pst@expandafter\cartesian@coor{##1},\relax,\@nil}%
748 \def\pstCheckCoorType##1{\global\pst@C@@rType=0}%
749 \Pst@SpecialLengthfalse
750 \def\pssetlength##1##2{%
751 \let\@psunit\psunit
752 \afterassignment\pstunit@off
753 ##1 ##2\@psunit%
754 }%
755 \def\pst@@getangle##1{%
756 \pst@checknum{##1}\pst@angle%
757 \edef\pst@angle{\pst@angle \pst@angleunit}%
758 }%
759 \def\psput@##1{\pst@@getcoor{##1}\leavevmode\psput@cartesian}%
760 }
761 %\NormalCoor% set to normal read of coors, angles and lengths
762 %
763 \def\degrees{\@ifnextchar[{\@degrees}{\def\pst@angleunit{}}}
764 \def\@degrees[#1]{%
765 \pst@checknum{#1}\pst@tempg
766 \edef\pst@angleunit{360 \pst@tempg div mul }%
767 \pstVerb{tx@Dict begin startGlobal /pst@angleunit {\pst@angleunit} def endGlobal end}%
768 \ignorespaces}
769 %
770 \def\radians{\def\pst@angleunit{57.2956 mul }%
771 \pstVerb{tx@Dict begin startGlobal /pst@angleunit {\pst@angleunit} def endGlobal end}}%
772 \def\pst@angleunit{}%
773 %
774 \def\SpecialCoor{%
775 \def\pst@@getcoor##1{%
776 \begingroup%
777 \pst@activecoor
778 \xdef\pst@tempg{##1}%
779 \endgroup
780 \expandafter\special@coor\pst@tempg||\@nil}%
781 \def\pstCheckCoorType##1{%
782 \begingroup
783 \pst@activecoor
784 \xdef\pst@tempg{##1}%
785 \endgroup
786 \psDEBUG[pstCheckCoorType]{:Checking coor \pst@tempg:}%
787 \expandafter\pst@CheckCoorType\pst@tempg||\@nil%
788 \psDEBUG[pstCheckCoorType]{::Coor type=\the\pst@C@@rType::}%
789 }%
790 \def\pssetlength##1##2{%
791 \begingroup%
792 \pst@activecoor%
793 \xdef\pst@tempg{##2}%
794 \endgroup%
795 \expandafter\special@length\pst@tempg\@nil{##1}%
796 \ignorespaces}%
797 \def\pst@@getangle##1{%
798 \begingroup%
799 \pst@activecoor%
800 \xdef\pst@tempg{##1}%
801 \endgroup%
802 \expandafter\special@angle\pst@tempg\@empty)\@nil%
803 }%
804 \def\psput@##1{\pst@@getcoor{##1}\leavevmode\psput@special}%
805 }
806 \SpecialCoor% set to special read of coors, angles and lengths
807 %
808 \define@key[psset]{}{precode}{\def\pst@prepscode{#1 }}
809 \define@key[psset]{}{postcode}{\def\pst@postpscode{#1 }}
810 \psset{precode={},postcode={}}% For use in other packages
811 %
812 %
813 \begingroup
814 \catcode`\|=13
815 \catcode`\;=13
816 \catcode`\!=13
817 \catcode`\*=13
818 \catcode`\>=13
819 \catcode`\+=13
820 \gdef\pst@activecoor{%
821 \def|{\string|}%
822 \def;{\string;}%
823 \def!{\string!}%
824 \def*{\string*}% algebraic expression hv 2007-11-17
825 \def>{\string>}%
826 \def+{\string+}% pure algebaric 2013-04-23
827 }
828 \endgroup
829 % \pst@C@@rType = 0 cartesian (x,y)
830 % = 1 polar (r;phi)
831 % = 2 PS (! x y)
832 % = 3 mixed ((x,y)|(x,y))
833 % = 4 algebraic (*x f(x)) x in PostScript notation
834 % = 5 node (A)
835 % = 6 special node ([...]A)
836 % = 7 node (>A)
837 % = 8 algebraic (+x,f(x)) _both_ algebraic
838 \def\pst@CheckCoorType#1|#2|#3\@nil{%
839 \ifx#3|\relax
840 \global\pst@C@@rType=3\relax
841 \else
842 \expandafter\pst@@CheckCoorType#1;;\@nil%
843 \fi}
844 %
845 \def\pst@@CheckCoorType#1#2;#3;#4\@nil{%
846 \ifx#1>\relax% node with special rotation for \uput
847 \global\pst@C@@rType=7
848 \else
849 \ifcat#1a\relax% node names should start with a letter
850 \global\pst@C@@rType=5
851 \else
852 \ifx#1[\relax% special node coor: [..]A
853 \global\pst@C@@rType=6
854 \else
855 \ifx#1!\relax% PostScript code: x y
856 \global\pst@C@@rType=2
857 \else
858 \ifx#1*\relax% algebraic PostScript code: x f(x)
859 \global\pst@C@@rType=4
860 \else
861 \ifx#1+\relax% algebraic algebraic: x, f(x)
862 \global\pst@C@@rType=8
863 \else
864 \ifx#4;\relax% polar coordinates
865 \global\pst@C@@rType=1
866 \else
867 \global\pst@C@@rType=0
868 \fi
869 \fi
870 \fi
871 \fi
872 \fi
873 \fi
874 \fi
875 \psDEBUG[pstCheckCoorType]{::\the\pst@C@@rType::}%
876 }%
877 %
878 %
879 \def\special@coor#1|#2|#3\@nil{%
880 \ifx#3|\relax
881 \mixed@coor{#1}{#2}%
882 \else
883 \special@@coor#1;;\@nil%
884 \fi}
885 %
886 \def\special@@coor#1{%
887 \ifcat#1a\relax% node names should start with a letter
888 \def\ps@next{\node@coor#1}%
889 \else
890 \ifx#1[\relax% special node coor: [..]A
891 \def\ps@next{\Node@coor[}%
892 \else
893 \ifx#1>\relax% PostScript code: x y
894 \def\ps@next{\special@@@@coor}%
895 \else
896 \ifx#1!\relax% PostScript code: x y
897 \def\ps@next{\raw@coor}%
898 \else
899 \ifx#1*\relax% PostScript/algebraic code: x f(x)
900 \def\ps@next{\alg@coor}%
901 \else
902 \ifx#1+\relax% algebraic code: x,f(x)
903 \def\ps@next{\algalg@coor}%
904 \else%
905 \def\ps@next{\special@@@coor#1}%
906 \fi%
907 \fi%
908 \fi%
909 \fi\fi%
910 \fi%
911 \ps@next%
912 }
913 \def\special@@@coor#1;#2;#3\@nil{%
914 \ifx#3;\relax
915 \polar@coor{#1}{#2}%
916 \else
917 \cartesian@coor#1,\relax,\@nil
918 \fi%
919 }
920 \def\special@@@@coor#1#2;#3;#4\@nil{%
921 \def\ps@A{A}\def\ps@B{#1}%
922 \ifcat\ps@A\ps@B\relax%
923 \node@coor#1#2;;\@nil%
924 \else%
925 \cartesian@coor#1#2,\relax,\@nil
926 \fi%
927 }
928 \def\mixed@coor#1#2{%
929 \begingroup%
930 % DG/SR modification begin - Oct. 27, 1997 - Patch 6
931 %\specialcoor@ii#1;;\@nil
932 %\let\pst@tempa\pst@coor
933 %\specialcoor@ii#2;;\@nil
934 \special@@coor#1;;\@nil%
935 \let\pst@tempa\pst@coor%
936 \special@@coor#2;;\@nil%
937 % DG/SR modification end
938 \xdef\pst@tempg{\pst@tempa pop \pst@coor exch pop }%
939 \endgroup%
940 \let\pst@coor\pst@tempg%
941 }
942 %
943 \def\polar@coor#1#2{%
944 % \pssetlength\pst@dimg{#1}%
945 \pssetlength\pst@dimb{#1}% hv 2007-10-16 g is already used in get@@angle
946 \pst@@getangle{#2}%
947 % \edef\pst@coor{\pst@number\pst@dimg \pst@angle \tx@PtoC}% dito
948 \edef\pst@coor{\pst@number\pst@dimb \pst@angle \tx@PtoC }%
949 }
950 %
951 \def\raw@coor{\@ifnextchar !\raw@@coor\raw@@@coor}
952 \def\raw@@coor!#1;#2\@nil{% PostScript code without using \tx@ScreenCoor
953 \edef\pst@coor{#1 }}
954 \def\raw@@@coor#1;#2\@nil{% PostScript code
955 \edef\pst@coor{ #1 \tx@ScreenCoor }}
956 %
957 \def\alg@coor{\@ifnextchar*{\alg@@coor}{\alg@@@@coor}}
958 \def\alg@@coor*#1;#2\@nil{\expandafter\alg@@@coor#1\@nil}
959 \def\alg@@@coor#1 #2\@nil{% algebraic PostScript code
960 %\typeout{Nummer1: #1}%
961 %\typeout{Nummer2: #2}%
962 \edef\pst@coor{%
963 /Func (#1) AlgParser cvx def
964 /y #2 def
965 y Func exch \tx@ScreenCoor }}
966 %
967 \def\alg@@@@coor#1;#2\@nil{\expandafter\alg@@@@@coor#1\@nil}
968 \def\alg@@@@@coor#1 #2\@nil{% algebraic PostScript code
969 \edef\pst@coor{%
970 /x #1 def
971 /Func (#2) AlgParser cvx def
972 x Func \tx@ScreenCoor }}
973 %
974 \define@boolkey[psset]{}[Pst@]{exchange}[true]{}
975 \psset{exchange=false}
976 %
977 \def\algalg@coor#1;#2\@nil{\expandafter\algalg@@@coor#1\@nil}
978 \def\algalg@@@coor#1,#2\@nil{% algebraic algebraic code
979 \edef\pst@coor{%
980 /x (#1) AlgParser cvx def
981 /Func (#2) AlgParser cvx def
982 x Func \tx@ScreenCoor }}
983 %
984 \def\node@coor#1\@nil{%
985 \@pstrickserr{You must load `pst-node.tex' to use node coordinates.}\@ehps
986 \def\pst@coor{0 0 }%
987 }
988 \def\Node@coor{\node@coor}
989 %
990 \def\special@angle#1#2)#3\@nil{%
991 \ifx !#1\relax
992 \edef\pst@angle{#2\space \pst@angleunit}%
993 \else\ifx(#1\relax
994 \pst@@getcoor{#2}%
995 \edef\pst@angle{\pst@coor exch \tx@Atan}%
996 \else
997 \pst@checknum{#1#2}\pst@angle
998 \edef\pst@angle{\pst@angle \pst@angleunit}%
999 \fi\fi}
1000 %
1001 \def\special@length#1#2\@nil#3{%
1002 \ifx !#1\relax
1003 \edef\pst@SpecialLength{ #2 \pst@number\psunit mul }%
1004 \Pst@SpecialLengthtrue
1005 \else
1006 \let\@psunit\psunit
1007 \afterassignment\pstunit@off
1008 #3 #1#2\@psunit
1009 \Pst@SpecialLengthfalse
1010 \fi
1011 }
1012 %
1013 \def\Cartesian{%
1014 \def\cartesian@coor##1,##2,##3\@nil{%
1015 \pssetxlength\pst@dimg{##1}%
1016 \pssetylength\pst@dimh{##2}%
1017 \edef\pst@coor{\pst@number\pst@dimg \pst@number\pst@dimh}%
1018 }%
1019 \@ifnextchar({\Cartesian@}{}%
1020 }
1021 \def\Cartesian@(#1,#2){%
1022 \pssetxlength\psxunit{#1}%
1023 \pssetylength\psyunit{#2}%
1024 \ignorespaces
1025 }
1026 \def\Polar{%
1027 \def\psput@cartesian{\psput@special}%
1028 \def\cartesian@coor##1,##2,##3\@nil{\polar@coor{##1}{##2}}%
1029 }%
1030 \define@key[psset]{pstricks}{origin}[]{%
1031 \pst@@getcoor{#1}%
1032 \edef\psk@origin{\pst@coor T }}
1033 \def\psk@origin{}
1034 %
1035 \define@boolkey[psset]{pstricks}[Pst@]{algebraic}[true]{}
1036 \psset{algebraic=false}
1037 %
1038 \define@boolkey[psset]{pstricks}[]{swapaxes}[true]{% \if@pst
1039 \@nameuse{@pst#1}%
1040 \if@pst\def\psk@swapaxes{-90 rotate -1 1 scale }%
1041 \else\def\psk@swapaxes{}%
1042 \fi
1043 }
1044 \psset[pstricks]{swapaxes=false}
1045 %
1046 \define@boolkey[psset]{pstricks}[]{showpoints}[true]{}
1047 \psset[pstricks]{showpoints=false}
1048 %
1049 \let\pst@setrepeatarrowsflag\relax
1050 %
1051 \define@key[psset]{pstricks}{border}[0pt]{\pst@getlength{#1}\psk@border \pst@setrepeatarrowsflag}
1052 \psset[pstricks]{border=0pt}
1053 \define@key[psset]{pstricks}{bordercolor}[white]{\pst@getcolor{#1}\psbordercolor}
1054 \psset[pstricks]{bordercolor=white}
1055 \define@boolkey[psset]{pstricks}[ps]{doubleline}[true]{\pst@setrepeatarrowsflag}
1056 \psset[pstricks]{doubleline=false}
1057 \define@key[psset]{pstricks}{doublesep}[1.25\pslinewidth]{\def\psdoublesep{#1}}
1058 \psset[pstricks]{doublesep=1.25\pslinewidth}
1059 \define@key[psset]{pstricks}{doublecolor}[white]{\pst@getcolor{#1}\psdoublecolor}
1060 \psset[pstricks]{doublecolor=white}
1061
1062 \let\pst@setrepeatarrowsflag\relax
1063 %
1064 \define@boolkey[psset]{pstricks}[ps]{shadow}[true]{\pst@setrepeatarrowsflag}
1065 \psset[pstricks]{shadow=false}
1066 \define@key[psset]{pstricks}{shadowsize}[3pt]{\pst@getlength{#1}\psk@shadowsize}
1067 \psset[pstricks]{shadowsize=3pt}
1068 \define@key[psset]{pstricks}{shadowangle}[-45]{\pst@getangle{#1}\psk@shadowangle}
1069 \psset[pstricks]{shadowangle=-45}
1070 \define@key[psset]{pstricks}{shadowcolor}[darkgrey]{\pst@getcolor{#1}\psshadowcolor}
1071 \psset[pstricks]{shadowcolor=darkgray}
1072 %
1073 \def\psls@none{}
1074 \def\psls@solid{ \psk@linejoin\space setlinejoin \psk@linecap\space setlinecap stroke }
1075 \def\psls@coloreddashed{ \psls@solid grestore gsave \pst@usecolor\psdashcolor \tx@setlinejoin \psls@dashed }
1076 %
1077 \newdimen\pslinewidth
1078 \define@key[psset]{pstricks}{linewidth}[0.8pt]{\pssetlength\pslinewidth{#1}}
1079 \psset[pstricks]{linewidth=.8pt}
1080 \define@key[psset]{pstricks}{linecolor}[black]{\pst@getcolor{#1}\pslinecolor}
1081 \psset[pstricks]{linecolor=black}
1082 \define@key[psset]{pstricks}{kitecolor}[red]{\pst@getcolor{#1}\ps@kitecolor}
1083 \define@key[psset]{pstricks}{dartcolor}[blue]{\pst@getcolor{#1}\ps@dartcolor}
1084 \psset[pstricks]{kitecolor,dartcolor}
1085 %
1086 \newif\ifPst@coloreddashed
1087 \define@key[psset]{pstricks}{dashcolor}[white]{%
1088 \ifx\relax#1\relax\Pst@coloreddashedfalse%
1089 \else\Pst@coloreddashedtrue\pst@getcolor{#1}\psdashcolor
1090 \fi}
1091 \psset{dashcolor=\relax}
1092 %\define@key[psset]{pstricks}{linecap}[0]{\pst@getint{#1}\psk@linecap}% hv 2007-12-01
1093 %\psset[pstricks]{linecap=0} >>>>>>>>>>>>> siehe unten
1094 \define@key[psset]{pstricks}{linejoin}[0]{\pst@getint{#1}\psk@linejoin}% hv 2007-10-13
1095 \psset[pstricks]{linejoin=0}
1096 \def\tx@setlinejoin{\psk@linejoin\space setlinejoin }% hv 2007-10-13
1097 %
1098 \def\pst@missing{%
1099 \z@
1100 \@pstrickserr{Missing number or dimension. 0 substituted}\@ehpa}
1101 %
1102 %%------------------- begin patch 15 HV 2004-05-15 -------------
1103 \def\pst@empty{\z@}
1104
1105 \define@key[psset]{pstricks}{dash}[5pt 3pt 0pt 0pt]{% defined in pstricks.tex
1106 \pst@expandafter\psset@@dash{#1}\@nil}% Error handling for empty argument.
1107 \define@key[psset]{pstricks}{maxdashes}[11]{\def\psk@maxdashes{#1}}
1108 \psset[pstricks]{maxdashes=11}
1109 %
1110 \def\psset@@dash#1\@nil{%
1111 \def\psk@dash{}%
1112 \pst@cntm0
1113 \def\next##1 ##2\relax{%
1114 \expandafter\ifnum\psk@maxdashes>\pst@cntm\relax % 04-08-07
1115 \edef\@tempa{##1}%
1116 \ifx\@tempa\@empty\else% gobble leading spaces
1117 \pssetlength\pst@dimc{##1}%
1118 \advance\pst@cntm by 1
1119 \edef\psk@dash{\psk@dash\space\pst@number\pst@dimc}%
1120 \fi%
1121 \edef\@tempa{##2}%
1122 \ifx\@tempa\@empty\else% detect end
1123 \ifx\@tempa\space\else% gobble trailing spaces
1124 \next##2\relax%
1125 \fi\fi%
1126 \else% 04-08-07
1127 \@pstrickserr{Number of dashes > \psk@maxdashes. Increasing
1128 'maxdashes' might work.}\@ehpa% 04-08-07
1129 \fi% 04-08-07
1130 }%
1131 \expandafter\next#1 \relax}
1132 \psset[pstricks]{dash=5pt 3pt 0pt 0pt}% black white black white
1133 %%------------------- end patch 15 HV 2004-05-15 -------------
1134 \define@boolkey[psset]{pstricks}[ps]{dashadjust}[true]{}
1135 \psset[pstricks]{dashadjust}
1136 \def\tx@DashLine{DashLine }
1137 %
1138 \def\psls@dashed{
1139 \ifPst@coloreddashed \psls@solid grestore gsave \pst@usecolor\psdashcolor \tx@setlinejoin \fi
1140 \psk@linecap\space setlinecap
1141 \ifpsdashadjust
1142 [ \psk@dash ] \pst@linetype\space \tx@DashLine
1143 \else
1144 [ \psk@dash ] 0 setdash stroke
1145 \fi}
1146 %% End patch TN; Date (YY-MM-DD): 04-07-17; 2nd part
1147 %
1148 \define@key[psset]{pstricks}{dotsep}[3pt]{\pst@getlength{#1}\psk@dotsep}
1149 \psset[pstricks]{dotsep=3pt}
1150 \def\tx@DotLine{DotLine }
1151 \def\psls@dotted{
1152 \ifpsdashadjust
1153 \psk@dotsep \pst@linetype\space \tx@DotLine
1154 \else
1155 [ 0 \psk@dotsep CLW add ] 0 setdash 1 setlinecap stroke
1156 \fi
1157 }
1158 %
1159 \define@key[psset]{pstricks}{linestyle}[solid]{%
1160 \@ifundefined{psls@#1}%
1161 {\@pstrickserr{Line style `#1' not defined}\@eha}%
1162 {\def\pslinestyle{#1}}}
1163 \psset[pstricks]{linestyle=solid}
1164 %
1165 \define@key[psset]{pstricks}{linecap}[0]{%
1166 \def\psk@linecap{0}%
1167 \ifnum#1>-1
1168 \ifnum#1<3
1169 \pst@getint{#1}\psk@linecap%
1170 \fi\fi}
1171 \psset{linecap=0}
1172 %------------------------- Transparency modes ----------------------------
1173 \pst@def{setTransparency}< \psk@opacityalpha .setopacityalpha >
1174 \pst@def{setStrokeTransparency}< \psk@strokeopacityalpha revision 952 gt { .setstrokeconstantalpha }{ .setopacityalpha } ifelse >
1175 \pst@def{setBlendmode}<
1176 \ifcase\psk@blendmode
1177 /Normal \or
1178 /Compatible \or
1179 /Screen \or
1180 /Multiply \or
1181 /HardLight \or
1182 /Darken \or
1183 /Lighten \or
1184 /Difference\or
1185 /ColorDodge\or
1186 /ColorBurn\or
1187 /SoftLight\or
1188 /Hue\or
1189 /Saturation\or
1190 /Luminosity\or
1191 /Overlay\or
1192 /Exclusion\or
1193 /Color
1194 \else
1195 /Normal
1196 \fi
1197 .setblendmode \psk@shapealpha .setshapealpha >
1198 %
1199 %--------------------------------- hv 2007-09-09 begin ---------------------
1200 % transparency needs a run through latex -> dvips -> ps2pdf14(!)
1201 %
1202 \def\e@fill@inverse{oefill}
1203 \define@key[psset]{pstricks}{fillcolor}[white]{%
1204 \ifx\psk@fillstylename\e@fill@inverse
1205 \pst@getcolor{#1}\psk@oefillcolor
1206 \pst@getcolor{white}\psfillcolor
1207 \else \pst@getcolor{white}\psk@oefillcolor
1208 \pst@getcolor{#1}\psfillcolor
1209 \fi}
1210
1211 \psset[pstricks]{fillcolor=white}
1212 \define@key[psset]{pstricks}{strokeopacity}[1]{\pst@checknum{#1}\psk@strokeopacityalpha }% for lines
1213 \psset[pstricks]{strokeopacity=1}
1214 \define@key[psset]{pstricks}{opacity}[1]{\pst@checknum{#1}\psk@opacityalpha }% for filled areas
1215 \psset[pstricks]{opacity=1}
1216 \define@key[psset]{pstricks}{shapealpha}[0.6]{\pst@checknum{#1}\psk@shapealpha }
1217 \psset[pstricks]{shapealpha=0.6}
1218 \define@key[psset]{pstricks}{blendmode}[0]{\pst@getint{#1}\psk@blendmode }% must be one of
1219 % /Normal 0
1220 % /Compatible 1
1221 % /Screen 2
1222 % /Multiply 3
1223 % /HardLight 4
1224 \psset[pstricks]{blendmode=0}
1225 \define@key[psset]{pstricks}{fsAngle}[137.50775]{\pst@getangle{#1}\pst@fsAngle }
1226 \define@key[psset]{pstricks}{fsOrigin}[(0,0)]{%
1227 \pst@@getcoor{#1}\edef\pst@fsOrigin{\pst@coor T }}
1228 \psset[pstricks]{fsOrigin={0,0},fsAngle=137.50775}
1229 %
1230 \def\tx@LineFill{LineFill }
1231 \def\tx@DotFill{DotFill }
1232 \def\tx@PenroseFill{PenroseFill }
1233 \def\tx@PenroseFillA{PenroseFillA }
1234 \def\tx@TruchetFill{TruchetFill }
1235 %
1236 \def\psfs@none{}
1237 \def\psfs@solid{\pst@fill{\pst@usecolor\psfillcolor \tx@setTransparency fill }}
1238 \def\psfs@eofill{\pst@fill{\pst@usecolor\psfillcolor \tx@setTransparency eofill}}
1239 \def\psfs@oefill{\pst@fill{\pst@usecolor\psk@oefillcolor \tx@setTransparency fill }\psfs@eofill }
1240 \def\psfs@shape{\pst@fill{\pst@usecolor\psfillcolor \tx@setBlendmode fill }}
1241 \def\psfs@spiral{\pst@fill{\pst@fsOrigin \pst@usecolor\psfillcolor clip newpath
1242 0 .1 500 { dup dup sqrt 4 div 0 360 arc fill \pst@fsAngle rotate } for }}
1243 %
1244 \define@key[psset]{pstricks}{hatchwidth}[0.8pt]{\pst@getlength{#1}\psk@hatchwidth}
1245 \psset[pstricks]{hatchwidth=.8pt}
1246 \define@key[psset]{pstricks}{hatchsep}[4pt]{\pst@getlength{#1}\psk@hatchsep}
1247 \psset[pstricks]{hatchsep=4pt}
1248 \define@key[psset]{pstricks}{hatchcolor}[black]{\pst@getcolor{#1}\pshatchcolor}
1249 \psset[pstricks]{hatchcolor=black}
1250 \define@key[psset]{pstricks}{hatchangle}[45]{\pst@getangle{#1}\psk@hatchangle}
1251 \psset[pstricks]{hatchangle=45}
1252 \define@key[psset]{pstricks}{hatchsepinc}[0pt]{\pst@getlength{#1}\psk@hatchsepinc}
1253 \define@key[psset]{pstricks}{hatchwidthinc}[0pt]{\pst@getlength{#1}\psk@hatchwidthinc}
1254 \psset[pstricks]{hatchwidthinc=0pt,hatchsepinc=0pt}
1255 %
1256 \def\pst@linefill#1{
1257 /clipType { \ifx\relax#1\relax clip \else#1\fi} def
1258 \psk@hatchangle rotate
1259 \psk@hatchwidth SLW
1260 \pst@usecolor\pshatchcolor
1261 \psk@hatchsep
1262 \psk@hatchsepinc
1263 \psk@hatchwidthinc
1264 \tx@LineFill }
1265 %
1266 \def\psfs@vlines{\pst@fill{\pst@linefill{}}}
1267 \def\psfs@eovlines{\pst@fill{\pst@linefill{eoclip}}}
1268 \@namedef{psfs@vlines*}{\psfs@solid \psfs@vlines}
1269 \@namedef{psfs@eovlines*}{\psfs@eofill \psfs@eovlines}
1270 \def\psfs@hlines{\pst@fill{90 rotate \pst@linefill{}}}
1271 \def\psfs@eohlines{\pst@fill{90 rotate \pst@linefill{eoclip}}}
1272 \@namedef{psfs@hlines*}{\psfs@solid \psfs@hlines}
1273 \@namedef{psfs@eohlines*}{\psfs@eofill \psfs@eohlines}
1274 \def\psfs@crosshatch{\psfs@vlines \psfs@hlines}
1275 \@namedef{psfs@crosshatch*}{\psfs@solid \psfs@vlines \psfs@hlines}
1276 \@namedef{psfs@eocrosshatch*}{\psfs@eofill \psfs@eovlines \psfs@eohlines}
1277 %
1278 \define@key[psset]{pstricks}{psscale}[1]{%
1279 \def\psk@@psscale{#1}% for use with \psscalebox
1280 \pst@checknum{#1}\psk@psscale}
1281 \psset[pstricks]{psscale=1}
1282 %
1283 \def\pst@dotFill[#1]{%
1284 /clipType { \ifx\relax#1\relax clip \else #1 \fi } def
1285 gsave
1286 \pst@number\pslinewidth SLW
1287 \pst@usecolor\pshatchcolor
1288 % /DotLineColor { \pst@usecolor\pslinecolor } def
1289 \psk@hatchsep
1290 \psk@hatchwidth
1291 \tx@DotFill }
1292
1293 \def\psfs@dots{\pst@fill{ /SolidDot false def \pst@dotFill[] }}
1294 \def\psfs@eodots{\pst@fill{ /SolidDot false def \pst@dotFill[eoclip] }}
1295 \@namedef{psfs@dots*}{\pst@fill{ /SolidDot true def \pst@dotFill[] }}
1296 \@namedef{psfs@eodots*}{\pst@fill{ /SolidDot true def \pst@dotFill[eoclip] }}
1297 %
1298 \def\pst@penroseFill{%
1299 % gsave % restore in PenroseFill
1300 \pst@number\pslinewidth SLW
1301 \pst@usecolor\pshatchcolor
1302 \psk@psscale
1303 \tx@PenroseFill }
1304 \def\psfs@penrose{\pst@fill\pst@penroseFill}
1305 \@namedef{psfs@penrose*}{\psfs@solid \psfs@penrose}
1306 %
1307 \def\pst@penroseFillA{%
1308 % gsave % restore in PenroseFillA
1309 \pst@number\pslinewidth SLW
1310 % \pst@usecolor\pshatchcolor
1311 % on stack: scaling factor, border color, kite color, dart color
1312 % dup dup scale
1313 % /border_colour ED %
1314 % /kite_colour ED %
1315 % /dart_colour
1316 { \pst@usecolor\ps@dartcolor }
1317 { \pst@usecolor\ps@kitecolor }
1318 { \pst@usecolor\pshatchcolor }
1319 \psk@psscale
1320 \tx@PenroseFillA }
1321 \def\psfs@penroseA{\pst@fill\pst@penroseFillA}
1322 \@namedef{psfs@penroseA*}{\psfs@solid \psfs@penroseA}
1323 %
1324 \def\pst@truchetFill{%
1325 gsave % restore in PenroseFill
1326 \pst@number\pslinewidth SLW
1327 \pst@usecolor\pshatchcolor
1328 \psk@psscale
1329 \tx@TruchetFill }
1330 \def\psfs@truchet{ \pst@fill\pst@truchetFill }
1331 \@namedef{psfs@truchet*}{\psfs@solid \psfs@truchet}
1332 %
1333 \define@key[psset]{pstricks}{fillstyle}[none]{%
1334 \def\psk@fillstylename{#1}% needed for inverse eofill
1335 \edef\pst@tempg{#1}\def\pst@temph{none}%
1336 \ifx\pst@tempg\pst@temph
1337 \let\psk@fillstyle\relax
1338 \else
1339 \@ifundefined{psfs@#1}%
1340 {\@pstrickserr{Undefined fill style: `#1'}\@eha}%
1341 {\edef\psk@fillstyle{\expandafter\noexpand\csname psfs@#1\endcsname}}%
1342 \fi%
1343 }
1344 \define@key[psset]{pstricks}{addfillstyle}[]{%
1345 \@ifundefined{psfs@#1}%
1346 {\@pstrickserr{Undefined fill style: `#1'}\@eha}%
1347 {\edef\psk@fillstyle{%
1348 \expandafter\noexpand\psk@fillstyle
1349 \expandafter\noexpand\csname psfs@#1\endcsname}%
1350 }}
1351 \psset[pstricks]{fillstyle=none}
1352 %
1353 %--------------------------- continous linewidth -------------------
1354 \newdimen\psk@startLW
1355 \newdimen\psk@endLW
1356 \define@key[psset]{pstricks}{startLW}[\pslinewidth]{\pssetlength{\psk@startLW}{#1}}%
1357 \define@key[psset]{pstricks}{endLW}[\pslinewidth]{\pssetlength{\psk@endLW}{#1}}%
1358 \define@key[psset]{pstricks}{startWL}[380]{\pst@getint{#1}\psk@startWL}%
1359 \define@key[psset]{pstricks}{endWL}[780]{\pst@getint{#1}\psk@endWL}%
1360 \define@boolkey[psset]{pstricks}[Pst@]{variableLW}[true]{}
1361 \define@boolkey[psset]{pstricks}[Pst@]{variableColor}[true]{}
1362 \define@key[psset]{pstricks}{setflat}[0.1]{\pst@checknum{#1}\psk@setflat}%
1363 \psset[pstricks]{startLW=\pslinewidth,endLW=\pslinewidth,variableColor=false,
1364 variableLW=false,startWL=380,endWL=770,setflat=0.1}
1365 %
1366 \def\pst@flattenpath{
1367 20 dict begin
1368 /Coors [] def
1369 /Cmds [] def
1370 /NoOfSteps 0 def
1371 /add2Values { Coors aload length 2 add array astore /Coors exch def } def
1372 /add6Values { Coors aload length 6 add array astore /Coors exch def } def
1373 /addmoveto { -1 Cmds aload length 1 add array astore /Cmds exch def } def
1374 /addlineto { 0 Cmds aload length 1 add array astore /Cmds exch def } def
1375 /addcurveto { 1 Cmds aload length 1 add array astore /Cmds exch def } def
1376 \psk@setflat\space setflat % the value for the line snippets
1377 flattenpath % flatten the existing path into line segments
1378 { add2Values addmoveto} % what to do with moveto
1379 { NoOfSteps 1 add /NoOfSteps ED add2Values addlineto} % what to do with lineto
1380 { NoOfSteps 1 add /NoOfSteps ED add6Values addcurveto} % what to do with curveto (not needed here)
1381 { } % nothing for closepath
1382 pathforall
1383 %
1384 /dLW \pst@number\psk@endLW \pst@number\psk@startLW sub NoOfSteps div def % the step for the linewidth
1385 \ifPst@variableColor
1386 /dColor \psk@endWL\space \psk@startWL\space sub NoOfSteps div def % same for color
1387 \fi
1388 %%%
1389 \pst@number\psk@startLW setlinewidth
1390 \tx@setlinejoin
1391 \psk@linecap\space setlinecap
1392 /lambda \psk@startWL def
1393 Cmds length /Ncmds ED % number of the commands is the length of the array
1394 /CoorIndex 0 def
1395 Ncmds 1 sub -1 0 {
1396 % on stack is the loop index
1397 Cmds exch get /cmdNo ED % get command as nuber -1, 0, 1 | moveto, lineto, curveto
1398 cmdNo 0 eq { Coors CoorIndex 2 getinterval aload pop lineto CoorIndex 2 add /CoorIndex ED }
1399 { cmdNo 0 lt { Coors CoorIndex 2 getinterval aload pop moveto CoorIndex 2 add /CoorIndex ED }
1400 { Coors CoorIndex 6 getinterval aload pop curveto CoorIndex 6 add /CoorIndex ED } ifelse } ifelse % else is curveto
1401 \ifPst@variableColor
1402 lambda dColor add dup /lambda ED
1403 tx@addDict begin wavelengthToRGB Red Green Blue end setrgbcolor
1404 \else
1405 \pst@usecolor\pslinecolor
1406 \fi
1407 currentlinewidth dLW add setlinewidth
1408 CP /yCurr ED /xCurr ED
1409 stroke % draw the line segment
1410 xCurr yCurr moveto % go to the last point
1411 } for
1412 end
1413 }
1414 %
1415 %--------------------------- A R R O W S ---------------------------
1416
1417 \input pstricks-arrows
1418
1419 %% ---------------------- end arrow part ----------------------
1420 %
1421 \def\tx@SD{ \tx@setTransparency SD }
1422 \def\tx@EndDot{ EndDot }
1423 %
1424 \def\pst@par{}
1425 \def\addto@par#1{%
1426 \ifx\pst@par\@empty
1427 \def\pst@par{#1}%
1428 \else
1429 \expandafter\def\expandafter\pst@par\expandafter{\pst@par,#1}%
1430 \fi%
1431 }
1432 \def\addbefore@par#1{%
1433 \ifx\pst@par\@empty
1434 \def\pst@par{#1}%
1435 \else
1436 \toks@{#1}%
1437 \pst@toks\expandafter{\pst@par}%
1438 \edef\pst@par{\the\toks@,\the\pst@toks}%
1439 \fi%
1440 }
1441 \def\use@par{%
1442 \ifx\pst@par\@empty\else
1443 \expandafter\@psset\pst@par,\@nil
1444 \def\pst@par{}%
1445 \fi
1446 }
1447 \def\use@keep@par{% same as \use@par, but keeps the values
1448 \ifx\pst@par\@empty\else
1449 \expandafter\@psset\pst@par,\@nil
1450 % \def\pst@par{}%
1451 \fi}
1452 %
1453 \def\pst@object#1{%
1454 \def\pst@par{}%
1455 \pst@ifstar{%
1456 \@ifnextchar[{\pst@@object{#1}}{\@nameuse{#1@i}}}%
1457 }
1458 \def\pst@@object#1[#2]{%
1459 \def\pst@par{#2}%
1460 \@ifnextchar+{\@nameuse{#1@i}}{\@nameuse{#1@i}}%
1461 }
1462 \def\newpsobject#1#2#3{%
1463 \@ifundefined{#2@i}%
1464 {\@pstrickserr{Graphics object `#2' not defined}\@eha}{%
1465 \@namedef{#1}{\pst@object{#1}}%
1466 \@namedef{#1@i}{\addbefore@par{#3}\@nameuse{#2@i}}}%
1467 \ignorespaces}
1468 %
1469 \def\begin@ClosedObj{%
1470 \leavevmode
1471 \pst@killglue
1472 \begingroup
1473 \use@par
1474 \solid@star
1475 \ifpsdoubleline\pst@setdoublesep\fi
1476 \pst@addarrowdef% DG addition
1477 \init@pscode}
1478 %
1479 \def\end@ClosedObj{%
1480 \ifpsshadow \pst@closedshadow \fi
1481 \ifdim\psk@border\p@>\z@ \pst@addborder \fi
1482 \psk@fillstyle
1483 \pst@stroke
1484 \ifpsdoubleline \pst@doublestroke \fi
1485 \ifshowpoints
1486 % DG modification begin - Mar. 4, 1995
1487 %\addto@pscode{Points aload length 2 div cvi /N ED \psdots@iii}%
1488 \pst@OpenShowPoints
1489 % DG modification end
1490 \fi
1491 \use@pscode
1492 \endgroup
1493 \ignorespaces%
1494 }
1495 \def\begin@OpenObj{%
1496 \begin@ClosedObj
1497 \let\pst@linetype\pst@arrowtype
1498 \pst@addarrowdef
1499 }
1500 \def\begin@AltOpenObj{%
1501 \begin@ClosedObj
1502 \def\pst@repeatarrowsflag{\z@}%
1503 \def\pst@linetype{0}}
1504 %
1505 \def\end@OpenObj{%
1506 \ifpsshadow \pst@openshadow \fi
1507 \ifdim\psk@border\p@>\z@ \pst@addborder \fi
1508 \psk@fillstyle
1509 \pst@stroke
1510 \ifpsdoubleline \pst@doublestroke \fi
1511 \ifnum\pst@repeatarrowsflag>\z@ \pst@repeatarrows \fi
1512 \ifshowpoints \pst@OpenShowPoints \fi
1513 \use@pscode
1514 \endgroup
1515 \ignorespaces}
1516 %
1517 \def\begin@SpecialObj{%
1518 \leavevmode
1519 \pst@killglue
1520 \begingroup
1521 \use@par
1522 \init@pscode}
1523 %
1524 \def\end@SpecialObj{%
1525 \use@pscode
1526 \endgroup
1527 \ignorespaces}
1528 %
1529 \def\pst@code{}%
1530 %
1531 \def\init@pscode{%
1532 \addto@pscode{%
1533 \pst@number\pslinewidth SLW
1534 \pst@usecolor\pslinecolor}%
1535 }
1536 \def\addto@pscode#1{\xdef\pst@code{\pst@code#1\space}}
1537 %
1538 \def\use@pscode{%
1539 \pstverb{
1540 \pst@dict
1541 \tx@STP
1542 \pst@newpath
1543 \psk@origin
1544 \psk@swapaxes
1545 \pst@code
1546 end
1547 }%
1548 \gdef\pst@code{}%
1549 }
1550 \def\use@psCode{%
1551 \pstVerb{
1552 \pst@dict
1553 \tx@STP
1554 \pst@newpath
1555 \psk@origin
1556 \psk@swapaxes
1557 \pst@code
1558 end
1559 }%
1560 \gdef\pst@code{}%
1561 }
1562 \def\pst@newpath{newpath }
1563 %
1564 \def\pst@@killglue{\unskip\ifdim\lastskip>\z@\expandafter\pst@@killglue\fi}
1565 \def\KillGlue{\let\pst@killglue\pst@@killglue}
1566 \def\DontKillGlue{\let\pst@killglue\relax}
1567 \DontKillGlue
1568 %
1569 \def\solid@star{%
1570 \if@star
1571 \pslinewidth=\z@
1572 \psdoublelinefalse
1573 \def\pslinestyle{none}%
1574 \def\psk@fillstyle{\psfs@solid}%
1575 \let\psfillcolor\pslinecolor
1576 \fi}
1577 %
1578 \def\pst@setdoublesep{%
1579 \pst@getlength\psdoublesep\psdoublesep
1580 \pslinewidth=2\pslinewidth
1581 \advance\pslinewidth\psdoublesep\p@
1582 \let\pst@setdoublesep\relax}
1583 \def\tx@Shadow{Shadow }
1584 \def\pst@closedshadow{%
1585 \addto@pscode{%
1586 gsave
1587 \psk@shadowsize \psk@shadowangle \tx@PtoC
1588 \tx@Shadow
1589 \pst@usecolor\psshadowcolor
1590 gsave fill grestore
1591 stroke
1592 grestore
1593 gsave
1594 \pst@usecolor\psfillcolor
1595 gsave fill grestore
1596 stroke
1597 grestore}}
1598 %
1599 \def\pst@openshadow{%
1600 \addto@pscode{%
1601 gsave
1602 \psk@shadowsize \psk@shadowangle \tx@PtoC
1603 \tx@Shadow
1604 \pst@usecolor\psshadowcolor
1605 \ifx\psk@fillstyle\relax\else
1606 gsave fill grestore
1607 \fi
1608 stroke}%
1609 \pst@repeatarrows%
1610 \addto@pscode{grestore}%
1611 \ifx\psk@fillstyle\relax\else
1612 \addto@pscode{%
1613 gsave
1614 \pst@usecolor\psfillcolor
1615 gsave fill grestore
1616 stroke
1617 grestore}%
1618 \fi}
1619 %
1620 \def\pst@addborder{%
1621 \addto@pscode{%
1622 gsave
1623 \psk@border 2 mul
1624 CLW add SLW
1625 \pst@usecolor\psbordercolor
1626 stroke
1627 grestore}}
1628 %
1629 \def\pst@stroke{%
1630 \ifx\pslinestyle\@none\else
1631 \addto@pscode{%
1632 gsave
1633 \pst@number\pslinewidth SLW
1634 \pst@usecolor\pslinecolor
1635 \tx@setStrokeTransparency % hv 2008-01-13
1636 \@nameuse{psls@\pslinestyle}
1637 grestore}%
1638 \fi}
1639 %
1640 \def\pst@fill#1{\addto@pscode{gsave #1 grestore}}%
1641 %
1642 \def\pst@doublestroke{%
1643 \addto@pscode{%
1644 gsave
1645 \psdoublesep SLW
1646 \pst@usecolor\psdoublecolor
1647 \tx@setStrokeTransparency % hv 2016-09-23
1648 stroke
1649 grestore
1650 }}
1651 %
1652 \def\pst@OpenShowPoints{%
1653 \addto@pscode{%
1654 gsave
1655 \psk@dotsize
1656 \@nameuse{psds@\psk@dotstyle}
1657 newpath
1658 Points aload length 2 div 2 sub cvi /N ED
1659 N 0 ge
1660 { \ifx\psk@arrowA\@empty Dot \else pop pop \fi
1661 N { Dot } repeat
1662 \ifx\psk@arrowB\@empty Dot \else pop pop \fi }
1663 { N 2 mul { pop } repeat } ifelse
1664 grestore
1665 }}
1666 %
1667 \newif\ifPst@custom\Pst@customfalse
1668 \define@boolkey[psset]{pstricks}[Pst@]{noCurrentPoint}[true]{}
1669 \psset[pstricks]{noCurrentPoint=false}
1670 %
1671 %
1672 \def\pscustom{\pst@object{pscustom}}
1673 \long\def\pscustom@i#1{%
1674 \begin@SpecialObj%
1675 \solid@star%
1676 \let\pst@ifcustom\iftrue%
1677 \Pst@customtrue%
1678 \let\begin@ClosedObj\begin@CustomObj%
1679 \let\end@ClosedObj\endgroup%
1680 \def\begin@OpenObj{\begin@CustomObj\pst@addarrowdef}%
1681 \let\end@OpenObj\endgroup%
1682 \let\begin@AltOpenObj\begin@CustomObj%
1683 \def\begin@SpecialObj{%
1684 \begingroup%
1685 \pst@misplaced{special graphics object}%
1686 \def\addto@pscode####1{}%
1687 \let\end@SpecialObj\endgroup}%
1688 \def\@multips(##1)(##2)##3##4{\pst@misplaced\multips}%
1689 \def\psclip##1{\pst@misplaced\psclip}%
1690 \def\pst@repeatarrowsflag{\z@}%
1691 \let\pst@setrepeatarrowsflag\relax%
1692 \showpointsfalse%
1693 \def\pst@linetype{\pslinetype}%
1694 \def\psk@liftpen{\z@}%
1695 % \psset{liftpen=0}%
1696 \def\pst@cp{/currentpoint load stopped pop }%
1697 \def\pst@oplineto{/lineto load stopped { moveto } if }%
1698 \def\pst@optcp##1##2{\ifnum##1=\z@\def##2{/currentpoint load stopped { 0 0 } if }\fi}%
1699 \let\caddto@pscode\addto@pscode%
1700 \def\cuse@par##1{{\use@par##1}}%
1701 \the\pst@customdefs%
1702 \setbox\pst@hbox=\hbox{#1}%
1703 \psk@fillstyle
1704 \pst@stroke
1705 \end@SpecialObj
1706 \let\pst@ifcustom\iffalse
1707 \ignorespaces
1708 }
1709 %
1710 \let\pst@ifcustom\iffalse
1711 %
1712 \def\begin@CustomObj{%
1713 \begingroup%
1714 \use@par%
1715 \addto@pscode{
1716 \pst@number\pslinewidth SLW
1717 \pst@usecolor\pslinecolor
1718 }%
1719 }
1720 \def\pst@oplineto{moveto }
1721 \def\pst@cp{}
1722 \def\pst@optcp#1#2{}
1723 \define@key[psset]{pstricks}{liftpen}[0]{%
1724 \ifPst@custom%
1725 \ifcase#1\relax%
1726 \def\psk@liftpen{\z@}%
1727 \def\pst@cp{/currentpoint load stopped pop }%
1728 \def\pst@oplineto{/lineto load stopped { moveto } if }%
1729 \or%
1730 \def\psk@liftpen{1}%
1731 \def\pst@cp{}%
1732 \def\pst@oplineto{/lineto load stopped { moveto } if }%
1733 \or%
1734 \def\psk@liftpen{2}%
1735 \def\pst@cp{}%
1736 \def\pst@oplineto{moveto }%
1737 \fi\fi%
1738 }
1739 \psset[pstricks]{liftpen=0}
1740 \def\psk@liftpen{-1}
1741 %
1742 \define@key[psset]{pstricks}{linetype}[2]{%
1743 \pst@getint{#1}\pslinetype
1744 \ifnum\pst@cntg<-3
1745 \@pstrickserr{linetype must be greater than -3}\@ehpa
1746 \def\pslinetype{2}%
1747 \fi}
1748 \psset[pstricks]{linetype=2}% otherwise there is a problem when using e.g.
1749 % \psaxes[axesstyle=frame,linestyle=dashed]{->}(3,-2)
1750 %
1751 \def\caddto@pscode#1{%
1752 \@pstrickserr{Command can only be used in \string\pscustom}\@ehpa}
1753 \let\cuse@par\caddto@pscode
1754 %
1755 \def\tx@MSave{%
1756 /msavematrx
1757 [ tx@Dict /msavematrx known % does msavematrix exists?
1758 { msavematrx aload pop } if
1759 CM % matrix currentmatrix
1760 ]
1761 def
1762 %----------------- hv begin 2004-05-07 ------------- patch 15
1763 msavematrx
1764 %----------------- hv end 2004-05-07 ------------- patch 15
1765 }
1766 \def\tx@MRestore{% a typo in pstricks with msavematrx
1767 tx@Dict /msavematrx known { length 0 gt } { false } ifelse
1768 { msavematrx aload pop setmatrix } if
1769 }
1770 %
1771 \newtoks\pst@customdefs
1772 \pst@customdefs{%
1773 \def\newpath{\addto@pscode{newpath}}%
1774 \def\reversepath{\addto@pscode{ reversepath }}% 20131209 hv
1775 \def\moveto(#1){\pst@@getcoor{#1}\addto@pscode{\pst@coor moveto}}%
1776 \def\rmoveto(#1){\pst@@getcoor{#1}\addto@pscode{\pst@coor rmoveto}}%
1777 \def\closepath{\addto@pscode{closepath}}%
1778 \def\gsave{\begingroup\addto@pscode{gsave}}%
1779 \def\grestore{\endgroup\addto@pscode{grestore}}%
1780 \def\translate(#1){\pst@@getcoor{#1}\addto@pscode{\pst@coor translate}}%
1781 \def\rotate#1{\pst@@getangle{#1}\addto@pscode{\pst@angle rotate}}%
1782 \def\scale#1{\pst@getscale{#1}\pst@tempg\addto@pscode{\pst@tempg}}%
1783 \def\msave{\addto@pscode{\tx@MSave}}%
1784 \def\mrestore{\addto@pscode{\tx@MRestore}}%
1785 \def\swapaxes{\addto@pscode{-90 rotate -1 1 scale}}%
1786 \def\stroke{\def\pst@par{}\pst@object{stroke}}%
1787 \def\fill{\def\pst@par{}\pst@object{fill}}%
1788 \def\openshadow{\def\pst@par{}\pst@object{openshadow}}%
1789 \def\closedshadow{\def\pst@par{}\pst@object{closedshadow}}%
1790 \def\movepath(#1){\pst@@getcoor{#1}\addto@pscode{\pst@coor \tx@Shadow}}%
1791 \def\lineto{\pst@onecoor{lineto}}%
1792 \def\rlineto{\pst@onecoor{rlineto}}%
1793 \def\curveto{\pst@threecoor{curveto}}%
1794 \def\rcurveto{\pst@threecoor{rcurveto}}%
1795 \def\code#1{\addto@pscode{#1}}%
1796 \def\coor(#1){\pst@@getcoor{#1}\addto@pscode\pst@coor\@ifnextchar({\coor}{}}%
1797 \def\rcoor{\pst@getcoors{}{}}%
1798 \def\dim#1{\pssetlength\pst@dimg{#1}\addto@pscode{\pst@number\pst@dimg}}%
1799 \def\setcolor#1{%
1800 \@ifundefined{\string\color@#1}{}{\addto@pscode{\pst@usecolor{#1}}}}% hv 1.14 2005-12-17
1801 \def\arrows#1{{\psset[pstricks]{arrows=#1}\pst@addarrowdef}}%
1802 \let\file\pst@rawfile%
1803 } % END \pst@customdefs
1804 %
1805 \def\closedshadow@i{\cuse@par\pst@closedshadow}
1806 \def\openshadow@i{\cuse@par\pst@openshadow}
1807 \def\stroke@i{\cuse@par\pst@stroke}%
1808 \def\fill@i{\cuse@par\psk@fillstyle}%
1809 \def\pst@onecoor#1(#2){%
1810 \pst@@getcoor{#2}%
1811 \addto@pscode{\pst@coor #1}}
1812 \def\pst@threecoor#1(#2)#3(#4)#5(#6){%
1813 \begingroup
1814 \pst@getcoor{#2}\pst@tempa
1815 \pst@getcoor{#4}\pst@tempb
1816 % DG/SR modification begin - Aug. 4, 1999 - Patch 11
1817 %\pst@getcoor{#6}\pst@tembc
1818 \pst@getcoor{#6}\pst@tempc
1819 % DG/SR modification end
1820 \addto@pscode{\pst@tempa \pst@tempb \pst@tempc #1}%
1821 \endgroup}
1822 %
1823 \def\pst@rawfile#1{%
1824 \begingroup
1825 \def\do##1{\catcode`##1=12\relax}"
1826 \dospecials
1827 \catcode`\%=14
1828 \pst@@rawfile{#1}%
1829 \endgroup}
1830 %
1831 \def\pst@@rawfile#1{%
1832 \immediate\openin1 #1
1833 \ifeof1
1834 \@pstrickserr{File `#1' not found}\@ehpa
1835 \else
1836 \immediate\read1 to \pst@tempg
1837 \loop
1838 \ifeof1 \@pstfalse\else\@psttrue\fi
1839 \if@pst
1840 \addto@pscode\pst@tempg
1841 \immediate\read1 to \pst@tempg
1842 \repeat
1843 \fi
1844 \immediate\closein1\relax}
1845 %
1846 \def\tx@NArray{NArray }
1847 \def\tx@Line{Line }
1848 \def\tx@Arcto{Arcto }
1849 \def\tx@CheckClosed{CheckClosed }
1850 \def\tx@Polygon{Polygon }
1851 \define@key[psset]{pstricks}{gangle}[0]{\pst@getangle{#1}\psk@gangle}
1852 \define@boolkey[psset]{pstricks}[Pst@]{trueAngle}[true]{}
1853 \psset[pstricks]{trueAngle=false,gangle=0}
1854 %
1855 \def\tx@Diamond{Diamond }
1856 \def\psdiamond{\def\pst@par{}\pst@object{psdiamond}}
1857 \def\psdiamond@i(#1){\@ifnextchar({\psdiamond@ii(#1)}{\psdiamond@ii(0,0)(#1)}}
1858 \def\psdiamond@ii(#1)(#2){%
1859 \begin@ClosedObj
1860 \pst@getcoor{#1}\pst@tempa
1861 \pst@getcoor{#2}\pst@tempb
1862 \addto@pscode{%
1863 \psline@iii
1864 pop
1865 \psk@dimen
1866 \pst@tempb
1867 \psk@gangle
1868 \pst@tempa
1869 \tx@Diamond
1870 }%
1871 \def\pst@linetype{4}%
1872 \end@ClosedObj}
1873 %
1874 \def\tx@Triangle{Triangle }
1875 \def\pstriangle{\def\pst@par{}\pst@object{pstriangle}}
1876 \def\pstriangle@i(#1){\@ifnextchar({\pstriangle@ii(#1)}{\pstriangle@ii(0,0)(#1)}}
1877 \def\pstriangle@ii(#1)(#2){%
1878 \begin@ClosedObj
1879 \pst@getcoor{#1}\pst@tempa% the center of the baseline
1880 \pst@getcoor{#2}\pst@tempb% the height of the triangle
1881 \addto@pscode{%
1882 \psline@iii
1883 pop % no showpoints option
1884 \psk@dimen % outer/inner/middle
1885 \pst@tempb
1886 \psk@gangle % rotating angle
1887 \pst@tempa
1888 \tx@Triangle
1889 }%
1890 \def\pst@linetype{2}%
1891 \end@ClosedObj}
1892 %
1893 \def\tx@CCA{CCA }
1894 \def\tx@CCA{CCA }
1895 \def\tx@CC{CC }
1896 \def\tx@IC{IC }
1897 \def\tx@BOC{BOC }
1898 \def\tx@NC{NC }
1899 \def\tx@EOC{EOC }
1900 \def\tx@BAC{BAC }
1901 \def\tx@NAC{NAC }
1902 \def\tx@EAC{EAC }
1903 \def\tx@OpenCurve{OpenCurve }
1904 \def\tx@AltCurve{AltCurve }
1905 \def\tx@ClosedCurve{ClosedCurve }
1906 %
1907 \define@key[psset]{pstricks}{curvature}[1 0.1 0]{%
1908 \edef\pst@tempg{#1 }%
1909 \expandafter\psset@@curvature\pst@tempg * * * \@nil}
1910 \def\psset@@curvature#1 #2 #3 #4\@nil{%
1911 \pst@checknum{#1}\pst@tempg
1912 \pst@checknum{#2}\pst@temph
1913 \pst@checknum{#3}\pst@tempi
1914 \edef\psk@curvature{\pst@tempg \pst@temph \pst@tempi}}
1915 %
1916 \psset[pstricks]{curvature=1 .1 0}
1917 %
1918 \def\pscurve{\pst@object{pscurve}}
1919 \def\pscurve@i{%
1920 \pst@getarrows{%
1921 \begin@OpenObj
1922 \pst@getcoors[\pscurve@ii%
1923 }%
1924 }
1925 \def\pscurve@ii{%
1926 \addto@pscode{
1927 \ifPst@noCurrentPoint\else\pst@cp\fi % current point
1928 \psk@curvature\space /c ED /b ED /a ED
1929 \ifshowpoints true \else false \fi
1930 \ifx\pslinestyle\psls@@symbol \psls@symbol OpenSymbolCurve \else \tx@OpenCurve \fi
1931 \ifPst@variableLW \pst@flattenpath \fi
1932 }%
1933 \ifx\pslinestyle\psls@@symbol\def\pslinestyle{none}\fi%
1934 \end@OpenObj%
1935 }
1936 \def\psecurve{\pst@object{psecurve}}
1937 \def\psecurve@i{\pst@getarrows{\begin@OpenObj\pst@getcoors[\psecurve@ii}}
1938 \def\psecurve@ii{%
1939 \addto@pscode{
1940 \psk@curvature\space /c ED /b ED /a ED
1941 \ifshowpoints true \else false \fi
1942 \ifx\pslinestyle\psls@@symbol \psls@symbol AltOpenSymbolCurve \else \tx@AltCurve \fi
1943 }%
1944 \ifx\pslinestyle\psls@@symbol\def\pslinestyle{none}\fi%
1945 \end@OpenObj}
1946 %
1947 \def\psccurve{\pst@object{psccurve}}
1948 \def\psccurve@i{\begin@ClosedObj\pst@getcoors[\psccurve@ii}
1949 \def\psccurve@ii{%
1950 \addto@pscode{%
1951 \psk@curvature\space /c ED /b ED /a ED
1952 \ifshowpoints true \else false \fi
1953 \ifx\pslinestyle\psls@@symbol \psls@symbol ClosedSymbolCurve \else \tx@ClosedCurve \fi
1954 }%
1955 \def\pst@linetype{1}%
1956 \ifx\pslinestyle\psls@@symbol\def\pslinestyle{none}\fi%
1957 \end@ClosedObj}
1958 %
1959 \def\pscspline{\pst@object{pscspline}}% Christoph Bersch
1960 \def\pscspline@i{%
1961 \pst@getarrows{%
1962 \begin@OpenObj
1963 \pst@getcoors[\pscspline@ii
1964 }%
1965 }
1966 \def\tx@Spline{Spline }
1967 \def\pscspline@ii{%
1968 \addto@pscode{
1969 \ifPst@noCurrentPoint\else\pst@cp\fi
1970 \tx@setlinejoin
1971 \ifshowpoints true \else false \fi
1972 \ifx\pslinestyle\psls@@symbol
1973 \psls@symbol OpenSymbolSpline
1974 \else
1975 \tx@Spline
1976 \fi
1977 }%
1978 \end@OpenObj
1979 }
1980 %
1981 %--------------------------- PSTricks dots -----------------------
1982 \input{pstricks-dots}
1983 %--------------------------- PSTricks dots end -------------------
1984 %
1985 \newdimen\pslinearc
1986 \define@key[psset]{pstricks}{linearc}[0pt]{\pssetlength\pslinearc{#1}}
1987 \psset[pstricks]{linearc=0pt}
1988 %
1989 \def\psline{\pst@object{psline}}
1990 \def\psline@i{%
1991 \pst@getarrows{%
1992 \begin@OpenObj
1993 \pst@getcoors[\psline@ii
1994 }%
1995 }
1996 \def\psline@ii{%
1997 \ifx\pslinestyle\psls@@symbol\addto@pscode{ \psls@symbol SymbolLine }%
1998 \else
1999 \addto@pscode{
2000 \ifPst@noCurrentPoint\else\pst@cp\fi % current point?
2001 \psline@iii % arc and lineto type
2002 \tx@Line % .pro function
2003 }%
2004 \fi
2005 \end@OpenObj
2006 }
2007 \def\psline@iii{%
2008 \ifdim\pslinearc>\z@
2009 /r \pst@number\pslinearc def
2010 /Lineto { \tx@Arcto } def
2011 \else
2012 /Lineto /lineto load def
2013 \fi
2014 \tx@setlinejoin % hv 2007-10-13
2015 \ifshowpoints true \else false \fi
2016 }
2017 %
2018 \def\psLine{\pst@object{psLine}}
2019 \def\psLine@i{%
2020 \pst@getarrows{%
2021 \begin@OpenObj
2022 \psLine@ii}}
2023 \def\psLine@ii(#1){\@ifnextchar({\psLine@iii(#1)}{\psLine@iii(0,0)(#1)}}%
2024 \def\psLine@iii(#1)(#2){%
2025 \pst@getcoor{#1}\pst@tempA
2026 \pst@getcoor{#2}\pst@tempB
2027 \addto@pscode{
2028 \ifPst@noCurrentPoint\else\pst@cp\fi % current point?
2029 [ % start for coordinate array
2030 \pst@tempB
2031 \pst@tempA % order vice versa
2032 4 copy Pyth2 \psk@arrowlength ge
2033 { \psline@iii \tx@Line }
2034 { pop pop pop pop pop } ifelse
2035 }%
2036 \end@OpenObj
2037 \ignorespaces
2038 }
2039 \def\psLineSegments{\leavevmode\pst@killglue\pst@object{psLineSegments}}
2040 \def\psLineSegments@i{\pst@getarrows{\psLineSegments@ii}}
2041 \def\psLineSegments@ii(#1)(#2){%
2042 \begingroup
2043 \use@keep@par
2044 \solid@star
2045 \ifpsdoubleline\pst@setdoublesep\fi
2046 \init@pscode
2047 \let\pst@linetype\pst@arrowtype
2048 \pst@addarrowdef
2049 \pst@getcoor{#1}\pst@tempA
2050 \pst@getcoor{#2}\pst@tempB
2051 \addto@pscode{
2052 \ifPst@noCurrentPoint\else\pst@cp\fi % current point?
2053 [ % start for coordinate array
2054 \pst@tempB
2055 \pst@tempA % order vice versa
2056 4 copy Pyth2 \psk@arrowlength ge
2057 { \psline@iii \tx@Line }
2058 { pop pop pop pop pop } ifelse
2059 }%
2060 \end@OpenObj
2061 \ignorespaces
2062 \@ifnextchar(\psLineSegments@ii{}%
2063 }%
2064 \def\pst@isnum#1{\pst@isnum@i\zap@space#1 \@empty\@nil}%
2065 \def\pst@isnum@i#1\@nil{%
2066 \if!\ifnum9<1#1!\else_\fi%
2067 \expandafter\@firstoftwo%
2068 \else%
2069 \expandafter\@secondoftwo%
2070 \fi}
2071 %
2072 \def\psset@@symbol#1#2#3#4\@nil{%
2073 \ifx\relax#4\relax\def\psk@symbol{(#1)}%
2074 \else%
2075 \pst@isnum{#1#2#3}{%
2076 \pst@cnta='#1#2#3\relax%
2077 \ifnum\pst@cnta>'377\relax%
2078 \@pstrickserr{Number too large!}\@ehpb%
2079 \else%
2080 \def\psk@symbol{(\@backslashchar#1#2#3)}%
2081 \fi%
2082 }{\@pstrickserr{Not a number!}\@ehpb}%
2083 \fi}
2084 %
2085 \define@key[psset]{pstricks}{symbol}[a]{\expandafter\psset@@symbol#1!!\@nil}
2086 \psset[pstricks]{symbol=a}
2087 %
2088 \newdimen\pst@symbolStep
2089 \define@key[psset]{pstricks}{symbolStep}[20pt]{\pst@expandafter\pst@@symbolStep#1\@nil}
2090 \def\pst@@symbolStep#1#2\@nil{\if-#1\pssetlength\pst@symbolStep{-#2pt}\else\pssetlength\pst@symbolStep{#1#2}\fi}
2091 \psset[pstricks]{symbolStep=20pt}
2092
2093 \newdimen\pst@symbolWidth
2094 \newdimen\pst@symbolLinewidth
2095 \define@key[psset]{pstricks}{symbolWidth}[10pt]{\pssetlength\pst@symbolWidth{#1}}
2096 \define@key[psset]{pstricks}{symbolLinewidth}[0.5pt]{\pssetlength\pst@symbolLinewidth{#1}}
2097 \psset[pstricks]{symbolWidth=10pt,symbolLinewidth=0.5pt}
2098
2099 \define@key[psset]{pstricks}{symbolFont}[Dingbats]{\def\psk@symbolFont{/#1 }}
2100 \psset[pstricks]{symbolFont=Dingbats}
2101 \define@boolkey[psset]{pstricks}[Pst@]{rotateSymbol}[true]{}
2102 \psset[pstricks]{rotateSymbol=false}
2103 \define@key[psset]{pstricks}{startAngle}[0]{\pst@getangle{#1}\psk@startAngle}
2104 \define@key[psset]{pstricks}{tickAngle}[0]{\pst@getangle{#1}\psk@tickAngle}
2105 \psset[pstricks]{startAngle=0,tickAngle=0}
2106 \define@boolkey[psset]{pstricks}[Pst@]{curveticks}[true]{}
2107 \psset[pstricks]{curveticks=false}
2108
2109 %
2110 \def\psls@symbol{
2111 /Symbol \psk@symbol def
2112 /SymbolWidth \pst@number\pst@symbolWidth def
2113 /SymbolLinewidth \pst@number\pst@symbolLinewidth def
2114 /SymStep \pst@number\pst@symbolStep def
2115 \psk@symbolFont findfont %0. [1.0 0.0 0.0 1.0 0.0 0.0]
2116 \pst@number\pst@symbolWidth scalefont %dup
2117 setfont
2118 /rotateSymbol \ifPst@rotateSymbol true \else false \fi def
2119 /tickAngle \psk@tickAngle\space def
2120 /startAngle \psk@startAngle\space def
2121 /CorrAngle \ifx\psk@rot\@empty 0 \else \psk@rot \fi def
2122 /curveticks \ifPst@curveticks true \else false \fi def
2123 \pst@number\pslinewidth SLW
2124 }
2125 \def\psls@@symbol{symbol}
2126 %
2127 \def\psPline{\def\pst@par{}\pst@object{psPline}}% perpendicular to another line B-C
2128 \def\psPline@i{%
2129 \pst@getarrows{%
2130 \begin@OpenObj
2131 \pst@getcoors[\psPline@ii}% \pst@coors on stack
2132 }
2133 \def\psPline@ii{%
2134 \addto@pscode{ % [ pC pB pA is on stack
2135 /yA ED /xA ED
2136 /yB ED /xB ED
2137 yB sub exch xB sub div /mBC ED % the slope
2138 /mA 1 mBC neg div def % orthogonal
2139 /xS yA yB sub mBC xB mul add mA xA mul sub mBC mA sub div def
2140 /yS mBC xS xB sub mul yB add def
2141 xS yS xA yA
2142 \ifPst@noCurrentPoint\else\pst@cp\fi % current point
2143 \psline@iii % arc and lineto type
2144 \tx@Line % .pro function
2145 }%
2146 \end@OpenObj%
2147 \ignorespaces%
2148 }
2149 %
2150 \def\qline(#1)(#2){%
2151 \def\pst@par{}%
2152 \begin@SpecialObj
2153 \def\pst@linetype{0}%
2154 \pst@getcoor{#1}\pst@tempa
2155 \pst@@getcoor{#2}%
2156 \addto@pscode{%
2157 \pst@tempa moveto \pst@coor L
2158 \@nameuse{psls@\pslinestyle}%
2159 }%
2160 \end@SpecialObj}
2161 %
2162 \def\pspolygon{\pst@object{pspolygon}}
2163 \def\pspolygon@i{%
2164 \begin@ClosedObj%
2165 \def\pst@cp{}%
2166 \pst@getcoors[\pspolygon@ii%
2167 }
2168 \def\pspolygon@ii{%
2169 \ifx\pslinestyle\psls@@symbol\addto@pscode{ \psls@symbol SymbolPolygon }%
2170 \else \addto@pscode{\psline@iii \tx@Polygon}%
2171 \fi%
2172 \def\pst@linetype{1}%
2173 \end@ClosedObj}
2174 %
2175 \define@key[psset]{pstricks}{framearc}[0]{\pst@checknum{#1}\psk@framearc}
2176 \psset[pstricks]{framearc=0}
2177 %
2178 \define@key[psset]{pstricks}{cornersize}[relative]{\pst@expandafter\psset@@cornersize{#1}\@nil}
2179 \def\psset@@cornersize#1#2\@nil{%
2180 \if #1a\relax
2181 \def\psk@cornersize{\pst@number\pslinearc false }%
2182 \else\def\psk@cornersize{\psk@framearc true }%
2183 \fi}
2184 \psset[pstricks]{cornersize=relative}
2185 %
2186 \def\tx@Rect{Rect }
2187 \def\tx@OvalFrame{OvalFrame }
2188 \def\tx@Frame{Frame }
2189 %
2190 \define@key[psset]{pstricks}{dimen}[outer]{\pst@expandafter\psset@@dimen{#1}\@nil}
2191 \def\psset@@dimen#1#2\@nil{%
2192 \if #1o\relax% outer
2193 \def\psk@dimen{.5 }%
2194 \else
2195 \if #1m\relax% middle
2196 \def\psk@dimen{0 }%
2197 \else
2198 \if #1i\relax% inner
2199 \def\psk@dimen{-.5 }%
2200 \fi\fi\fi}
2201 \psset[pstricks]{dimen=outer}
2202 %
2203 \def\psframe{\pst@object{psframe}}
2204 \def\psframe@i(#1){%
2205 \@ifnextchar({\psframe@ii(#1)}{\psframe@ii(0,0)(#1)}}
2206 \def\psframe@ii(#1)(#2){%
2207 \begin@ClosedObj
2208 \pst@getcoor{#1}\pst@tempa
2209 \pst@@getcoor{#2}%
2210 \addto@pscode{ \psk@cornersize \pst@tempa \pst@coor \psk@dimen \tx@Frame }%
2211 \def\pst@linetype{2}%
2212 \showpointsfalse
2213 \end@ClosedObj
2214 }
2215
2216 \iffalse
2217 \def\psSquare{\pst@object{psSquare}}
2218 \def\psSquare@i(#1)(#2){%
2219 \begin@ClosedObj
2220 \pst@getcoor{#1}\pst@tempa
2221 \pst@getcoor{#2}\pst@tempb
2222 \addto@pscode{ \psk@cornersize
2223 \pst@tempa /yA ED /xA ED
2224 \pst@tempb /yB ED /xB ED
2225 xA yA moveto xB yB L
2226 xA xB sub yA yB sub atan /Angle ED
2227 xA yA xB yB Pyth2 dup xA add exch yA add
2228 \psk@dimen
2229 \tx@Frame
2230 % grestore
2231 }%
2232 \def\pst@linetype{2}%
2233 \showpointsfalse
2234 \end@ClosedObj
2235 }
2236 \fi
2237 %
2238 \def\psTextFrame{\pst@object{psTextFrame}}
2239 \def\psTextFrame@i(#1)(#2)#3{%
2240 \addbefore@par{ref=c}% to prevent an empty value
2241 \leavevmode%
2242 \pst@killglue
2243 \begingroup
2244 \use@par
2245 \ifx\psk@yref\relax \def\psk@yref{0}\fi% no Baseline possible
2246 \SpecialCoor
2247 \pst@getcoor{#1}\pst@tempA
2248 \pst@getcoor{#2}\pst@tempB
2249 \if@star\psframe*(#1)(#2)\else\psframe(#1)(#2)\fi
2250 \rput(! \pst@tempA \pst@tempB % x1 y1 x2 y2
2251 exch 4 -1 roll % y1 y2 x2 x1
2252 dup /x1 ED % y1 y2 x2 x1
2253 sub /dx ED % y1 y2
2254 exch dup /y1 ED % y2 y1
2255 sub /dy ED
2256 x1 dx \psk@xref\space mul add \pst@number\psxunit div
2257 y1 dy \psk@yref\space mul add \pst@number\psyunit div ){#3}
2258 \endgroup
2259 \ignorespaces}
2260 %
2261 \def\tx@BezierNArray{ BezierNArray }
2262 \def\tx@OpenBezier{ OpenBezier }
2263 \def\tx@ClosedBezier{ ClosedBezier }
2264 \def\tx@BezierShowPoints{ BezierShowPoints }
2265 \def\tx@BezierCurve{ BezierCurve }
2266 \def\pst@BezierType{2 } % the default
2267 %
2268 \def\psbezier{\pst@object{psbezier}}
2269 \def\psbezier@i{%
2270 \pst@getarrows{%
2271 \begin@OpenObj
2272 \pst@getcoors[\psbezier@ii%
2273 }%
2274 }
2275 \def\psbezier@ii{%
2276 \addto@pscode{
2277 \ifPst@noCurrentPoint\else\pst@cp\fi
2278 \ifshowpoints true \else false \fi
2279 \ifx\pslinestyle\psls@@symbol \psls@symbol OpenSymbolBezier
2280 \else
2281 \tx@OpenBezier
2282 \ifshowpoints \tx@BezierShowPoints \fi
2283 \fi
2284 }%
2285 \def\pst@linetype{1}%
2286 \ifx\pslinestyle\psls@@symbol\def\pslinestyle{none}\fi%
2287 \end@OpenObj}
2288 %
2289 \def\pscbezier{\def\pst@par{}\pst@object{pscbezier}}
2290 \def\pscbezier@i{%
2291 \begin@ClosedObj
2292 \pst@getcoors[\pscbezier@ii}
2293 %
2294 \def\pscbezier@ii{%
2295 \addto@pscode{%
2296 \ifshowpoints true \else false \fi
2297 \ifx\pslinestyle\psls@@symbol \psls@symbol ClosedSymbolBezier
2298 \else
2299 \tx@ClosedBezier
2300 \ifshowpoints \tx@BezierShowPoints \fi
2301 \fi}%
2302 % \chardef\pst@linetype=1
2303 \def\pst@linetype{1}%
2304 \ifx\pslinestyle\psls@@symbol\def\pslinestyle{none}\fi%
2305 \end@ClosedObj}
2306 %
2307 \iffalse
2308 \define@key[psset]{pstricks}{epsilon}[0.005]{\pst@checknum{#1}\psk@epsilon}
2309 \psset[pstricks]{epsilon=0.005} % 200 steps for one curve
2310 %
2311 \def\psBezier#1{% % allowed order is 1 ... 9
2312 \ifnum#1>0 \ifnum#1<10 \def\pst@BezierType{#1 }\fi\fi%
2313 \def\pst@par{}\pst@object{psBezier}}
2314 \def\psBezier@i{%
2315 \pst@getarrows{%
2316 \begin@OpenObj
2317 \pst@getcoors[\psBezier@ii%
2318 }}
2319 \def\psBezier@ii{%
2320 \addto@pscode{%
2321 \psk@epsilon % step for Bezier T=0,0+epsilon,0+i*epsilon,...,1
2322 \pst@BezierType % type of the Bezier curve 2,3,4,...
2323 \tx@BezierCurve
2324 \ifshowpoints \tx@BezierShowPoints \fi
2325 }%
2326 \end@OpenObj}
2327 \fi
2328 %
2329 \define@key[psset]{pstricks}{pType}[0]{\pst@cntg=#1\relax\edef\psk@pType{\the\pst@cntg}}
2330 \psset[pstricks]{pType=0}
2331 \def\tx@Parab{Parab }% given by 1 point and the min/max
2332 \def\tx@Parabo{Parab1 }% given by 2 points for y-a=(x-b)^2
2333 %
2334 \def\psparabola{\pst@object{psparabola}}% 2009-05-19 (hv)
2335 \def\psparabola@i{\pst@getarrows\psparabola@ii}
2336 \def\psparabola@ii#1(#2)#3(#4){% #2 P #4 SP
2337 \begin@OpenObj
2338 \pst@getcoor{#2}\pst@tempa
2339 \pst@@getcoor{#4}%
2340 \addto@pscode{\pst@tempa \pst@coor
2341 \ifcase\psk@pType
2342 \tx@Parab \or
2343 \tx@Parabo
2344 \fi}%
2345 \end@OpenObj}
2346 \let\parabola\psparabola% compatibility (hv)
2347 %
2348 %
2349 \input{pst-code-grid}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2350 %
2351 \input{pst-code-box}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2352 %
2353 \input{pst-code-arc}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2354 %
2355 \input{pst-code-circle_ellipse}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2356 %
2357 \def\multips{\@ifnextchar({\def\pst@par{}\multips@ii}{\multips@i}}
2358 \def\multips@i#1{\def\pst@par{rot=#1}\multips@ii}
2359 \def\multips@ii(#1){\@ifnextchar({\multips@iii(#1)}{\multips@iii(\z@,\z@)(#1)}}
2360 \long\def\multips@iii(#1)(#2)#3#4{%
2361 \begingroup
2362 %----------------- hv 1.10 ------------------
2363 \pst@killglue
2364 %----------------- hv 1.10 ------------------
2365 \use@par
2366 \pst@getcoor{#1}\pst@tempa
2367 \pst@@getcoor{#2}%
2368 \pst@cnta=#3\relax
2369 \init@pscode
2370 \addto@pscode{%
2371 \pst@tempa T \the\pst@cnta\space \pslbrace
2372 gsave \ifx\psk@rot\@empty\else\psk@rot rotate \fi}%
2373 \hbox to\z@{%
2374 \def\init@pscode{%
2375 \addto@pscode{%
2376 gsave
2377 \pst@number\pslinewidth SLW
2378 \pst@usecolor\pslinecolor}}%
2379 \def\use@pscode{\addto@pscode{grestore}}%
2380 \def\psclip##1{\pst@misplaced\psclip}%
2381 \def\nc@object##1##2##3##4{\pst@misplaced{node connection}}%
2382 #4%
2383 }%
2384 \addto@pscode{grestore \pst@coor T \psrbrace repeat}%
2385 \leavevmode
2386 \use@pscode
2387 \endgroup
2388 \ignorespaces}
2389 %
2390 \input{pst-code-ref_rot}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2391 %
2392 \input{pst-code-put}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2393 %
2394 \input{pst-code-pspicture}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2395 %
2396 \ifx\pstcustomize\relax \input pstricks.con \fi
2397 %%% changed 20230430 by hv, confuses otherwise the dvi color handling
2398 \ifluatex\pstVerb{0.8 setlinewidth 0 setgray}\fi% default setting (needed for lualatex)
2399 %%%
2400 \catcode`\@=\PstAtCode\relax
2401 %
2402 \endinput
2403 %%
2404 %% END: pstricks.tex