diff options
author | Karl Berry <karl@freefriends.org> | 2018-12-13 22:50:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-12-13 22:50:09 +0000 |
commit | 98e563937c44be065d213d2817f35ca296f22dd6 (patch) | |
tree | 67a2f92b8aa73a322f6c91ced1100b61b6cc34da /Master/texmf-dist | |
parent | 06d4512ae3302b4ee4c9cf505c162fea64002ce5 (diff) |
pst-math (13dec18)
git-svn-id: svn://tug.org/texlive/trunk@49403 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-math/Changes | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-math/README | 16 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-math/pst-math-doc.pdf | bin | 208365 -> 231364 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-math/pst-math-doc.tex | 102 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pst-math/pst-math.pro | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-math/pst-math.tex | 5 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/pst-math/pst-math.sty | 95 |
7 files changed, 188 insertions, 39 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-math/Changes b/Master/texmf-dist/doc/generic/pst-math/Changes index 14b9fe45432..b1f9a7c0328 100644 --- a/Master/texmf-dist/doc/generic/pst-math/Changes +++ b/Master/texmf-dist/doc/generic/pst-math/Changes @@ -1,4 +1,5 @@ -..... pst-math.pro +..... pst-math.sty/pro +0.64 2018-12-13 - added macros for creating lists of randoms 0.63 2014-07-30 - added the arc secans functions 0.61 2010-10-02 - moved vasicek into pst-func to make the probability available as parameter @@ -11,5 +12,3 @@ 0.1 first CTAN version (cj) -..... pst-math.sty - diff --git a/Master/texmf-dist/doc/generic/pst-math/README b/Master/texmf-dist/doc/generic/pst-math/README index 96b79438348..67d090656a0 100644 --- a/Master/texmf-dist/doc/generic/pst-math/README +++ b/Master/texmf-dist/doc/generic/pst-math/README @@ -1,18 +1,8 @@ pst-math: PostScript extension for mathematical functions: -Save the files pst-math.sty|pro|tex in a directory, which is part of your -local TeX tree. The pro file should go into $TEXMF/dvips/pstricks/ -Then do not forget to run texhash to update this tree. -For more information see the documentation of your LATEX distribution -on installing packages into your local TeX system or read the -TeX Frequently Asked Questions: -(http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages). +The macros for random numbers cannot be used with xelatex! -pst-math needs pst-plot (pstricks-add) and pstricks, which should -be part of your local TeX installation, otherwise get it from a -CTAN server, f.ex. ftp://ftp.ctan.org +hvoss@tug.org -PSTricks is PostScript Tricks, the documentation cannot be run -with pdftex, use the sequence latex->dvips->ps2pdf. -%% $Id: README 56 2008-11-14 15:55:45Z herbert $ +%% $Id: README 859 2018-12-13 15:31:03Z herbert $ diff --git a/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.pdf b/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.pdf Binary files differindex f477e992aa9..995dede1238 100644 --- a/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.pdf +++ b/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.pdf diff --git a/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.tex b/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.tex index 6e8b69f283d..9978ef0148b 100644 --- a/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.tex +++ b/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.tex @@ -1,7 +1,6 @@ -%% $Id: pst-func-doc.tex 72 2009-01-08 22:00:47Z herbert $ -\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings - headexclude,footexclude,oneside]{pst-doc} -\usepackage[utf8]{inputenc} +%% $Id: pst-math-doc.tex 859 2018-12-13 15:31:03Z herbert $ +\documentclass[fontsize=11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false, + headings=small, headinclude=false,footinclude=false,oneside,abstract=on]{pst-doc} \usepackage{pst-math} \let\pstMathFV\fileversion \usepackage{pstricks-add} @@ -19,6 +18,9 @@ x&\mapsto\end{array}\right.} x&\mapsto&{\operator@font#1}(x)\end{array}\right.} \makeatother +\addbibresource{\jobname.bib} + + \begin{document} \title{\texttt{pst-math}} @@ -46,6 +48,9 @@ Patrice M\'egret; Dominik Rodriguez \end{abstract} + +\clearpage + \section{Introduction} \nxLPack{pst-math} defines \Lcs{pstPi} on \TeX\ level which expects 1,2,3 or 4 as parameter. It is not available on PostScript level. @@ -311,7 +316,7 @@ num %a b var f Ierr the first two variables are the low and high boundary \Index{integral}, both can be values or -\PS expressions. \verb+/var+ is the definition of the integrated variable (not x!), which is +\PS\ expressions. \verb+/var+ is the definition of the integrated variable (not x!), which is used in the following function description, which must be inside of braces. The last number is the tolerance for the step adjustment. The function \Lps{SIMPSON} can be nested. @@ -331,6 +336,8 @@ nested. \end{pspicture*} \end{LTXexample} + + \begin{LTXexample}[pos=t,wide=false] %%% Gaussian and relative integral from -x to x to its value sqrt{pi} \psset{unit=2} @@ -438,25 +445,92 @@ nested. \end{pspicture} \end{lstlisting} + +\iffalse + \begin{LTXexample}[pos=t,wide=false] % ce code definit la fonction [cos(2pix cos(t))-cos(2pix)]^2 / sin(t) avec x=h/lambda -\def\F{ +\def\Func{ 0.01 3.1 /t - { TwoPi x mul t COS mul COS TwoPi x mul COS sub 2 exp t SIN div } + { TwoPi x mul t COS mul COS TwoPi x mul COS sub 2 exp t SIN div } def .01 SIMPSON 60 mul } -% D = 2*(cos^2(2pix))/F -\def\fD{TwoPi x mul COS dup mul 2 mul \F\space div} +% D = 2*(cos^2(2pix))/Func +\def\fD{TwoPi x mul COS dup mul 2 mul \Func\space div} \psset{llx=-1.5cm,lly=-0.5cm,urx=0.2cm,ury=0.2cm, xAxisLabel={$h/\lambda$},xAxisLabelPos={0.5,-45},yAxisLabel={$R_r$ en ohms}, yAxisLabelPos={-0.1,150}} \begin{psgraph}[Dy=50,Dx=0.1,xticksize=300 0,yticksize=1 0, - comma=true,axesstyle=frame](0,0)(1,300){10cm}{5cm} - \psplot{0}{1}{\F} + comma=true,axesstyle=frame](0,0)(1,300){10cm}{5cm} + \psplot{0}{1}{\Func} \psplot[linecolor=red]{0.01}{.1}{\fD}% \end{psgraph} \end{LTXexample} +\fi + +\section{Random numbers} +Package \LPack{pst-math} supports the creation of random number lists where a number will +appear only once. + +\begin{BDef} +\Lcs{defineRandIntervall}\Largr{min,max}{maxNo}\\ +\Lcs{makeSimpleRandomNumberList}\% multiple values possible\\ +\Lcs{makeRandomNumberList} \% no multiple values!\\ +\Lcs{getNumberFromList}\Largb{number} +\end{BDef} + +The list of the random numbers is \Lcs{RandomNumbers}, a comma separated list of the values. +It can be used for own purpuses. + + +\begin{LTXexample}[pos=t] +\defineRandIntervall(1,50){30} +\makeSimpleRandomNumberList +Random list: \RandomNumbers + +\psforeach{\iA}{1,2,..,30}{\getNumberFromList{\iA}~} +\end{LTXexample} + + +In the next example a random number appears only \emph{once} in the list. There no multiple +numbers: + + +\begin{LTXexample}[pos=t] +\defineRandIntervall(1,30){30} +\makeRandomNumberList +\psforeach{\iA}{1,2,..,30}{\getNumberFromList{\iA}~} +\end{LTXexample} + + + + +\begin{LTXexample}[pos=t] +\newcounter{RandNo} \setcounter{RandNo}{1} +\def\n{5} \def\N{\the\numexpr\n*\n} +\defineRandIntervall(1,\N){\N} +\makeRandomNumberList \setcounter{RandNo}{1} +\begin{pspicture}(\n,\n) + \psgrid[subgriddiv=0,gridlabels=0pt] + \multido{\rRow=0.5+1.0}{\n}{\multido{\rCol=0.5+1.0}{\n}{% + \rput(\rCol,\rRow){\getNumberFromList{\theRandNo}}% + \stepcounter{RandNo}}} +\end{pspicture} +\setcounter{RandNo}{1} +\def\n{6} \def\N{\the\numexpr\n*\n} +\defineRandIntervall(1,\N){\N} +\makeRandomNumberList \setcounter{RandNo}{1} +\begin{pspicture}(\n,\n) + \psgrid[subgriddiv=0,gridlabels=0pt] + \multido{\rRow=0.5+1.0}{\n}{\multido{\rCol=0.5+1.0}{\n}{% + \rput(\rCol,\rRow){\getNumberFromList{\theRandNo}}% + \stepcounter{RandNo}}} +\end{pspicture} +\end{LTXexample} + + + \clearpage @@ -479,18 +553,16 @@ num & \Lps{norminv} & real & Return $\mathop{norminv}(num)$\\ \end{LTXexample} + These function returns the inverse normal. \bgroup \raggedright \nocite{*} -\bibliographystyle{plain} -\bibliography{pst-math-doc} +\printbibliography \egroup \printindex - - \end{document} diff --git a/Master/texmf-dist/dvips/pst-math/pst-math.pro b/Master/texmf-dist/dvips/pst-math/pst-math.pro index c5e2c1b03e1..b9210312bdd 100644 --- a/Master/texmf-dist/dvips/pst-math/pst-math.pro +++ b/Master/texmf-dist/dvips/pst-math/pst-math.pro @@ -3,8 +3,8 @@ % % Author : Christophe JORSSEN % Author : Herbert Voß <hvoss@tug.org> -% Last Mod : $Date: 2014/07/30 $ -% Version : 0.63 $ +% Last Mod : $Date: 2018/12/13 $ +% Version : 0.64 $ % /PI 3.14159265359 def /ENeperian 2.71828182846 def diff --git a/Master/texmf-dist/tex/generic/pst-math/pst-math.tex b/Master/texmf-dist/tex/generic/pst-math/pst-math.tex index 8513092287e..58162024579 100644 --- a/Master/texmf-dist/tex/generic/pst-math/pst-math.tex +++ b/Master/texmf-dist/tex/generic/pst-math/pst-math.tex @@ -20,12 +20,13 @@ \csname PSTmathLoaded\endcsname \let\PSTmathLoaded\endinput \ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi -\def\fileversion{0.63} -\def\filedate{2014/07/30} +\def\fileversion{0.64} +\def\filedate{2018/12/13} \message{`pst-math' v\fileversion\space, (CJ,hv)} \pstheader{pst-math.pro} % \def\pstPI#1{\ifcase#1\or3.141593\or1.570796\or1.047198\or0.785398\fi} % + \endinput diff --git a/Master/texmf-dist/tex/latex/pst-math/pst-math.sty b/Master/texmf-dist/tex/latex/pst-math/pst-math.sty index 442aa606b7e..af9cb22710f 100644 --- a/Master/texmf-dist/tex/latex/pst-math/pst-math.sty +++ b/Master/texmf-dist/tex/latex/pst-math/pst-math.sty @@ -1,9 +1,96 @@ -\ProvidesPackage{pst-math}[2014/07/30 package wrapper for PSTricks pst-math.tex] +% $Id: pst-math.sty 859 2018-12-13 15:31:03Z herbert $ +%% +%% This is file `pst-math.sty'. +%% +%% IMPORTANT NOTICE: +%% +%% pst-math Copyright (C) 2019- Herbert Voss <hvoss@tug.org> +%% +%% This package may be distributed under the terms of the LaTeX Project +%% Public License, as described in lppl.txt in the base LaTeX distribution. +%% Either version 1.0 or, at your option, any later version. +%% + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pst-math}[2018/12/13 v 0.64package wrapper for PSTricks pst-math.tex] +\RequirePackage{pst-calculate} \input pst-math.tex \ProvidesFile{pst-math.tex} [\filedate\space v\fileversion\space `PST-math' (hv)] -\IfFileExists{pst-math.pro}{% - \ProvidesFile{pst-math.pro} - [2014/07/30 v. 0.63, PostScript prologue file (hv)] +\IfFileExists{pst-math.pro}{\ProvidesFile{pst-math.pro}% + [2018/12/13 v. 0.64, PostScript prologue file (hv)] \@addtofilelist{pst-math.pro}}{}% + +\newcounter{Rand@No}\newcounter{Random@Left}\newcounter{Random@Right}\newcounter{Random@No@max}% +\setcounter{Rand@No}{0}\setcounter{Random@Left}{1}\setcounter{Random@Right}{1000}% + +\def\defineRandIntervall(#1,#2)#3{% + \setcounter{Random@Left}{#1}% + \setcounter{Random@Right}{#2}% + \setcounter{Random@No@max}{#3}% + \setcounter{Rand@No}{0}% + \def\RandomNumbers{}% +} + +\def\RandomNumbers{}%\pscalculate{randint(\theRandom@Left,\theRandom@Right)}} + +\def\makeSimpleRandomNumberList{% + \def\RandomNumbers{}% + \psforeach{\iA}{1,2,..,\theRandom@No@max}{% + \edef\@Number{\pscalculate{randint(\theRandom@Left,\theRandom@Right)}}% Zufallszahl + \ifnum\iA=1 + \xdef\RandomNumbers{\@Number}% + \else + \xdef\RandomNumbers{\RandomNumbers,\@Number}% + \fi +% \typeout{\RandomNumbers}% + }% +} +% +\def\makeRandomNumberList{% + \edef\@Number{\pscalculate{randint(\theRandom@Left,\theRandom@Right)}}% Zufallszahl + \ifnum\theRand@No=\z@ + \xdef\RandomNumbers{\@Number}% + \stepcounter{Rand@No}% + \xdef\@Number{\pscalculate{randint(\theRandom@Left,\theRandom@Right)}}% Zufallszahl + \fi + \add@Number{\@Number}\RandomNumbers!!} + +\def\add@Number#1#2!!{\edef\x{\noexpand\add@Number@i#1;#2,,\relax}\x} +\def\add@Number@i#1;#2,#3,#4\relax{% + \ifx\relax#2\relax % we found new number + \xdef\RandomNumbers{\RandomNumbers,#1}% + \stepcounter{Rand@No}% + \ifnum\theRand@No>\theRandom@No@max + \def\next{}% Neue Zahl? + \else + \def\next{\makeRandomNumberList} + \fi% + \else + \ifnum#1=#2 % no new number + \def\next{\makeRandomNumberList}% + \else + \ifx\relax#3\relax + \def\next{\add@Number@i#1;,,\relax}% + \else % + \def\next{\add@Number@i#1;#3,#4\relax}% + \fi + \fi + \fi + \ifnum\theRand@No<\theRandom@No@max \next \fi +} +\def\getNumberFromList#1{% + \global\count0 = 1 + \edef\x{\noexpand\get@Index#1;\RandomNumbers}\x,,\relax} +\def\get@Index#1;#2,#3,#4\relax{% + \ifnum\the\count0=#1 + \def\next{#2}% + \else + \global\advance\count0 by 1 + \def\next{\get@Index#1;#3,#4\relax}% + \fi + \next +} + + \endinput |