diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-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 |
2 files changed, 94 insertions, 6 deletions
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 |