diff options
author | Karl Berry <karl@freefriends.org> | 2007-09-06 00:04:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-09-06 00:04:41 +0000 |
commit | ead5e3fc51a4bb838c6501f0b5629ee4bdb05f1e (patch) | |
tree | 00b04f0de00e602f7f857b111019580d52ee0885 /Master/texmf-dist/tex/generic/pstricks-add | |
parent | 7bd5c6b234d7f277435ed89938e39422878e640b (diff) |
pstricks-add 2.88 (5sep07)
git-svn-id: svn://tug.org/texlive/trunk@4888 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pstricks-add')
-rw-r--r-- | Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex | 341 |
1 files changed, 180 insertions, 161 deletions
diff --git a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex index e46fd28383e..a0fc87423af 100644 --- a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex +++ b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex @@ -23,11 +23,12 @@ \ifx\PSTricksLoaded\endinput\else\input pstricks \fi \ifx\PSTplotLoaded\endinput\else \input pst-plot \fi \ifx\PSTnodesLoaded\endinput\else\input pst-node \fi +\ifx\PSTthreeDLoaded\endinput\else\input pst-3d \fi \ifx\MultidoLoaded\endinput\else \input multido \fi \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi % -\def\fileversion{2.86} -\def\filedate{2007/06/23} +\def\fileversion{2.89} +\def\filedate{2007/08/18} \message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)} % \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax @@ -197,25 +198,51 @@ \else\rput(#1){\@rmultiputArg}\fi \@ifnextchar({\rmultiput@iii}{\endgroup}% } -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% \psrotation(x,y){a}{objet} %%% -%%% construit l'image de <objet> %%% -%%% par la rotation de centre (x,y) %%% -%%% et d'angle a. %%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\psrotate{\pst@object{psrotate}} % idea from Jean-Ce Charpentier -\def\psrotate@i(#1,#2)#3#4{% + +% #1: (x,y) #2: rotAngle #3: object +\def\psrotate{\pst@object{psrotate}} +\def\psrotate@i(#1)#2{% \pst@killglue - \begin@SpecialObj% - \addto@pscode{% - #1 \pst@number\psxunit mul #2 \pst@number\psyunit mul translate - #3 rotate -1 -1 scale - #1 \pst@number\psxunit mul #2 \pst@number\psyunit mul translate - -1 -1 scale - }% - #4% - \end@SpecialObj% -} + \begingroup% + \use@par\pst@makebox{\psrotate@ii(#1){#2}}} +\def\psrotate@ii(#1)#2{% + \pst@getcoor{#1}\pst@tempA% + \pst@getangle{#2}\pst@tempB% + \leavevmode% + \pst@Verb{% + \pst@tempA /yRot ED /xRot ED + \pst@tempB dup cos /cosA ED sin /sinA ED + /ax cosA def + /by sinA def + /cx sinA neg def + /dy cosA def + /ex xRot cosA mul neg xRot add yRot sinA mul add def + /fy xRot sinA mul neg yRot add yRot cosA mul sub def + { [ax by cx dy ex fy] concat } \tx@TMChange }% + \box\pst@hbox% + \pst@Verb{\tx@TMRestore }\endgroup} +% +% [#1]: obtargs; (#2,#3): center; {#4}: factor; {#5}: object +\def\psHomothetie{\pst@object{psHomothetie}} +% make it a PStricks object: reads the optional Arguments and an +% optional star automatically. Continiue with <object>@i +\def\psHomothetie@i(#1)#2{% + \begingroup\use@par% hold all locally and set all read optional arguments + \pst@makebox{\psHomothetie@ii(#1){#2}}}% put the contents into a box + % continiue \psHomothetie@ii +\def\psHomothetie@ii(#1)#2{% + \pst@getcoor{#1}\pst@tempA% converts the coordinates without a unit into pt + % and save them in \pst@tempA, eg: 0 28.82 + \leavevmode% go into the horizontal TeX mode + \pst@Verb{ % insert the following PostScript sequence + \pst@tempA /yH ED /xH ED % cave coordinates into /yh and /xh + % ED is the same as exch def + { [#2 0 0 #2 #2 xH mul neg xH add #2 % build the transformation matrix + yH mul neg yH add] concat } \tx@TMChange }% add it to the current one + % and make it active + \box\pst@hbox% use the box + \pst@Verb{ \tx@TMRestore }% restore the old transformation matrix + \endgroup}% close the group % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Begin patch TN; Date (YY-MM-DD): 04-07-17; first part @@ -321,65 +348,63 @@ \fi% }\ignorespaces} % -\newdimen\pst@braceWidth -\define@key[psset]{pstricks-add}{braceWidth}{\pssetlength\pst@braceWidth{#1}} -\define@key[psset]{pstricks-add}{bracePos}{\def\psk@bracePos{#1}} -%\psset{braceWidth=10pt,bracePos=0.5} -% -\def\@@rput@iv(#1){\pst@killglue\pst@makebox{\@@rput@v{#1}}} -\def\@@rput@v#1{% - \begingroup% - \use@par% - \pst@makesmall\pst@hbox% - \pst@Verb{ - Alpha 90 sub \pst@number\pst@braceWidth 0 lt { 180 add } if - \ifx\psk@rot\@empty\else\psk@rot\space add \fi - /rotAngle ED - }% - \setbox\pst@hbox=\hbox{% - \pst@Verb{ rotAngle \tx@RotBegin }% - \box\pst@hbox\pst@Verb{ \tx@RotEnd }% - }% - \psput@{#1}\pst@hbox% - \endgroup% - \ignorespaces} +\define@key[psset]{pstricks-add}{braceWidth}{\pst@getlength{#1}\psk@braceWidth} +\define@key[psset]{pstricks-add}{bracePos}{\pst@checknum{#1}\psk@bracePos} +\define@key[psset]{pstricks-add}{braceWidthInner}{\pst@getlength{#1}\psk@braceWidthInner} +\define@key[psset]{pstricks-add}{braceWidthOuter}{\pst@getlength{#1}\psk@braceWidthOuter} % \def\psbrace{\pst@object{psbrace}} \def\psbrace@i(#1)(#2)#3{% - \addbefore@par{ArrowInside=-,linearc=2mm,linewidth=1pt,% - nodesepA=0pt,nodesepB=0pt,bracePos=0.5}% the default + \addbefore@par{ref=lb,linewidth=0.01pt,fillstyle=solid,fillcolor=black} \begin@SpecialObj - \use@par + \if@star\def\pst@tempC{true }\else\def\pst@tempC{false }\fi + \ifx\psk@rot\empty\def\psk@@rot{0}\else\let\psk@@rot\psk@rot\fi + \def\psk@rot{Alpha \psk@@rot\space add 90 sub}% \pst@getcoor{#1}\pst@tempA \pst@getcoor{#2}\pst@tempB - \pnode(! - /bW2 \pst@number\pst@braceWidth \pst@number\psyunit div 2.0 div def - \pst@tempA /YA exch \pst@number\psyunit div def - /XA exch \pst@number\psxunit div def - \pst@tempB /YB exch \pst@number\psyunit div def - /XB exch \pst@number\psxunit div def - /Alpha YB YA sub XB XA sub atan def - /xMid XB XA sub \psk@bracePos\space mul XA add def - /yMid YB YA sub \psk@bracePos\space mul YA add def - /@deltaX Alpha sin bW2 mul def - /@deltaY Alpha cos bW2 mul def - /@xTemp xMid @deltaX 2 mul add def - /@yTemp yMid @deltaY 2 mul sub def - @xTemp @yTemp){@tempNode}% - \pst@getcoor{@tempNode}\pst@tempC% - \@@rput@iv(! % - \pst@tempC /Yc exch def - /Xc exch def - Xc \psk@nodesepA\space add \pst@number\psxunit div - Yc \psk@nodesepB\space add \pst@number\psyunit div ){#3} - \psline(#1)% - (! XA @deltaX add YA @deltaY sub)% - (! @xTemp @deltaX sub @yTemp @deltaY add)(@tempNode)% - \psline(@tempNode)% - (! @xTemp @deltaX sub @yTemp @deltaY add)% - (! XB @deltaX add YB @deltaY sub)(#2)% - \end@SpecialObj - \ignorespaces} + \rput(! + /ifStar \pst@tempC def + /radius1 \psk@braceWidthOuter def + /radius2 \psk@braceWidthInner def + /Alpha \pst@tempA \pst@tempB 3 -1 roll sub 3 1 roll exch sub atan def + /Length \pst@tempA \pst@tempB Pyth2 def + /Left { Length \psk@bracePos\space mul } bind def + /Right { Length Left sub } bind def + /Width \psk@braceWidth def + /pop4 { pop pop pop pop } def + gsave + [ Alpha cos Alpha sin Alpha sin neg Alpha cos \pst@tempA ] concat + 0 0 moveto + 0 radius2 neg radius2 radius2 neg radius2 arcto pop4 + Left radius2 sub radius1 sub 0 rlineto + Left radius2 neg Left radius2 radius1 add neg radius1 arcto pop4 + currentpoint /y@Label ED /x@Label ED + Left radius2 neg Left radius1 add radius2 neg radius1 arcto pop4 + Right radius2 sub radius1 sub 0 rlineto + Length radius2 neg Length 0 radius2 arcto pop4 +% 0 Width neg rlineto + Length radius2 Width add neg Length radius2 sub radius2 Width add neg radius2 arcto pop4 + Right radius2 sub radius1 sub neg 0 rlineto + Left radius1 add Width radius1 add radius2 add neg radius1 90 180 arc + Left radius1 sub Width radius1 add radius2 add neg radius1 0 90 arc + Left radius2 sub radius1 sub neg 0 rlineto + radius2 Width neg radius2 270 180 arcn + 0 0 lineto + gsave + ifStar { \pst@usecolor\pslinecolor }{ \pst@usecolor\psfillcolor } ifelse fill + grestore + 0.01 setlinewidth \pst@usecolor\pslinecolor stroke + 0 0 moveto + grestore +% now calculate the label pos + /Dh radius1 radius2 add Width add def + \pst@tempA \pst@tempB 3 -1 roll sub 3 1 roll exch sub % dy dx + \psk@bracePos\space mul exch \psk@bracePos\space mul % d'x d'y + \pst@tempA 3 -1 roll add Dh Alpha cos mul sub % d'x x yA + \psk@nodesepB sub % use minus sign to shidt right + 3 1 roll add Dh Alpha sin mul add \psk@nodesepA add + exch \tx@UserCoor ){#3} + \end@SpecialObj} % % -------------- the arrow part ------------- % the original table @@ -406,6 +431,13 @@ \psset[pstricks-add]{filledveearrowangle=15} % default angle \define@key[psset]{pstricks-add}{filledveearrowlinewidth}{\pst@getlength{#1}\psk@filledveearrowlinewidth} \psset[pstricks-add]{filledveearrowlinewidth=.35mm} % default vee arrow line width +\define@key[psset]{pstricks-add}{arrowLW}{\pst@getlength{#1}\psk@arrowLW} +% arrowLW as LineWidth for the circled line ends +% +\def\psas@o{\psk@arrowLW\space dup 0 eq { pop }{ SLW } ifelse + {\pst@usecolor\psfillcolor true} false \psk@dotsize \tx@EndDot } +\@namedef{psas@*}{\psk@arrowLW\space dup 0 eq { pop }{ SLW } ifelse + {\pst@usecolor\psfillcolor false} false \psk@dotsize \tx@EndDot} \pst@def{VeeArrow}<% 1 setlinecap % round caps @@ -931,66 +963,8 @@ /VPutPos { { VPutLines } HPutCurve } def }> % -%\def\psDashColorI{black} -%\def\psDashColorII{red} -\define@key[psset]{pstricks-add}{dashColorI}{\pst@getcolor{#1}\psDashColorI} -\define@key[psset]{pstricks-add}{dashColorII}{\pst@getcolor{#1}\psDashColorII} \define@key[psset]{pstricks-add}{dashNo}{\def\psk@dashNo{#1}} -% \define@key[psset]{pstricks-add}{linecap}{\def\psk@linecap{#1}} -%\psset{dashColorI=black,dashColorII=red,dashNo=0.2,linecap=0} -% -\pst@def{LineII}<{% - NArray - /n n 1 sub def - /y1 ED /x1 ED x1 y1 ArrowA x1 y1 moveto - \psk@linecap\space 3 gt - {\psk@linecap\space 0 lt {0 setlinecap} if } - {\psk@linecap\space setlinecap} ifelse - n { - /y2 ED /x2 ED - /y0 y1 def /x0 x1 def - /linelength x2 x1 sub y2 y1 sub Pyth def - \psk@dashNo\space 1.0 lt - {/cntMax 1.0 \psk@dashNo\space div .49 add cvi def} - {/cntMax linelength \psk@dashNo\space div .49 add cvi def} ifelse - x2 x1 sub cntMax div /dx ED - y2 y1 sub cntMax div /dy ED - /cnt 0 def - cntMax { - gsave - /x1 x1 dx add def - /y1 y1 dy add def - x1 y1 - cnt 2 mod 0 eq - { \pst@usecolor\psDashColorI } - { \pst@usecolor\psDashColorII } ifelse - lineto stroke - /cnt cnt 1 add def - grestore - x1 y1 moveto - } repeat - /y1 y2 def /x1 x2 def - } repeat - x0 y0 x2 y2 ArrowB L pop pop -}> -% -\def\pslineII{\pst@object{pslineII}} -\def\pslineII@i{% - \pst@getarrows{% - \begin@OpenObj - \pst@getcoors[\pslineII@ii% - }% -} -\def\pslineII@ii{% - \addto@pscode{% - \pst@cp - \ifshowpoints true \else false \fi - \tx@LineII - }% - \end@OpenObj% -} -% \define@key[psset]{pstricks-add}{randomPoints}{\def\psk@randomPoints{#1}} \define@boolkey[psset]{pstricks-add}[Pst@]{color}[true]{} %\psset{randomPoints=1000,color=false} @@ -1066,6 +1040,12 @@ \def\psk@nodeseptypeA{1 }% \def\psk@nodeseptypeB{1 }% } +% \psGetNodeCenter defines the PS variable #1.x and #1.y, which can then +% be used by the user. #1 must be a valid node name +% +\def\psGetNodeCenter#1{ tx@NodeDict begin /N@#1 load GetCenter end % x y on stack in system coor + \pst@number\psyunit div /#1.y ED % /#1.y in user coor + \pst@number\psxunit div /#1.x ED } % /#1.x in user coor % \pst@def{NCLineII}<{ NCCoor @@ -1364,7 +1344,6 @@ \def\psvlabel#1{\psk@labelFontSize$#1$} % \define@boolkey[psset]{pstricks-add}[Pst@]{comma}[true]{} -% \define@boolkey[psset]{pstricks-add}[Pst@]{xAxis}[true]{} \define@boolkey[psset]{pstricks-add}[Pst@]{yAxis}[true]{} \define@boolkey[psset]{pstricks-add}[Pst@]{xyAxes}[true]{% @@ -1450,10 +1429,30 @@ \define@key[psset]{pstricks-add}{ylabelFactor}{\def\psk@ylabelFactor{#1}} \define@key[psset]{pstricks-add}{xlabelFactor}{\def\psk@xlabelFactor{#1}} %\psset{xlabelFactor=\relax,ylabelFactor=\relax}% -% The parameter styles for the tick lines -% (default=arrows=-,linestyle=dotted,dotsep=5pt) -%\newpsstyle{ticklinesXStyle}{arrows=-,linestyle=dotted,dotsep=5pt} -%\newpsstyle{ticklinesYStyle}{arrows=-,linestyle=dotted,dotsep=5pt} + +%% #1 : optional arguments passed to psline +%% #2 : x value +%% #3 : label +\def\psxTick{\pst@object{psxTick}}% idea by Martin Chicoine +\def\psxTick@i(#1)#2{{ + \pst@killglue + \addbefore@par{arrows=-} + \use@par + \psline(#1,\pst@xticksizeB)(#1,\pst@xticksizeA) + \rput[t](! #1 \pst@number\pslabelsep \pst@number\pst@xticksizeB add + \pst@number\psyunit div neg ){\vphantom{1}#2}}\ignorespaces} +% +%% #1 : optional arguments passed to psline +%% #2 : y value +%% #3 : label +\def\psyTick{\pst@object{psyTick}}% idea by Martin Chicoine +\def\psyTick@i(#1)#2{{ + \pst@killglue + \addbefore@par{arrows=-} + \use@par + \psline(\pst@yticksizeB,#1)(\pst@yticksizeA,#1) + \rput[r]{0}(!\pst@number\pst@yticksizeB \pst@number\pslabelsep add + \pst@number\psxunit div neg #1){#2}}\ignorespaces} % % %% #1 integer @@ -1539,8 +1538,14 @@ \def\psaxes@i{\pst@getarrows\psaxes@ii} \def\psaxes@ii(#1){\@ifnextchar({\psaxes@iii(#1)}{\psaxes@iv(0,0)(0,0)(#1)}} \def\psaxes@iii(#1)(#2){\@ifnextchar({\psaxes@iv(#1)(#2)}{\psaxes@iv(#1)(#1)(#2)}} +\def\psaxes@iv(#1)(#2)(#3){\@ifnextchar[{\psaxes@v(#1)(#2)(#3)}{\psaxes@vii(#1)(#2)(#3)}}% +\def\psaxes@v(#1)(#2)(#3)[#4]{\@ifnextchar[{\psaxes@vi(#1)(#2)(#3)[#4]}{\psaxes@vi(#1)(#2)(#3)[#4][]}}% +\def\psaxes@v(#1)(#2)(#3)[#4,#5][#6,#7]{% + \psaxes@vii(#1)(#2)(#3)% + \uput[#5](#3|0,0){#4}\uput[#7](0,0|#3){#6}% +} % -\def\psaxes@iv(#1,#2)(#3,#4)(#5,#6){% +\def\psaxes@vii(#1,#2)(#3,#4)(#5,#6){% \pst@killglue% \begingroup% \setbox\pst@hbox=\hbox\bgroup% @@ -2646,6 +2651,9 @@ } % \define@key[psset]{pstricks-add}{Derive}{\def\psk@Derive{#1}}% +\define@boolkey[psset]{pstricks-add}[PST@]{Tnormal}[true]{} + +\psset[pstricks-add]{CMYK=true} \def\@NOTEMPTY{NOT@EMPTY}%%dr 0606 % %% #1 : x value @@ -2682,7 +2690,7 @@ translate % define the temporary origin % now we calculate the slope of the tangent \ifx\psk@Derive\@empty% de we have a derivation defined? - #1 abs 1.0e-6 lt % no, we choose secant for the tangent + #1 abs 1.0e-6 lt % no, we choose secant for the tangent { #1 0.0005 add dup /x ED /t ED tx@addDict begin mark F@pstplot end counttomark 1 gt % test, if we have parametricplot { /y2 ED /x2 ED } % we have 2 values { \ifPst@polarplot dup x \ifPst@algebraic RadtoDeg \fi @@ -2716,14 +2724,20 @@ x \ifPst@algebraic RadtoDeg \fi cos Fphi mul y0 sub /x ED \else /y ED /x 1 def \fi } ifelse cleartomark - y \pst@number\psyunit mul x \pst@number\psxunit mul Atan + y \pst@number\psyunit mul x \pst@number\psxunit mul Atan \ifPST@Tnormal 90 add \fi % y ATAN1 % we have the slope angle of the tangent. ATAN is defined int the pstricks.pro, patch 6 \fi rotate % rotate, depending to the origin /Lineto /lineto load def [ - -#2 \pst@number\psxunit mul 0 % moveto - #2 \pst@number\psxunit mul 0 % lineto + \ifPST@Tnormal + 0 0 % moveto + #2 + y \pst@number\psyunit mul x \pst@number\psxunit mul Atan 90 add cos div \pst@number\psxunit mul 0 % lineto + \else + -#2 \pst@number\psxunit mul 0 % moveto + #2 \pst@number\psxunit mul 0 % lineto + \fi \pst@cp % kill the currentpoint, if any false % don't show the points \tx@Line @@ -3022,29 +3036,35 @@ \psset[pstricks-add]{% transpalpha=1, hooklength=3mm, hookwidth=1mm, - ArrowFill=true,% - ArrowInside={}, ArrowInsidePos=0.5,% + ArrowFill=true, + ArrowInside={}, ArrowInsidePos=0.5, ArrowInsideNo=1, ArrowInsideOffset=0, - dashColorI=black,dashColorII=red,dashNo=0.2,linecap=0,% - xyAxes=true,% - trigLabels=false,trigLabelBase=0,% - xDecimals={},yDecimals={},% - xlogBase={},ylogBase={},% - logLines=none,% - ignoreLines=0,% - nStep=1,nStart=0,nEnd={},% - xStep=0,yStep=0,xStart={},xEnd={},yStart={},yEnd={},comma=false,% - plotNo=1,plotNoMax=1,% - xAxisLabel=x,yAxisLabel=y,% - yAxisLabelPos={},xAxisLabelPos={},% + arrowLW=0, + dashNo=0.2,linecap=0, + xyAxes=true, + trigLabels=false,trigLabelBase=0, + xDecimals={},yDecimals={}, + xlogBase={},ylogBase={}, + logLines=none, + ignoreLines=0, + nStep=1,nStart=0,nEnd={}, + xStep=0,yStep=0,xStart={},xEnd={},yStart={},yEnd={},comma=false, + plotNo=1,plotNoMax=1, + xAxisLabel=x,yAxisLabel=y, + yAxisLabelPos={},xAxisLabelPos={}, llx=\z@, lly=\z@, urx=\z@, ury=\z@,% prevents rounding errors - randomPoints=1000,color=false,% - method={},whichabs={},whichord={},% + randomPoints=1000,color=false, + method={},whichabs={},whichord={}, plotfuncx={},plotfuncy={},buildvector=false, % algebraic=false, % indivisuelly set - Derive={},adamsorder=4,% - VarStep=false, PlotDerivative=none, VarStepEpsilon=default,% - varsteptol=.001% + Derive={},adamsorder=4, + VarStep=false, PlotDerivative=none, VarStepEpsilon=default, + varsteptol=.001, + Tnormal=false, + braceWidth=2\pslinewidth, + bracePos=0.5, + braceWidthInner=10\pslinewidth, + braceWidthOuter=10\pslinewidth } \psset{% %%%% pstricks %%%%%%%% @@ -3102,7 +3122,6 @@ showorigin=true,% axesstyle=axes,% ChangeOrder=false,% - braceWidth=0.35,bracePos=0.5,% arrowscale=1,% %%%%%%%%% pst-node %%%%%%%%%% lineAngle=0, |