summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pst-math/pst-math.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-12-16 21:52:02 +0000
committerKarl Berry <karl@freefriends.org>2018-12-16 21:52:02 +0000
commitfdbdef80eba0c9bc973e568e0900c2f29ab170cc (patch)
tree9121159b25d61dbb5d124951f91c03aac0a7757c /Master/texmf-dist/tex/latex/pst-math/pst-math.sty
parent52c4d6235300874bb21256274d1404e5cc38b86a (diff)
pst-math (16dec18)
git-svn-id: svn://tug.org/texlive/trunk@49425 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pst-math/pst-math.sty')
-rw-r--r--Master/texmf-dist/tex/latex/pst-math/pst-math.sty57
1 files changed, 27 insertions, 30 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 af9cb22710f..0c0f1aef407 100644
--- a/Master/texmf-dist/tex/latex/pst-math/pst-math.sty
+++ b/Master/texmf-dist/tex/latex/pst-math/pst-math.sty
@@ -1,4 +1,4 @@
-% $Id: pst-math.sty 859 2018-12-13 15:31:03Z herbert $
+% $Id: pst-math.sty 864 2018-12-15 21:15:11Z herbert $
%%
%% This is file `pst-math.sty'.
%%
@@ -12,13 +12,15 @@
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{pst-math}[2018/12/13 v 0.64package wrapper for PSTricks pst-math.tex]
+\ProvidesPackage{pst-math}[2018/12/16 v 0.65 package wrapper for PSTricks pst-math.tex]
\RequirePackage{pst-calculate}
+\RequirePackage{ifluatex}
+\RequirePackage{xstring}
\input pst-math.tex
\ProvidesFile{pst-math.tex}
[\filedate\space v\fileversion\space `PST-math' (hv)]
\IfFileExists{pst-math.pro}{\ProvidesFile{pst-math.pro}%
- [2018/12/13 v. 0.64, PostScript prologue file (hv)]
+ [2018/12/13 v. 0.65, PostScript prologue file (hv)]
\@addtofilelist{pst-math.pro}}{}%
\newcounter{Rand@No}\newcounter{Random@Left}\newcounter{Random@Right}\newcounter{Random@No@max}%
@@ -30,6 +32,8 @@
\setcounter{Random@No@max}{#3}%
\setcounter{Rand@No}{0}%
\def\RandomNumbers{}%
+ \def\R@Control{}%
+ \multido{\iA=1+1}{\theRandom@No@max}{\xdef\R@Control{0\R@Control}}%
}
\def\RandomNumbers{}%\pscalculate{randint(\theRandom@Left,\theRandom@Right)}}
@@ -43,41 +47,33 @@
\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!!}
+ \add@Number{\@Number}}
-\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}%
+\def\add@Number#1{%
+ \def\R@Left{}\def\R@Right{}\def\R@Value{}%
+ \StrChar{\R@Control}{#1}[\R@Value]
+ \ifnum\R@Value=0
\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
+ \ifnum\theRand@No=1\relax
+ \gdef\RandomNumbers{#1}%
+ \else
+ \xdef\RandomNumbers{\RandomNumbers,#1}%
\fi
+ \StrLeft{\R@Control}{\the\numexpr#1-1}[\R@Left]%
+ \StrRight{\R@Control}{\the\numexpr\theRandom@No@max-#1}[\R@Right]%
+ \xdef\R@Control{\R@Left1\R@Right}%
+ \fi
+ \ifnum\theRand@No=\theRandom@No@max
+ \def\next{}%
+ \else
+ \def\next{\makeRandomNumberList}%
\fi
- \ifnum\theRand@No<\theRandom@No@max \next \fi
+ \next
}
\def\getNumberFromList#1{%
\global\count0 = 1
@@ -92,5 +88,6 @@
\next
}
-
\endinput
+
+