Debian Codegraph @

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

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