diff options
Diffstat (limited to 'graphics/pstricks')
-rw-r--r-- | graphics/pstricks/contrib/pst-ob3d/Changes | 1 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-ob3d/Makefile | 48 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-ob3d/README | 4 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-ob3d/pst-ob3d.dtx | 20 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-ob3d/pst-ob3d.pdf | bin | 196149 -> 197193 bytes | |||
-rw-r--r-- | graphics/pstricks/contrib/pst-tools/Changes | 3 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-tools/README | 1 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-tools/doc/pst-tools-doc.pdf | bin | 116833 -> 128099 bytes | |||
-rw-r--r-- | graphics/pstricks/contrib/pst-tools/doc/pst-tools-doc.tex | 62 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-tools/latex/pst-tools.sty | 2 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-tools/tex/pst-tools.tex | 100 |
11 files changed, 171 insertions, 70 deletions
diff --git a/graphics/pstricks/contrib/pst-ob3d/Changes b/graphics/pstricks/contrib/pst-ob3d/Changes index 11e67d939d..644d297902 100644 --- a/graphics/pstricks/contrib/pst-ob3d/Changes +++ b/graphics/pstricks/contrib/pst-ob3d/Changes @@ -1,4 +1,5 @@ pst-ob3d.dtx -------- +0.22 2020-03-24 Load pst-tools for the random macros (hv) 0.21 2007-08-22 Updated the style file (hv) 0.20 2006-11-25 First CTAN release 0.12 2004-09-29 small fix to the latex-wrapper part (hv) diff --git a/graphics/pstricks/contrib/pst-ob3d/Makefile b/graphics/pstricks/contrib/pst-ob3d/Makefile deleted file mode 100644 index 20d023689b..0000000000 --- a/graphics/pstricks/contrib/pst-ob3d/Makefile +++ /dev/null @@ -1,48 +0,0 @@ - -# `Makefile' for `pst-ob3d.pdf', hv, 2006/08/11 - -.SUFFIXES : .tex .ltx .dvi .ps .pdf .eps - -MAIN = pst-ob3d - -LATEX = latex - -ARCHNAME = $(MAIN)-$(shell date +%y%m%d) - -ARCHFILES = $(MAIN).dtx $(MAIN).ins Makefile - -all : $(MAIN).sty doc clean - -$(MAIN).sty : $(MAIN).dtx -%.sty : %.dtx - tex $(basename $<).ins - -doc: $(MAIN).pdf - -$(MAIN).pdf : $(MAIN).ps - GS_OPTIONS=-dAutoRotatePages=/None ps2pdf $< - -$(MAIN).ps : $(MAIN).dvi - dvips $< - -$(MAIN).dvi : $(MAIN).dtx - $(LATEX) $< - if ! test -f $(basename $<).glo ; then touch $(basename $<).glo; fi - if ! test -f $(basename $<).idx ; then touch $(basename $<).idx; fi - makeindex -s gglo.ist -t $(basename $<).glg -o $(basename $<).gls \ - $(basename $<).glo - makeindex -s gind.ist -t $(basename $<).ilg -o $(basename $<).ind \ - $(basename $<).idx - $(LATEX) $< - -clean : - $(RM) $(addprefix $(MAIN), .log .aux .glg .glo .gls .ilg .idx .ind .tmp .toc .out) - $(RM) $(addprefix $(MAIN), .dvi .ps) - -veryclean : clean - $(RM) $(MAIN).pdf - -arch : - zip $(ARCHNAME).zip $(ARCHFILES) - -# EOF diff --git a/graphics/pstricks/contrib/pst-ob3d/README b/graphics/pstricks/contrib/pst-ob3d/README index 97c6faa903..4ed8eef30b 100644 --- a/graphics/pstricks/contrib/pst-ob3d/README +++ b/graphics/pstricks/contrib/pst-ob3d/README @@ -10,5 +10,7 @@ Run the Makefile or alternative: * Run "latex" on pst-ob3d.dtx to generate the documentation * This is a PSTricks (PostScript Tricks) package, which won't - run with pdftex. In this case go to http://PSTricks.de/ + run with pdftex. In this case go to http://PSTricks.tug.org/ for some help. + +hvoss@tug.org
\ No newline at end of file diff --git a/graphics/pstricks/contrib/pst-ob3d/pst-ob3d.dtx b/graphics/pstricks/contrib/pst-ob3d/pst-ob3d.dtx index 05f0fdb74f..1484d181bb 100644 --- a/graphics/pstricks/contrib/pst-ob3d/pst-ob3d.dtx +++ b/graphics/pstricks/contrib/pst-ob3d/pst-ob3d.dtx @@ -5,7 +5,7 @@ %% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr> %% Herbert Voss <hvoss@tug.org> %% -%% August 22, 2007 +%% Mar 24, 2020 %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN archives @@ -17,6 +17,7 @@ %% % \fi % +% \changes{v0.22}{2020/03/24}{Load pst-tools for random numbers} % \changes{v0.21}{2007/08/22}{Updated the style file} % \changes{v0.20}{2006/11/25}{First CTAN release} % \changes{v0.11 Beta}{2002/05/09}{Fourth packaged release.} @@ -236,7 +237,7 @@ % Scientifique --- Orsay --- France --- % \protect\url{Denis.Girou@idris.fr}.} \and % Herbert Vo\ss\thanks{\protect\url{hvoss@tug.org} for the \texttt{CTAN} Version}} -% \date{Version 0.21\\August 22, 2007} +% \date{Version 0.22\\March 24, 2020} % % \maketitle % @@ -777,8 +778,8 @@ % Who we are. % % \begin{macrocode} -\def\fileversion{0.21} -\def\filedate{2007/08/22} +\def\fileversion{0.22} +\def\filedate{2020/03/24} \message{`Pst-Objects3d' v\fileversion, \filedate\space (DG,hv)} \csname PstObjectsThreeDLoaded\endcsname \let\PstObjectsThreeDLoaded\endinput @@ -787,15 +788,10 @@ % Require the PSTricks, `\textsf{pst-3d}', and `\textsf{pst-xkey}' packages. % % \begin{macrocode} -\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi +\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi +\ifx\PSTricksLoaded\endinput\else \input pstricks.tex\fi \ifx\PSTthreeDLoaded\endinput\else\input pst-3d.tex\fi -\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi -% \end{macrocode} -% -% Donald \textsc{Arseneau} package for random number generation. -% -% \begin{macrocode} -\input random.tex +\ifx\PSTtoolsLoaded\endinput\else \input pst-tools \fi % \end{macrocode} % % Catcodes changes. diff --git a/graphics/pstricks/contrib/pst-ob3d/pst-ob3d.pdf b/graphics/pstricks/contrib/pst-ob3d/pst-ob3d.pdf Binary files differindex 73cc90e5c3..d93853a2c2 100644 --- a/graphics/pstricks/contrib/pst-ob3d/pst-ob3d.pdf +++ b/graphics/pstricks/contrib/pst-ob3d/pst-ob3d.pdf diff --git a/graphics/pstricks/contrib/pst-tools/Changes b/graphics/pstricks/contrib/pst-tools/Changes index 0b2745e998..e5c3d94727 100644 --- a/graphics/pstricks/contrib/pst-tools/Changes +++ b/graphics/pstricks/contrib/pst-tools/Changes @@ -1,4 +1,6 @@ ..... pst-tools.tex +0.10 2020-03-24 - added the random macros from random.tex which is no more + on TeXLive 0.09b 2017-12-03 - modified pro file - added PostScript function list to the documentation 0.09a 2017-11-29 - modified pro file @@ -20,6 +22,7 @@ 2012-01-01 first version + ---- pst-tools.pro 0.06 2017-11-30 - added function concatarray 0.05 2017-11-29 - added function concatstrings diff --git a/graphics/pstricks/contrib/pst-tools/README b/graphics/pstricks/contrib/pst-tools/README index eea7ff0347..b1266c5b7f 100644 --- a/graphics/pstricks/contrib/pst-tools/README +++ b/graphics/pstricks/contrib/pst-tools/README @@ -23,3 +23,4 @@ with pdftex, use the sequence latex->dvips->ps2pdf. %% $Id: README 286 2010-02-11 09:40:41Z herbert $ +hvoss@tug.org
\ No newline at end of file diff --git a/graphics/pstricks/contrib/pst-tools/doc/pst-tools-doc.pdf b/graphics/pstricks/contrib/pst-tools/doc/pst-tools-doc.pdf Binary files differindex 299cc4ad38..15cd40da5c 100644 --- a/graphics/pstricks/contrib/pst-tools/doc/pst-tools-doc.pdf +++ b/graphics/pstricks/contrib/pst-tools/doc/pst-tools-doc.pdf diff --git a/graphics/pstricks/contrib/pst-tools/doc/pst-tools-doc.tex b/graphics/pstricks/contrib/pst-tools/doc/pst-tools-doc.tex index 2473feb2fe..9296568bc3 100644 --- a/graphics/pstricks/contrib/pst-tools/doc/pst-tools-doc.tex +++ b/graphics/pstricks/contrib/pst-tools/doc/pst-tools-doc.tex @@ -1,6 +1,6 @@ -%% $Id: pst-tools-doc.tex 675 2017-12-03 08:39:12Z herbert $ +%% $Id: pst-tools-doc.tex 1163 2020-03-24 09:47:58Z herbert $ \documentclass[11pt,english,BCOR=10mm,DIV=13,toc=bibliography,parskip=false, - headings=small, headinclude=false,footinclude=false,oneside]{pst-doc} + headings=small,headinclude=false,footinclude=false,oneside]{pst-doc} \usepackage[utf8]{inputenc} \usepackage{pst-tools} \let\pstToolsFV\fileversion @@ -24,7 +24,7 @@ \begin{abstract} This package defines some tools which are useful for all packages not only the PSTricks like packages. - +Since the version 0.10 it includes the macros from \texttt{random.tex}. \vfill \noindent Thanks to: @@ -188,7 +188,7 @@ It must be a comma separated list. \begin{lstlisting} -\psRegisterList{Color}{violet,blue,green,red}% defines macro \Color +\psRegisterList{Color}{yellow,blue,green,red}% defines macro \Color \begin{pspicture}(-7,-4.5)(7,5.5) \psaxes{->}(0,0)(-6.5,-4.5)(6.75,5) \psset{plotpoints=400,algebraic,linewidth=1pt,fillstyle=solid,opacity=0.4} @@ -201,7 +201,7 @@ It must be a comma separated list. \end{pspicture} \end{lstlisting} -\psRegisterList{Color}{violet,blue,green,red}% defines macro \Color +\psRegisterList{Color}{yellow,blue,green,red}% defines macro \Color \begin{pspicture}(-7,-4.5)(7,5.5) \psaxes{->}(0,0)(-6.5,-4.5)(6.75,5) \psset{plotpoints=400,algebraic,linewidth=1pt,fillstyle=solid,opacity=0.4} @@ -213,6 +213,58 @@ It must be a comma separated list. \end{pspicture} + +\section{Random numbers} +The file \LFile{random.tex} from Donald Arseneau is no more part of CTAN due to a missing licence statement. +\LFile{pst-tools} at version 0.10 includes the code. The documentation was inside the package otself: + +Random integers are generated in the range 1 to 2147483646 by the +macro \Lcs{nextrandom}. The result is returned in the counter \Lcs{randomi}. +Do not change \Lcs{randomi} except, perhaps, to initialize it at some +random value. If you do not initialize it, it will be initialized +using the time and date. (This is a sparse initialization, giving +fewer than a million different starting values, but you should use +other sources of numbers if they are available--just remember that +most of the numbers available to TeX are not at all random.) + +The \Lcs{nextrandom} command is not very useful by itself, unless you +have exactly 2147483646 things to choose from. Much more useful +is the \Lcs{setrannum} command which sets a given counter to a random +value within a specified range. There are three parameters: + +\Lcs{setrannum\{<counter>\}\{<minimum>\}\{<maximum>\}} + +For example, to +simulate a die-roll: + +\verb|\setrannum{\die}{1}{6}| \verb|\ifcase\die...| . + +If you need random numbers that are not integers, you will have to +use dimen registers and \Lcs{setrandimen}. For example, to set a random +page width: + +\Lcs{setrandimen} \Lcs{hsize\{3in\}\{6.5in\}} + + The »\Lcs{pointless}« macro +will remove the »pt« that TeX gives so you can use the dimensions +as pure `real' numbers. In that case, specify the range in pt units. +For example, + + \verb|\setrandimen\answer{2.71828pt}{3.14159pt}| + + The answer is \verb|\pointless\answer|. + +The random number generator is the one by Lewis, Goodman, and Miller +(1969) and used as \texttt{ran0} in »Numerical Recipies« using Schrage's +method for avoiding overflows. The multiplier is $16807 (7^5)$, the +added constant is 0, and the modulus is $2147483647 (2^{31}-1)$. The +range of integers generated is $1 - 2147483646$. A smaller range would +reduce the complexity of the macros a bit, but not much--most of the +code deals with initialization and type-conversion. On the other hand, +the large range may be wasted due to the sparse seed initialization. + + + \section{List of the defined PostScript functions} \footnotesize diff --git a/graphics/pstricks/contrib/pst-tools/latex/pst-tools.sty b/graphics/pstricks/contrib/pst-tools/latex/pst-tools.sty index bdab72893d..92dbf411c4 100644 --- a/graphics/pstricks/contrib/pst-tools/latex/pst-tools.sty +++ b/graphics/pstricks/contrib/pst-tools/latex/pst-tools.sty @@ -9,4 +9,4 @@ \@addtofilelist{pst-tools.pro}}{}% \endinput -%% $Id: pst-tools.sty 606 2017-10-02 17:34:18Z herbert $ +%% $Id: pst-tools.sty 680 2017-12-05 12:22:55Z herbert $ diff --git a/graphics/pstricks/contrib/pst-tools/tex/pst-tools.tex b/graphics/pstricks/contrib/pst-tools/tex/pst-tools.tex index fa54097db4..3b25402ba8 100644 --- a/graphics/pstricks/contrib/pst-tools/tex/pst-tools.tex +++ b/graphics/pstricks/contrib/pst-tools/tex/pst-tools.tex @@ -1,4 +1,4 @@ -%% $Id: pst-tools.tex 674 2017-12-02 22:04:53Z herbert $ +%% $Id: pst-tools.tex 1163 2020-03-24 09:47:58Z herbert $ %% %% This is file `pst-tools.tex', %% @@ -26,8 +26,8 @@ % interface to the `xkeyval' package \pst@addfams{pst-tools} % -\def\fileversion{0.09b} -\def\filedate{2017/12/03} +\def\fileversion{0.10} +\def\filedate{2020/03/24} \message{`PST-tools' v\fileversion, \filedate\space (hv)} % \define@key[psset]{pst-tools}{decimalSeparator}[.]{\def\psk@decimalSeparator{#1}}% @@ -131,6 +131,100 @@ \advance\pst@cnto by 1 }% } +% RANDOM.TEX v.1 (Donald Arseneau) +% Generating "random" numbers in TeX. +% +% Random integers are generated in the range 1 to 2147483646 by the +% macro \nextrandom. The result is returned in the counter \randomi. +% Do not change \randomi except, perhaps, to initialize it at some +% random value. If you do not initialize it, it will be initialized +% using the time and date. (This is a sparse initialization, giving +% fewer than a million different starting values, but you should use +% other sources of numbers if they are available--just remember that +% most of the numbers available to TeX are not at all random.) +% +% The \nextrandom command is not very useful by itself, unless you +% have exactly 2147483646 things to choose from. Much more useful +% is the \setrannum command which sets a given counter to a random +% value within a specified range. There are three parameters: +% \setrannum {<counter>} {<minimum>} {<maximum>}. For example, to +% simulate a die-roll: \setrannum{\die}{1}{6} \ifcase\die... . +% +% If you need random numbers that are not integers, you will have to +% use dimen registers and \setrandimen. For example, to set a random +% page width: \setrandimen \hsize{3in}{6.5in}. The "\pointless" macro +% will remove the "pt" that TeX gives so you can use the dimensions +% as pure `real' numbers. In that case, specify the range in pt units. +% For example, +% \setrandimen\answer{2.71828pt}{3.14159pt} +% The answer is \pointless\answer. +% +% The random number generator is the one by Lewis, Goodman, and Miller +% (1969) and used as "ran0" in "Numerical Recipies" using Schrage's +% method for avoiding overflows. The multiplier is 16807 (7^5), the +% added constant is 0, and the modulus is 2147483647 (2^{31}-1). The +% range of integers generated is 1 - 2147483646. A smaller range would +% reduce the complexity of the macros a bit, but not much--most of the +% code deals with initialization and type-conversion. On the other hand, +% the large range may be wasted due to the sparse seed initialization. + +\newcount\randomi % the random number seed (while executing) +\global\randomi\catcode`\@ % scratch variable during definitions +\catcode`\@=11 + +\def\nextrandom{\begingroup + \ifnum\randomi<\@ne % then initialize with time + \global\randomi\time + \global\multiply\randomi388 \global\advance\randomi\year + \global\multiply\randomi31 \global\advance\randomi\day + \global\multiply\randomi97 \global\advance\randomi\month + \message{Randomizer initialized to \the\randomi.}% + \nextrandom \nextrandom \nextrandom + \fi + \count@ii\randomi + \divide\count@ii 127773 % modulus = multiplier * 127773 + 2836 + \count@\count@ii + \multiply\count@ii 127773 + \global\advance\randomi-\count@ii % random mod 127773 + \global\multiply\randomi 16807 + \multiply\count@ 2836 + \global\advance\randomi-\count@ + \ifnum\randomi<\z@ \global\advance\randomi 2147483647\relax\fi + \endgroup +} + +\countdef\count@ii=2 % use only in boxes! +\ifx\@tempcnta\undefined \csname newcount\endcsname \@tempcnta \fi +\ifx\@tempcntb\undefined \csname newcount\endcsname \@tempcntb \fi + +\def\setrannum#1#2#3{% count register, minimum, maximum + \@tempcnta#3\advance\@tempcnta-#2\advance\@tempcnta\@ne + \@tempcntb 2147483645 % = m - 2 = 2^{31} - 3 + \divide\@tempcntb\@tempcnta + \getr@nval + \advance\ranval#2\relax + #1\ranval +} + +\def\setrandim#1#2#3{% dimen register, minimum length, maximum length + \dimen@#2\dimen@ii#3\relax + \setrannum\ranval\dimen@\dimen@ii + #1\ranval sp\relax +} + +\def\getr@nval{% The values in \@tempcnta and \@tempcntb are parameters + \nextrandom + \ranval\randomi \advance\ranval\m@ne \divide\ranval\@tempcntb + \ifnum\ranval<\@tempcnta\else \expandafter\getr@nval \fi +} + +\def\pointless{\expandafter\PoinTless\the} +{\catcode`p=12 \catcode`t=12 +\gdef\PoinTless#1pt{#1}} + +\catcode`\@=\randomi +\global\randomi=0 +\newcount\ranval \catcode`\@=\PstAtCode\relax % |