diff options
Diffstat (limited to 'Master/texmf-dist/dvips/pstricks/pstricks.pro')
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pstricks.pro | 189 |
1 files changed, 137 insertions, 52 deletions
diff --git a/Master/texmf-dist/dvips/pstricks/pstricks.pro b/Master/texmf-dist/dvips/pstricks/pstricks.pro index 12b81d67af3..73e4f2a9dc7 100644 --- a/Master/texmf-dist/dvips/pstricks/pstricks.pro +++ b/Master/texmf-dist/dvips/pstricks/pstricks.pro @@ -1,16 +1,22 @@ -% $Id: pstricks.pro 10 2008-01-18 13:31:24Z herbert $ +% $Id: pstricks.pro 21 2008-04-18 13:40:08Z herbert $ % -% PostScript prologue for pstricks.tex. -% Version 1.03, 2008/01/01 -% For distribution and copyright, see pstricks.tex. +%% PostScript prologue for pstricks.tex. +%% Version 1.03, 2008/04/15 +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN archives +%% in directory macros/latex/base/lppl.txt. % % +% Define the follwing gs-functions if not known, eg when using distiller +% systemdict /.setopacityalpha known not {/.setopacityalpha { pop } def } if systemdict /.setblendmode known not {/.setblendmode { pop } def } if systemdict /.setshapealpha known not {/.setshapealpha { pop } def } if % -/tx@Dict 200 dict def tx@Dict begin -/ADict 25 dict def +/tx@Dict 200 dict def % the main PSTricks dictionary +tx@Dict begin +/ADict 25 dict def % The arrow dictionaray /CM { matrix currentmatrix } bind def /SLW /setlinewidth load def /CLW /currentlinewidth load def @@ -46,16 +52,22 @@ systemdict /.setshapealpha known not {/.setshapealpha { pop } def } if /TwoPi 6.28318530718 def /Euler 2.71828182846 def %/e Euler bind def -/RadtoDeg { 180 mul Pi div } bind def % convert from radian to degrees -/DegtoRad { Pi mul 180 div } bind def % viceversa +/RadtoDeg { 180 mul Pi div } bind def % convert from radian to degrees +/DegtoRad { Pi mul 180 div } bind def % viceversa %----------------- hv end--------------------------- /PathLength@ { /z z y y1 sub x x1 sub Pyth add def /y1 y def /x1 x def } def -/PathLength { flattenpath /z 0 def - { /y1 ED /x1 ED /y2 y1 def /x2 x1 def - }{ /y ED /x ED PathLength@ } {} { /y y2 def /x x2 def PathLength@ } - /pathforall load stopped { pop pop pop pop } if z } def -/STP { .996264 dup scale } def -/STV { SDict begin normalscale end STP } def +/PathLength { + flattenpath /z 0 def + { /y1 ED /x1 ED /y2 y1 def /x2 x1 def } + { /y ED /x ED PathLength@ } + {} + { /y y2 def /x x2 def PathLength@ } + /pathforall load stopped { pop pop pop pop } if + z +} def +% +/STP { .996264 dup scale } def % BP/PT scaling +/STV { SDict begin normalscale end STP } def % % %%-------------- DG begin patch 15 ---------------%% %/DashLine { dup 0 gt { /a .5 def PathLength exch div } { pop /a 1 def @@ -143,7 +155,8 @@ systemdict /.setshapealpha known not {/.setshapealpha { pop } def } if %pop pop } def %% DG/SR modification end % -/BeginArrow { ADict begin +/BeginArrow { + ADict begin % hold it local, for end see EndArrow /@mtrx CM def gsave 2 copy T @@ -152,7 +165,7 @@ systemdict /.setshapealpha known not {/.setshapealpha { pop } def } if rotate newpath } def % -/EndArrow { @mtrx setmatrix CP grestore end } def +/EndArrow { @mtrx setmatrix CP grestore end } def % end the ADict % /Arrow { CLW mul add dup @@ -232,6 +245,7 @@ systemdict /.setshapealpha known not {/.setshapealpha { pop } def } if n eq not { exch pop } if showpoints { ] aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse } def +% /Line { NArray n 0 eq not { n 1 eq { 0 0 /n 2 def } if ArrowA /n n 2 sub def @@ -239,8 +253,14 @@ systemdict /.setshapealpha known not {/.setshapealpha { pop } def } if CP 4 2 roll ArrowB L pop pop } if } def -/Arcto { /a [ 6 -2 roll ] cvx def a r /arcto load stopped { 5 } { 4 } - ifelse { pop } repeat a } def +% +/Arcto { + /a [ 6 -2 roll ] cvx def + a r + /arcto load stopped { 5 } { 4 } ifelse { pop } repeat + a +} def +% /CheckClosed { dup n 2 mul 1 sub index eq 2 index n 2 mul 1 add index eq and { pop pop /n n 1 sub def } if } def /Polygon { NArray n 2 eq { 0 0 /n 3 def } if n 3 lt { n { pop pop } @@ -277,36 +297,71 @@ d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx % setmatrix } def setmatrix pop } def % DG/SR modification end -/CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth -def } def -/CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth -def } def -/CC { /l0 l1 def /x1 x dx sub def /y1 y dy sub def /dx0 dx1 def /dy0 dy1 -def CCA /dx dx0 l1 c exp mul dx1 l0 c exp mul add def /dy dy0 l1 c exp -mul dy1 l0 c exp mul add def /m dx0 dy0 Atan dx1 dy1 Atan sub 2 div cos -abs b exp a mul dx dy Pyth Div 2 div def /x2 x l0 dx mul m mul sub def -/y2 y l0 dy mul m mul sub def /dx l1 dx mul m mul neg def /dy l1 dy mul -m mul neg def } def -/IC { /c c 1 add def c 0 lt { /c 0 def } { c 3 gt { /c 3 def } if } -ifelse /a a 2 mul 3 div 45 cos b exp div def CCA /dx 0 def /dy 0 def } -def +% +/CCA { + /y ED /x ED + 2 copy y sub /dy1 ED + x sub /dx1 ED + /l1 dx1 dy1 Pyth def +} def +% +/CC { + /l0 l1 def + /x1 x dx sub def + /y1 y dy sub def + /dx0 dx1 def + /dy0 dy1 def + CCA + /dx dx0 l1 c exp mul dx1 l0 c exp mul add def + /dy dy0 l1 c exp mul dy1 l0 c exp mul add def + /m dx0 dy0 Atan dx1 dy1 Atan sub 2 div cos abs b exp a mul dx dy Pyth Div 2 div def + /x2 x l0 dx mul m mul sub def + /y2 y l0 dy mul m mul sub def + /dx l1 dx mul m mul neg def + /dy l1 dy mul m mul neg def +} def +% +/IC { + /c c 1 add def + c 0 lt { /c 0 def } { c 3 gt { /c 3 def } if } ifelse + /a a 2 mul 3 div 45 cos b exp div def + CCA + /dx 0 def + /dy 0 def +} def +% /BOC { IC CC x2 y2 x1 y1 ArrowA CP 4 2 roll x y curveto } def /NC { CC x1 y1 x2 y2 x y curveto } def /EOC { x dx sub y dy sub 4 2 roll ArrowB 2 copy curveto } def /BAC { IC CC x y moveto CC x1 y1 CP ArrowA } def /NAC { x2 y2 x y curveto CC x1 y1 } def /EAC { x2 y2 x y ArrowB curveto pop pop } def +% /OpenCurve { NArray n 3 lt { n { pop pop } repeat } { BOC /n n 3 sub def n { NC } repeat EOC } ifelse } def -/AltCurve { { false NArray n 2 mul 2 roll [ n 2 mul 3 sub 1 roll ] aload -/Points ED n 2 mul -2 roll } { false NArray } ifelse n 4 lt { n { pop -pop } repeat } { BAC /n n 4 sub def n { NAC } repeat EAC } ifelse } def -/ClosedCurve { NArray n 3 lt { n { pop pop } repeat } { n 3 gt { -CheckClosed } if 6 copy n 2 mul 6 add 6 roll IC CC x y moveto n { NC } -repeat closepath pop pop } ifelse } def +% +/AltCurve { + { false NArray n 2 mul 2 roll + [ n 2 mul 3 sub 1 roll ] aload + /Points ED + n 2 mul -2 roll } + { false NArray } ifelse + n 4 lt { n { pop pop } repeat } { BAC /n n 4 sub def n { NAC } repeat EAC } ifelse +} def +% +/ClosedCurve { + NArray n 3 lt + { n { pop pop } repeat } + { n 3 gt { CheckClosed } if + 6 copy n 2 mul 6 add 6 roll + IC CC x y moveto n { NC } repeat + closepath pop pop + } ifelse +} def +% /SQ { /r ED r r moveto r r neg L r neg r neg L r neg r L fill } def /ST { /y ED /x ED x y moveto x neg y L 0 x L fill } def /SP { /r ED gsave 0 r moveto 4 { 72 rotate 0 r L } repeat fill grestore } @@ -324,21 +379,51 @@ ifelse } def /Frame { CLW mul /a ED 3 -1 roll 2 copy gt { exch } if a sub /y2 ED a add /y1 ED 2 copy gt { exch } if a sub /x2 ED a add /x1 ED 1 index 0 eq { pop pop Rect } { OvalFrame } ifelse } def -/BezierNArray { /f ED counttomark 2 div dup cvi /n ED n eq not { exch pop -} if n 1 sub neg 3 mod 3 add 3 mod { 0 0 /n n 1 add def } repeat f { ] -aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse } def -/OpenBezier { BezierNArray n 1 eq { pop pop } { ArrowA n 4 sub 3 idiv { 6 -2 roll 4 2 roll curveto } repeat 6 2 roll 4 2 roll ArrowB curveto } -ifelse } def -/ClosedBezier { BezierNArray n 1 eq { pop pop } { moveto n 1 sub 3 idiv { -6 2 roll 4 2 roll curveto } repeat closepath } ifelse } def -/BezierShowPoints { gsave Points aload length 2 div cvi /n ED moveto n 1 -sub { lineto } repeat CLW 2 div SLW [ 4 4 ] 0 setdash stroke grestore } -def -/Parab { /y0 exch def /x0 exch def /y1 exch def /x1 exch def /dx x0 x1 -sub 3 div def /dy y0 y1 sub 3 div def x0 dx sub y0 dy add x1 y1 ArrowA -x0 dx add y0 dy add x0 2 mul x1 sub y1 ArrowB curveto /Points [ x1 y1 x0 -y0 x0 2 mul x1 sub y1 ] def } def +% +/BezierNArray { + /f ED + counttomark 2 div dup cvi /n ED + n eq not { exch pop } if + n 1 sub neg 3 mod 3 add 3 mod { 0 0 /n n 1 add def } repeat + f { ] aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse +} def +% +/OpenBezier { + BezierNArray + n 1 eq + { pop pop } + { ArrowA n 4 sub 3 idiv + { 6 2 roll 4 2 roll curveto } repeat + 6 2 roll 4 2 roll ArrowB curveto } ifelse +} def +% +/ClosedBezier { + BezierNArray + n 1 eq + { pop pop } + { moveto n 1 sub 3 idiv + { 6 2 roll 4 2 roll curveto } repeat + closepath } ifelse +} def +% +/BezierShowPoints { + gsave + Points aload length 2 div cvi /n ED + moveto + n 1 sub { lineto } repeat + CLW 2 div SLW [ 4 4 ] 0 setdash stroke + grestore +} def +% +/Parab { + /y0 ED /x0 ED /y1 ED /x1 ED + /dx x0 x1 sub 3 div def + /dy y0 y1 sub 3 div def + x0 dx sub y0 dy add x1 y1 ArrowA + x0 dx add y0 dy add x0 2 mul x1 sub y1 ArrowB + curveto + /Points [ x1 y1 x0 y0 x0 2 mul x1 sub y1 ] def +} def % /Grid { newpath |