diff options
author | Karl Berry <karl@freefriends.org> | 2009-01-31 00:45:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-01-31 00:45:47 +0000 |
commit | afa0ddded45d19c7c2c4883359e3a26e59ce7a8c (patch) | |
tree | d0b0a712067e8d3ab5b8e79a6f72bef247c1ba02 /Master/texmf-dist/tex/generic/pstricks/pstricks.tex | |
parent | 9ed0613d8c7efda754589bc5eac54d7193651494 (diff) |
pstricks 1.27 (30jan09)
git-svn-id: svn://tug.org/texlive/trunk@12021 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pstricks/pstricks.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pstricks/pstricks.tex | 246 |
1 files changed, 173 insertions, 73 deletions
diff --git a/Master/texmf-dist/tex/generic/pstricks/pstricks.tex b/Master/texmf-dist/tex/generic/pstricks/pstricks.tex index d1faa16d836..5b28c6a631b 100644 --- a/Master/texmf-dist/tex/generic/pstricks/pstricks.tex +++ b/Master/texmf-dist/tex/generic/pstricks/pstricks.tex @@ -1,7 +1,7 @@ %% pstricks.tex %% COPYRIGHT 1993, 1994, 1999 by Timothy Van Zandt, tvz@nwu.edu. %% COPYRIGHT 2000-2003 by Denis Girou. -%% Copyright 2004-2008 Herbert Voss +%% Copyright 2004-2009 Herbert Voss % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -20,8 +20,8 @@ % See the PSTricks User's Guide for description. % This uses the header file `pstricks.pro'. % -\def\fileversion{1.26} -\def\filedate{2008/07/31} +\def\fileversion{1.27} +\def\filedate{2009/01/25} % \csname PSTricksLoaded\endcsname \let\PSTricksLoaded\endinput @@ -107,19 +107,23 @@ \newcount\pst@cntd \newcount\pst@cntg \newcount\pst@cnth +% +\newif\ifPst@SpecialLength +\Pst@SpecialLengthfalse +% \newif\if@pst \newtoks\pst@toks \newif\if@star \def\pst@ifstar#1{% - \@ifnextchar*{\@startrue\def\next*{#1}\next}{\@starfalse#1}} + \@ifnextchar*{\@startrue\def\ps@next*{#1}\ps@next}{\@starfalse#1}} \def\pst@expandafter#1#2{% - \def\next{#1}% + \def\ps@next{#1}% \edef\@tempa{#2}% \ifx\@tempa\@empty \@pstrickserr{Unexpected empty argument!}\@ehpb \def\@tempa{\@empty}% \fi - \expandafter\next\@tempa} + \expandafter\ps@next\@tempa} \def\pst@dimtonum#1#2{\edef#2{\pst@@dimtonum#1}} \def\pst@@dimtonum#1{\expandafter\pst@@@dimtonum\the#1} {\catcode`\p=12 \catcode`\t=12 \global\@namedef{pst@@@dimtonum}#1pt{#1}} @@ -150,6 +154,7 @@ \fi \endgroup #3=\pst@dimg} +% \def\pst@@pyth{% dimd = g <-- (g + u/g)/2 \pst@@divide\pst@dima\pst@dimd \advance\pst@dimd\pst@dimg @@ -243,11 +248,11 @@ % \def\pst@number#1{\pst@@dimtonum#1\space} \def\pst@checknum#1#2{% - \edef\next{#1}% - \ifx\next\@empty + \edef\ps@next{#1}% + \ifx\ps@next\@empty \let\pst@num\z@ \else - \expandafter\pst@@checknum\next..\@nil + \expandafter\pst@@checknum\ps@next..\@nil \fi \ifnum\pst@num=\z@ \@pstrickserr{Bad number: `#1'. 0 substituted.}\@ehpa @@ -485,6 +490,7 @@ } \def\pst@getangle#1#2{\pst@@getangle{#1}\let#2\pst@angle} \def\pst@angle{0 } +% \def\cartesian@coor#1,#2,#3\@nil{% \pssetxlength\pst@dimg{#1}% \pssetylength\pst@dimh{#2}% @@ -492,13 +498,20 @@ } \def\NormalCoor{% \def\pst@@getcoor##1{\pst@expandafter\cartesian@coor{##1},\relax,\@nil}% + \Pst@SpecialLengthfalse + \def\pssetlength##1##2{% + \let\@psunit\psunit + \afterassignment\pstunit@off + ##1 ##2\@psunit% + } \def\pst@@getangle##1{% \pst@checknum{##1}\pst@angle% \edef\pst@angle{\pst@angle \pst@angleunit}% }% \def\psput@##1{\pst@@getcoor{##1}\leavevmode\psput@cartesian}% } -\NormalCoor +\NormalCoor% set to normal read of coors, angles and lengths +% \def\degrees{\@ifnextchar[{\@degrees}{\def\pst@angleunit{}}} \def\@degrees[#1]{% \pst@checknum{#1}\pst@tempg @@ -506,6 +519,7 @@ \ignorespaces} \def\radians{\def\pst@angleunit{57.2956 mul }} \def\pst@angleunit{} +% \def\SpecialCoor{% \def\pst@@getcoor##1{% \begingroup% @@ -514,7 +528,14 @@ \endgroup% \expandafter\special@coor\pst@tempg||\@nil% }% -\def\pst@@getangle##1{% + \def\pssetlength##1##2{% + \begingroup + \pst@activecoor% + \xdef\pst@tempg{##2}% + \endgroup% + \expandafter\special@length\pst@tempg\@nil{##1}% + } + \def\pst@@getangle##1{% \begingroup% \pst@activecoor% \xdef\pst@tempg{##1}% @@ -542,25 +563,26 @@ \special@@coor#1;;\@nil \fi% } +% \def\special@@coor#1{% \ifcat#1a\relax% node names should start with a letter - \def\next{\node@coor#1}% + \def\ps@next{\node@coor#1}% \else \ifx#1[\relax% special node coor: [..]A - \def\next{\Node@coor[}% + \def\ps@next{\Node@coor[}% \else \ifx#1!\relax% PostScript code: x y - \def\next{\raw@coor}% + \def\ps@next{\raw@coor}% \else \ifx#1*\relax% algebraic PostScript code: x f(x) - \def\next{\alg@coor}% + \def\ps@next{\alg@coor}% \else - \def\next{\special@@@coor#1}% + \def\ps@next{\special@@@coor#1}% \fi \fi \fi \fi - \next% + \ps@next% } \def\special@@@coor#1;#2;#3\@nil{% \ifx#3;\relax @@ -611,18 +633,32 @@ \def\pst@coor{0 0 }% } \def\Node@coor{\node@coor} +% \def\special@angle#1#2)#3\@nil{% -\ifx!#1\relax -\edef\pst@angle{#2 \pst@angleunit}% -\else -\ifx(#1\relax -\pst@@getcoor{#2}% -\edef\pst@angle{\pst@coor exch \tx@Atan}% -\else -\pst@checknum{#1#2}\pst@angle -\edef\pst@angle{\pst@angle \pst@angleunit}% -\fi -\fi} + \ifx!#1\relax + \edef\pst@angle{#2 \pst@angleunit}% + \else\ifx(#1\relax + \pst@@getcoor{#2}% + \edef\pst@angle{\pst@coor exch \tx@Atan}% + \else + \pst@checknum{#1#2}\pst@angle + \edef\pst@angle{\pst@angle \pst@angleunit}% + \fi\fi} +% +\def\special@length#1#2\@nil#3{% + \psDEBUG[special@length]{ #1|#2|#3 }% + \ifx!#1\relax + \edef\pst@SpecialLength{ #2 \pst@number\psunit mul }% + \Pst@SpecialLengthtrue% + \psDEBUG[special@length]{ Special length: \pst@SpecialLength}% + \else + \let\@psunit\psunit + \afterassignment\pstunit@off + #3 #1#2\@psunit% + \Pst@SpecialLengthfalse% + \psDEBUG[special@length]{ Normal length: \the#3 }% + \fi} +% \def\Cartesian{% \def\cartesian@coor##1,##2,##3\@nil{% \pssetxlength\pst@dimg{##1}% @@ -898,8 +934,8 @@ } \def\psset@@arrows#1-#2\@empty#3\@nil{% \@psttrue - \def\next##1,#1-##2,##3\@nil{\def\pst@tempg{##2}}% - \expandafter\next\pst@arrowtable,#1-#1,\@nil + \def\ps@next##1,#1-##2,##3\@nil{\def\pst@tempg{##2}}% + \expandafter\ps@next\pst@arrowtable,#1-#1,\@nil \@ifundefined{psas@\pst@tempg}% {\@pstfalse\def\psk@arrowA{}}% {\let\psk@arrowA\pst@tempg}% @@ -1884,6 +1920,30 @@ \ifshowpoints true \else false \fi \tx@setlinejoin % hv 2007-10-13 } +% +\def\psPline{\pst@object{psPline}}% perpendicular to another line B-C +\def\psPline@i{% + \pst@getarrows{% + \begin@OpenObj + \pst@getcoors[\psPline@ii}% \pst@coors on stack +} +\def\psPline@ii{% + \addto@pscode{ % [ pC pB pA is on stack + /yA ED /xA ED + /yB ED /xB ED + yB sub exch xB sub div /mBC ED % the slope + /mA 1 mBC neg div def % orthogonal + /xS yA yB sub mBC xB mul add mA xA mul sub mBC mA sub div def + /yS mBC xS xB sub mul yB add def + xS yS xA yA + \pst@cp % current point + \psline@iii % arc and lineto type + \tx@Line % .pro function + }% + \end@OpenObj% + \ignorespaces% +} +% \def\qline(#1)(#2){% \def\pst@par{}% \begin@SpecialObj @@ -2611,7 +2671,7 @@ pop } \def\psarc@iv{% \pst@coor /y ED /x ED - /r \pst@number\pst@dima def + /r \ifPst@SpecialLength \pst@SpecialLength \else \pst@number\pst@dima \fi def /c 57.2957 r \tx@Div def /angleA \pst@tempa @@ -2671,6 +2731,44 @@ pop \def\psarcn{\pst@object{psarcn}} \def\psarcn@i{\def\psarc@type{1}\psarc@i} % +\def\psarcAB{\pst@object{psarcAB}}% hv 2008-11-26 +\def\psarcAB@i{% + \addbefore@par{psscale=1}% be sure, that it is defined + \pst@getarrows{% + \begin@OpenObj + \pst@getcoors{}\psarcAB@ii% + }% +} +\def\psarcAB@ii{% + \addto@pscode{% + /y ED /x ED /yA ED /xA ED /yB ED /xB ED + /r xB yB x y Pyth2 \psk@psscale\space mul def + /c 57.2957 r \tx@Div def + /angleA + yA y sub xA x sub atan + \psk@arcsepA c mul 2 div + \ifcase\psarc@type add \else sub \fi + def + /angleB + yB y sub xB x sub atan + \psk@arcsepB c mul 2 div + \ifcase\psarc@type sub \else add \fi + def + \ifx\psk@arrowA\@empty + \ifnum\psk@liftpen=2 + r angleA \tx@PtoC + y add exch x add exch moveto + \fi + \fi + \psarc@v + } + \gdef\psarc@type{0}% + \showpointsfalse + \end@OpenObj% +} +\def\psarcnAB{\pst@object{psarcnAB}} +\def\psarcnAB@i{\def\psarc@type{1}\psarcAB@i} +% %------------------ tvz/DG/hv (2004-05-10) begin -------------------%% % from Denis Giroux: http://www.tug.org/pipermail/pstricks/2001/000507.html % @@ -2796,7 +2894,8 @@ pop \def\pst@linetype{4}% \addto@pscode{ \pst@coor - \pst@number\pst@dimc + \ifPst@SpecialLength \pst@SpecialLength \else \pst@number\pst@dimc \fi +% \pst@number\pst@dimc \psk@dimen CLW mul sub 0 360 arc closepath }% @@ -2830,7 +2929,11 @@ pop \begin@SpecialObj \pst@@getcoor{#1}% \pssetlength\pst@dimg{#2}% - \addto@pscode{ \pst@coor \pst@number\pst@dimg \tx@SD }% + \addto@pscode{ + \pst@coor + \ifPst@SpecialLength \pst@SpecialLength \else \pst@number\pst@dimg \fi +% \pst@number\pst@dimg + \tx@SD }% \end@SpecialObj} % \def\psset@radius#1{\pst@@getlength{#1}\psk@radius} @@ -2843,21 +2946,23 @@ pop \def\pswedge{\pst@object{pswedge}} \def\pswedge@i{\@ifnextchar({\pswedge@ii}{\pswedge@ii(0,0)}} \def\pswedge@ii(#1)#2#3#4{% - \begin@ClosedObj - \pssetlength\pst@dimc{#2} - \pst@getangle{#3}\pst@tempa - \pst@getangle{#4}\pst@tempb + \begin@ClosedObj% + \pssetlength\pst@dimc{#2}% + \pst@getangle{#3}\pst@tempa% + \pst@getangle{#4}\pst@tempb% \pst@@getcoor{#1}% \def\pst@linetype{1}% - \addto@pscode{% + \addto@pscode{ \pst@coor 2 copy moveto - \pst@number\pst@dimc \psk@dimen CLW mul sub % Adjusted radius + \ifPst@SpecialLength \pst@SpecialLength \else \pst@number\pst@dimc \fi +% \pst@number\pst@dimc + \psk@dimen CLW mul sub % Adjusted radius \pst@tempa \pst@tempb arc closepath}% - \showpointsfalse + \showpointsfalse% \end@ClosedObj% } \def\tx@Ellipse{Ellipse } @@ -3046,13 +3151,13 @@ pop \def\psset@rot#1{% \pst@expandafter{\@ifnextchar*{\psset@@@rot}{\psset@@rot}}{#1}\@nil} \def\psset@@rot#1\@nil{% -\def\next##1@#1=##2@##3\@nil{% +\def\ps@next##1@#1=##2@##3\@nil{% \ifx\relax##2% \pst@getangle{#1}\psk@rot \else \def\psk@rot{##2}% \fi}% -\expandafter\next\pst@rottable @#1=\relax @\@nil} +\expandafter\ps@next\pst@rottable @#1=\relax @\@nil} \def\psset@@@rot#1#2\@nil{% \psset@@rot#2\@nil \edef\psk@rot{\pst@rotlist \ifx\psk@rot\@empty\else\psk@rot add \fi}} @@ -3094,13 +3199,13 @@ pop \def\rput@iii#1{\addto@par{rot={#1}}\@ifnextchar({\rput@iv}{\rput@iv(\z@,\z@)}} \def\rput@iv(#1){\pst@killglue\pst@makebox{\rput@v{#1}}} \def\rput@v#1{% - \begingroup - \use@par - \if@star\pst@starbox\fi - \pst@makesmall\pst@hbox - \pst@rotate\psk@rot\pst@hbox - \psput@{#1}\pst@hbox - \endgroup + \begingroup% + \use@par% + \if@star\pst@starbox\fi% + \pst@makesmall\pst@hbox% + \pst@rotate\psk@rot\pst@hbox% + \psput@{#1}\pst@hbox% + \endgroup% \ignorespaces% } \def\multirput{% @@ -3173,7 +3278,7 @@ pop \psset@labelsep{5pt} \def\psset@refangle#1{\pst@expandafter\psset@@refangle{#1}\@nil} \def\psset@@refangle#1\@nil{% -\def\next##1@#1=##2"##3@##4\@nil{% +\def\ps@next##1@#1=##2"##3@##4\@nil{% \ifx\relax##2% \pst@getangle{#1}\psk@refangle \def\psk@uputref{}% @@ -3181,7 +3286,7 @@ pop \def\psk@refangle{##2 }% \def\psk@uputref{##3}% \fi}% -\expandafter\next\pst@refangletable @#1=\relax"@\@nil} +\expandafter\ps@next\pst@refangletable @#1=\relax"@\@nil} \def\pst@refangletable{% @r=0"20% @u=90"02% @@ -3198,30 +3303,26 @@ pop % DG/SR modification end \def\uput@i#1{\addto@par{labelsep=#1}\uput@ii} \def\uput@ii[#1]{% -\addto@par{refangle={#1}}% -\@ifnextchar({\uput@iv}{\uput@iii}} + \addto@par{refangle={#1}}% + \@ifnextchar({\uput@iv}{\uput@iii}} \def\uput@iii#1{% -\addto@par{rot={#1}}% -\@ifnextchar({\uput@iv}{\uput@iv(\z@,\z@)}} + \addto@par{rot={#1}}% + \@ifnextchar({\uput@iv}{\uput@iv(\z@,\z@)}} \def\uput@iv(#1){\pst@killglue\pst@makebox{\uput@v{#1}}} \def\uput@v#1{% -\begingroup -\use@par -\if@star\pst@starbox\fi -\uput@vi -\psput@{#1}\pst@hbox -\endgroup -\ignorespaces} + \begingroup + \use@par + \if@star\pst@starbox\fi + \uput@vi + \psput@{#1}\pst@hbox + \endgroup + \ignorespaces} \def\uput@vi{% -\ifx\psk@uputref\@empty -\uput@vii\tx@UUput{}% -\else -\ifx\psk@rot\@empty -\expandafter\uput@viii\psk@uputref -\else -\uput@vii\tx@UUput{}% -\fi -\fi} + \ifx\psk@uputref\@empty\uput@vii\tx@UUput{}% + \else + \ifx\psk@rot\@empty\expandafter\uput@viii\psk@uputref + \else\uput@vii\tx@UUput{}\fi + \fi} \def\uput@vii#1#2{% \edef\pst@coor{% \pst@number\pslabelsep @@ -3299,7 +3400,6 @@ pop \psset@shift{0} % ----------- 1.10/12 end hv ------------------- % -% %------------------------------- pspicture ------------------------------ % \def\pspicture{\begingroup\pst@ifstar\pst@picture} @@ -3333,7 +3433,7 @@ pop \ifx\pst@tempA\@empty\else\psset{#1}\fi% sets the shift and grid option \ifshowgrid\psgrid[style=gridstyle]\fi% % ----------- 1.10/12 end hv ------------------- -% \ignorespaces% + \ignorespaces% % 2008-12-07 } \def\pic@coor{(0,0)(0,0)(10,10)} %\newdimen\pst@shift |