summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pstricks-add
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-01-30 21:03:57 +0000
committerKarl Berry <karl@freefriends.org>2018-01-30 21:03:57 +0000
commitd2c05b2de7a771e9d41c10ca2bd7b8db46f0e9ff (patch)
treea8c83fb519e4be9777194ab89405a653dbb7da94 /Master/texmf-dist/tex/generic/pstricks-add
parent20dc5772c5dd5e8fd6b15ab3c7d241a5cbe0fb01 (diff)
pstricks-add (30jan18)
git-svn-id: svn://tug.org/texlive/trunk@46491 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.tex60
1 files changed, 48 insertions, 12 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 40326d63171..4c276769710 100644
--- a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
+++ b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
@@ -1,4 +1,4 @@
-%% $Id: pstricks-add.tex 327 2016-09-01 18:59:35Z herbert $
+%% $Id: pstricks-add.tex 718 2018-01-30 09:11:28Z herbert $
%%
%% This is file `pstricks-add.tex',
%%
@@ -31,8 +31,8 @@
\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi
\ifx\PSTmathLoaded\endinput\else \input pst-math \fi
%
-\def\fileversion{3.84}
-\def\filedate{2017/09/16}
+\def\fileversion{3.85}
+\def\filedate{2018/01/29}
\let\pstricksaddFV\fileversion
\message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)}
%
@@ -712,6 +712,9 @@ a add
\define@key[psset]{pstricks-add}{adamsorder}{\def\psk@adamsorder{#1}}%
%\define@key[psset]{pstricks-add}{varstepincrease}{\def\psk@varstepincrease{#1}}% varrk4
%
+\define@boolkey[psset]{pstricks-add}[Pst@]{saveSumValue}[true]{}
+\psset[pstricks-add]{saveSumValue=false}
+
\define@key[psset]{pstricks-add}{StepType}{\pst@expandafter\psset@@StepType{#1}\@nil}%
\def\psset@@StepType#1#2\@nil{%
\ifx#1u\let\psk@StepType\@ne
@@ -723,19 +726,35 @@ a add
\define@boolkey[psset]{pstricks-add}[Pst@]{noVerticalLines}[true]{}%
\psset{noVerticalLines=false}
%
+\newcount\pst@stepcount
+\pst@stepcount=1
+\def\get@Letter#1;{%
+ \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or
+ K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or
+ Y\or Z\else0\fi}
+
+
\def\psStep{\def\pst@par{}\pst@object{psStep}}
\def\psStep@i(#1,#2)#3#4{%
- \begin@ClosedObj%
+ \expandafter\xdef\csname pstArea\get@Letter\the\pst@stepcount;\endcsname{undef}%
+ \IfFileExists{\jobname-area\the\pst@stepcount.tex}{\input{\jobname-area\the\pst@stepcount.tex}}{}%
+ \begin@ClosedObj
\addto@pscode{
+ \ifPst@saveSumValue
+ /AreaFile (\jobname-area\the\pst@stepcount.tex) (w) file def
+ AreaFile (\string\% Created by \string\\psStep\string\n ) writestring
+ \fi
/Func \ifPst@algebraic (#4) tx@addDict begin AlgParser end cvx \else {#4} \fi def
/x #1 def
/dx #2 #1 sub #3 div def
/scx { \pst@number\psxunit mul } def
/scy { \pst@number\psyunit mul } def
+ /Area 0 def
+%
\ifcase\psk@StepType % 0->lower, height is always f(x)
x scx 0 moveto
#3 {
- Func
+ Func dup dx mul Area add /Area ED
scy dup x scx exch \ifPst@noVerticalLines moveto \else lineto \fi
/x x dx add def
x scx exch lineto
@@ -745,11 +764,14 @@ a add
x scx 0 moveto
#3 {
/x x dx add def
- Func scy dup x dx sub scx exch
+ Func \ifPst@saveSumValue dup dx mul Area add /Area ED \fi
+ scy dup x dx sub scx exch
\ifPst@noVerticalLines moveto \else lineto \fi
x scx exch lineto
x scx 0 \ifPst@noVerticalLines moveto \else lineto \fi
} repeat
+ \ifPst@saveSumValue
+ \fi
\or % 2-> Riemann
/eps3 500 def %% increased from 100 to 500 20140507
/xMinMax [] def
@@ -761,7 +783,7 @@ a add
/Min Max def
/t x def % save x value
eps3 {
- Func
+ Func \ifPst@saveSumValue dup dx mul Area add /Area ED \fi
dup
Max lt { /Max exch def } { dup Min gt { /Min exch def }{ pop } ifelse } ifelse
/x x dt add def
@@ -781,10 +803,14 @@ a add
x yMin \ifPst@noVerticalLines moveto \else lineto \fi
closepath
} repeat
+ \ifPst@saveSumValue
+ \fi
\or % 3->inf(imum)
- x scx 0 moveto
+ x scx 0 moveto
#3 {
- \ifPst@algebraic Func \else #4 \fi /yMin ED % Max value f(x)
+ \ifPst@algebraic Func \else #4 \fi
+ \ifPst@saveSumValue dup dx mul Area add /Area ED \fi
+ /yMin ED % Max value f(x)
/xStart x def
/xEnd xStart dx add def
/DX dx 100 div def
@@ -801,9 +827,11 @@ a add
closepath x scx 0 moveto
} repeat
\or % 4-> sup(remum)
- x scx 0 moveto
+ x scx 0 moveto
#3 {
- \ifPst@algebraic Func \else #4 \fi /yMax ED % Max value f(x)
+ \ifPst@algebraic Func \else #4 \fi
+ \ifPst@saveSumValue dup dx mul Area add /Area ED \fi
+ /yMax ED % Max value f(x)
/xStart x def
/xEnd xStart dx add def
/DX dx 100 div def
@@ -820,10 +848,18 @@ a add
closepath x scx 0 moveto
} repeat
\fi
+ \ifPst@saveSumValue
+ AreaFile (\string\\gdef\string\\pstArea\get@Letter\the\pst@stepcount;\string{) writestring
+ Area 10 string cvs AreaFile exch writestring
+ AreaFile (\string}\string\n) writestring
+ AreaFile closefile
+ \fi
}%
+ \global\advance\pst@stepcount by 1
\psk@fillstyle
\pst@stroke
- \end@ClosedObj%
+ \end@ClosedObj
+ \ignorespaces
}
%
\define@key[psset]{pstricks-add}{Derive}{\def\psk@Derive{#1}}