texlive[46491] Master/texmf-dist: pstricks-add (30jan18)

commits+karl at tug.org commits+karl at tug.org
Tue Jan 30 22:03:58 CET 2018


Revision: 46491
          http://tug.org/svn/texlive?view=revision&revision=46491
Author:   karl
Date:     2018-01-30 22:03:57 +0100 (Tue, 30 Jan 2018)
Log Message:
-----------
pstricks-add (30jan18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/pstricks-add/Changes
    trunk/Master/texmf-dist/doc/generic/pstricks-add/data/demo3.data
    trunk/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.bib
    trunk/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf
    trunk/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex
    trunk/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
    trunk/Master/texmf-dist/tex/latex/pstricks-add/pstricks-add.sty

Modified: trunk/Master/texmf-dist/doc/generic/pstricks-add/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pstricks-add/Changes	2018-01-30 21:03:40 UTC (rev 46490)
+++ trunk/Master/texmf-dist/doc/generic/pstricks-add/Changes	2018-01-30 21:03:57 UTC (rev 46491)
@@ -1,4 +1,4 @@
-%% $Id: Changes 555 2017-09-18 06:19:41Z herbert $
+%% $Id: Changes 716 2018-01-29 22:19:16Z herbert $
 %%
 pstricks-add.pro ----------- 
 0.23 2009-12-17 - add RGBtoGRAY and WavelengthToGRAY
@@ -39,6 +39,7 @@
 
 
 pstricks-add.tex ----------- (hv)
+ v 3.85  2018-01-29 - added area computing for \psStep
  v 3.84  2017-09-16 - added \psRandomPointsArea
  v 3.83a 2017-08-24 - updated documentation
  v 3.83  2017-05-10 - use the star version for \psChar if no extra

Modified: trunk/Master/texmf-dist/doc/generic/pstricks-add/data/demo3.data
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pstricks-add/data/demo3.data	2018-01-30 21:03:40 UTC (rev 46490)
+++ trunk/Master/texmf-dist/doc/generic/pstricks-add/data/demo3.data	2018-01-30 21:03:57 UTC (rev 46491)
@@ -1,13 +1,13 @@
-  1989 3.08
-  1990 3.1
+1989 3.08
+  1990 3.10
   1991 3.08
   1992 3.21
-  1993 5.0
+  1993 5.00
   1994 2.27
   1995 3.53
-  1996 3.8
-  1997 2.8
+  1996 3.80
+  1997 2.80
   1998 4.15
   1999 3.32
-  2000 1.4
+  2000 1.40
   2001 2.46

Modified: trunk/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.bib
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.bib	2018-01-30 21:03:40 UTC (rev 46490)
+++ trunk/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.bib	2018-01-30 21:03:57 UTC (rev 46491)
@@ -1,4 +1,3 @@
-%% -*-bibtex-*-
 @STRING{tugboat	= {TUGboat} }
 @STRING{beiprogramm	= {{\TeX}-Beiprogramm} }
 @STRING{bretter	= {Bretter, die die Welt bedeuten} }
@@ -15,7 +14,7 @@
 @STRING{theatertage	= {{\TeX}-Theatertage} }
 
 @Book{PSTricks2,
-  author	= {Herbert Vo\ss},
+  author	= {Herbert Voß},
   title		= {{\PST} {G}rafik f\"ur \TeX{} und \LaTeX},
   edition	= {7},
   publisher	= {DANTE -- Lehmanns},
@@ -24,7 +23,7 @@
 }
 
 @Book{PSTricks-E,
-  author	= {Herbert Vo\ss},
+  author	= {Herbert Voß},
   title		= {{\PST} {G}raphics for \LaTeX},
   edition	= {1},
   publisher	= {UIT},
@@ -58,7 +57,7 @@
   address	= {London}
 }
 @Article{	  dtk02.2:jackson.voss:plot-funktionen,
-  author	= {Laura E. Jackson and Herbert Vo{\ss}},
+  author	= {Laura E. Jackson and Herbert Voß},
   title		= {Die Plot-Funktionen von {\texttt{pst-plot}}},
   journal	= dtk,
   year		= 2002,
@@ -78,7 +77,7 @@
 }
 
 @Article{	  dtk02.1:voss:mathematischen,
-  author	= {Herbert Vo{\ss}},
+  author	= {Herbert Voß},
   title		= {Die mathematischen {F}unktionen von {P}ost{S}cript},
   journal	= dtk,
   year		= 2002,
@@ -92,7 +91,7 @@
   abstract	= { \PS, faktisch genauso alt wie {\TeX}, ist im
 		  Verh{\"a}ltnis dazu allgemein noch weniger bekannt, wenn es
 		  darum geht zu beurteilen, was es denn nun im eigentlichen
-		  Sinne ist. Au{\ss}erdem wird h{\"a}ufig vergessen, dass
+		  Sinne ist. Außerdem wird h{\"a}ufig vergessen, dass
 		  sich mit den \PS-Funktionen viele Dinge erledigen lassen,
 		  bei denen sonst auf externe Programme zur{\"u}ckgegriffen
 		  wird. Dies wird im Folgenden f{\"u}r die mathematischen
@@ -101,7 +100,7 @@
 }
 
 @Book{tlgc2,
-  author	= {Michel Goosens and Frank Mittelbach and Sebastian Rahtz and Denis Roegel and Herbert Vo{\ss}},
+  author	= {Michel Goosens and Frank Mittelbach and Sebastian Rahtz and Denis Roegel and Herbert Voß},
   title		= {The {\LaTeX} {G}raphics {C}ompanion},
   publisher	= {{Addison-Wesley Publishing Company}},
   edition	= 2,

Modified: trunk/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex	2018-01-30 21:03:40 UTC (rev 46490)
+++ trunk/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex	2018-01-30 21:03:57 UTC (rev 46491)
@@ -1,7 +1,7 @@
-%% $Id: pstricks-add-doc.tex 333 2016-09-01 19:36:09Z herbert $
+%% $Id: pstricks-add-doc.tex 718 2018-01-30 09:11:28Z herbert $
 %
-\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings,
-    headexclude,footexclude,oneside]{pst-doc}
+\documentclass[11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,headings=small,
+    headinclude=false,footinclude=false,oneside]{pst-doc}
 \listfiles
 \usepackage{biblatex}
 \addbibresource{pstricks-add-doc.bib}
@@ -83,7 +83,7 @@
 you have installed \LPack{pst-xkey} which is part of the
 \LPack{xkeyval}-package, and that all packages that use the old
 keyval interface are loaded \textbf{before} the
-\LPack{xkeyval}.\cite{xkeyval}
+\LPack{xkeyval}.
 \item the option \Lkeyword{tickstyle} from \LPack{pst-plot} is no longer supported; use \Lkeyword{ticksize} instead.
 \item the option \Lkeyword{xyLabel} is no longer supported; use the option \Lkeyword{labelFontSize} instead.
 \item if \LPack{pstricks-add} is loaded together with the package  \LPack{pst-func} then  \Lkeyword{InsideArrow}
@@ -1616,7 +1616,7 @@
 with \Lkeyword{lower} as the default setting. The syntax of the function is
 
 \begin{BDef}
-\Lcs{psStep}\OptArgs\Largr(x1,x2)\Largb{n}\Largb{function}
+\Lcs{psStep}\OptArgs\Largr{$x1,x2$}\Largb{n}\Largb{function}
 \end{BDef}
 
 %$
@@ -1649,6 +1649,9 @@
 \end{pspicture}
 \end{LTXexample}
 
+
+
+
 \begin{LTXexample}[pos=t,preset=\centering]
 \psset{yunit=1.25cm,plotpoints=200}
 \begin{pspicture}(-0.5,-1.5)(10,1.5)
@@ -1691,6 +1694,7 @@
 \end{pspicture}
 \end{LTXexample}
 
+
 There is also an optional argument \Lkeyword{noVerticalLines} which suppresses all
 vertical lines of the step function in the output.
 
@@ -1778,7 +1782,71 @@
 \fi
 
 
+
+
+With setting the optional argument \Lkeyword{saveSumValue} 
+it is possible to calculate the area under the rectangles. The value is saved in a macro \Lcs{pstAreaA},
+for the next call of \Lcs{psStep} in the macro \Lcs{pstAreaB} and so on. The values are calculated
+on PostScript level, the reason why two \LaTeX\ runs are needed. for every \Lcs{psStep} there will
+be an external file \verb|\jobname-area#.tex| which has the definition of the macros \nxLcs{pstArea?}.
+In this documentation the following \Lcs{psStep} is the 10th call of this function, the reason
+why we have to choose \Lcs{pstAreaJ} and so on:
+
 \clearpage
+
+%\begin{LTXexample}[pos=t,preset=\centering]
+\psset{plotpoints=200}%
+\begin{pspicture}(-0.5,-2.25)(10,3)
+\psaxes[labelFontSize=\scriptstyle]{->}(0,0)(0,-2.25)(10,3)%
+\psplot[linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)*sin(x)}%
+\psset{linewidth=0.5pt}%
+\psStep[algebraic,linecolor=magenta,StepType=upper,saveSumValue](0,9){20}{sqrt(x)*sin(x)}%
+\rput[l](0.2,2.5){\textcolor{magenta}{Uppersum: \pstAreaJ}}%
+\psStep[algebraic,linecolor=blue,saveSumValue](0,9){20}{sqrt(x)*sin(x)}%
+\rput[l](0.2,2){\textcolor{blue}{Lowersum: \pstAreaK}}%
+\end{pspicture}
+%\end{LTXexample}
+
+\begin{lstlisting}
+\psset{plotpoints=200}%
+\begin{pspicture}(-0.5,-2.25)(10,3)
+\psaxes[labelFontSize=\scriptstyle]{->}(0,0)(0,-2.25)(10,3)%
+\psplot[linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)*sin(x)}%
+\psset{linewidth=0.5pt}%
+\psStep[algebraic,linecolor=magenta,StepType=upper,saveSumValue](0,9){20}{sqrt(x)*sin(x)}%
+\rput[l](0.2,2.5){\textcolor{magenta}{Uppersum: \pstAreaJ}}%
+\psStep[algebraic,linecolor=blue,saveSumValue](0,9){20}{sqrt(x)*sin(x)}%
+\rput[l](0.2,2){\textcolor{blue}{Lowersum: \pstAreaK}}%
+\end{pspicture}
+\end{lstlisting}
+
+
+%\begin{LTXexample}[pos=t,preset=\centering]
+\psset{plotpoints=200}%
+\begin{pspicture}(-0.5,-2.25)(10,3)
+\psaxes[labelFontSize=\scriptstyle]{->}(0,0)(0,-2.25)(10,3)%
+\psplot[linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)*sin(x)}%
+\psset{linewidth=0.1pt}%
+\psStep[algebraic,linecolor=magenta,StepType=upper,saveSumValue](0,9){100}{sqrt(x)*sin(x)}%
+\rput[l](0.2,2.5){\textcolor{magenta}{Uppersum: \pstAreaL}}%
+\psStep[algebraic,linecolor=blue,saveSumValue](0,9){100}{sqrt(x)*sin(x)}%
+\rput[l](0.2,2){\textcolor{blue}{Lowersum: \pstAreaM}}%
+\end{pspicture}
+%\end{LTXexample}
+
+\begin{lstlisting}
+\psset{plotpoints=200}%
+\begin{pspicture}(-0.5,-2.25)(10,3)
+\psaxes[labelFontSize=\scriptstyle]{->}(0,0)(0,-2.25)(10,3)%
+\psplot[linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)*sin(x)}%
+\psset{linewidth=0.1pt}%
+\psStep[algebraic,linecolor=magenta,StepType=upper,saveSumValue](0,9){100}{sqrt(x)*sin(x)}%
+\rput[l](0.2,2.5){\textcolor{magenta}{Uppersum: \pstAreaL}}%
+\psStep[algebraic,linecolor=blue,saveSumValue](0,9){100}{sqrt(x)*sin(x)}%
+\rput[l](0.2,2){\textcolor{blue}{Lowersum: \pstAreaM}}%
+\end{pspicture}
+\end{lstlisting}
+\clearpage
 %--------------------------------------------------------------------------------------
 
 \section{Tangent lines}
@@ -3379,7 +3447,7 @@
 \end{center}
 \egroup
 
-\begin{lstlisting}[label={fig:aiglelapin},xrightmargin=-1.5cm]
+\begin{lstlisting}[label={fig:aiglelapin2},xrightmargin=-1.5cm]
 \def\InitCond{ 0 10 10}%% xa ya xl
 \def\Faiglelapin{\Vaigle*(y[2]-y[0])/sqrt(y[1]^2+(y[2]-y[0])^2)|%
                  -\Vaigle*y[1]/sqrt(y[1]^2+(y[2]-y[0])^2)|%

Modified: trunk/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex	2018-01-30 21:03:40 UTC (rev 46490)
+++ trunk/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex	2018-01-30 21:03:57 UTC (rev 46491)
@@ -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 @@
 \define at key[psset]{pstricks-add}{adamsorder}{\def\psk at adamsorder{#1}}% 
 %\define at key[psset]{pstricks-add}{varstepincrease}{\def\psk at varstepincrease{#1}}% varrk4
 %
+\define at boolkey[psset]{pstricks-add}[Pst@]{saveSumValue}[true]{}
+\psset[pstricks-add]{saveSumValue=false}
+
 \define at key[psset]{pstricks-add}{StepType}{\pst at expandafter\psset@@StepType{#1}\@nil}%
 \def\psset@@StepType#1#2\@nil{%
   \ifx#1u\let\psk at StepType\@ne
@@ -723,19 +726,35 @@
 \define at boolkey[psset]{pstricks-add}[Pst@]{noVerticalLines}[true]{}%
 \psset{noVerticalLines=false}
 %
+\newcount\pst at stepcount 
+\pst at stepcount=1
+\def\get at 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 at par{}\pst at object{psStep}}
 \def\psStep at i(#1,#2)#3#4{%
-  \begin at ClosedObj%
+  \expandafter\xdef\csname pstArea\get at Letter\the\pst at stepcount;\endcsname{undef}%
+  \IfFileExists{\jobname-area\the\pst at stepcount.tex}{\input{\jobname-area\the\pst at stepcount.tex}}{}%
+  \begin at ClosedObj
   \addto at pscode{
+    \ifPst at saveSumValue
+      /AreaFile (\jobname-area\the\pst at stepcount.tex) (w) file def
+      AreaFile (\string\% Created by \string\\psStep\string\n ) writestring 
+    \fi
     /Func \ifPst at algebraic (#4) tx at addDict begin AlgParser end cvx \else {#4} \fi def 
     /x #1  def
     /dx #2 #1 sub #3 div def
     /scx { \pst at number\psxunit mul } def 
     /scy { \pst at number\psyunit mul } def
+    /Area 0 def
+%
     \ifcase\psk at 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 at noVerticalLines  moveto \else lineto \fi
         /x x dx add def
         x scx exch lineto 
@@ -745,11 +764,14 @@
       x scx 0 moveto 
       #3 {
         /x x dx add def
-        Func scy dup x dx sub scx exch 
+        Func \ifPst at saveSumValue dup dx mul Area add /Area ED \fi
+        scy dup x dx sub scx exch 
         \ifPst at noVerticalLines  moveto \else lineto \fi
         x scx exch lineto
         x scx 0 \ifPst at noVerticalLines  moveto \else lineto \fi
       } repeat
+      \ifPst at saveSumValue      
+      \fi
     \or % 2-> Riemann
       /eps3 500 def   %% increased  from 100 to 500 20140507
       /xMinMax [] def
@@ -761,7 +783,7 @@
         /Min Max def 
 	/t x def % save x value
 	eps3 {
-	  Func  
+          Func \ifPst at 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 @@
 	x yMin \ifPst at noVerticalLines moveto \else lineto \fi 
 	closepath 
       } repeat
+      \ifPst at saveSumValue      
+      \fi
     \or % 3->inf(imum)
-        x scx 0 moveto 
+      x scx 0 moveto 
       #3 {
-        \ifPst at algebraic Func \else #4 \fi /yMin ED % Max value f(x)
+        \ifPst at algebraic Func \else #4 \fi 
+        \ifPst at 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 @@
 	closepath  x scx 0 moveto 
       } repeat
     \or % 4-> sup(remum)
-        x scx 0 moveto 
+      x scx 0 moveto 
       #3 {
-        \ifPst at algebraic Func \else #4 \fi /yMax ED % Max value f(x)
+        \ifPst at algebraic Func \else #4 \fi 
+        \ifPst at 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 @@
 	closepath x scx 0 moveto 
       } repeat
     \fi
+    \ifPst at saveSumValue
+      AreaFile (\string\\gdef\string\\pstArea\get at Letter\the\pst at stepcount;\string{) writestring
+      Area 10 string cvs AreaFile exch writestring
+      AreaFile (\string}\string\n) writestring
+      AreaFile closefile
+    \fi
   }%
+  \global\advance\pst at stepcount by 1
   \psk at fillstyle
   \pst at stroke
-  \end at ClosedObj%
+  \end at ClosedObj
+  \ignorespaces
 }
 %
 \define at key[psset]{pstricks-add}{Derive}{\def\psk at Derive{#1}}

Modified: trunk/Master/texmf-dist/tex/latex/pstricks-add/pstricks-add.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pstricks-add/pstricks-add.sty	2018-01-30 21:03:40 UTC (rev 46490)
+++ trunk/Master/texmf-dist/tex/latex/pstricks-add/pstricks-add.sty	2018-01-30 21:03:57 UTC (rev 46491)
@@ -1,4 +1,4 @@
-%% $Id: pstricks-add.sty 37 2014-07-22 13:52:12Z herbert $
+%% $Id: pstricks-add.sty 718 2018-01-30 09:11:28Z herbert $
 %
 \RequirePackage{pstricks}
 \RequirePackage{pst-plot}
@@ -6,6 +6,7 @@
 \RequirePackage{pst-3d}
 \RequirePackage{pst-math}
 \RequirePackage{multido}
+
 \ProvidesPackage{pstricks-add}[2010/02/11 v. 0.14 package wrapper for 
   pstricks-add.tex (hv)]
 \input{pstricks-add.tex}



More information about the tex-live-commits mailing list