summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pst-math
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-12-13 22:50:09 +0000
committerKarl Berry <karl@freefriends.org>2018-12-13 22:50:09 +0000
commit98e563937c44be065d213d2817f35ca296f22dd6 (patch)
tree67a2f92b8aa73a322f6c91ced1100b61b6cc34da /Master/texmf-dist/tex/latex/pst-math
parent06d4512ae3302b4ee4c9cf505c162fea64002ce5 (diff)
pst-math (13dec18)
git-svn-id: svn://tug.org/texlive/trunk@49403 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pst-math')
-rw-r--r--Master/texmf-dist/tex/latex/pst-math/pst-math.sty95
1 files changed, 91 insertions, 4 deletions
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