diff options
author | Karl Berry <karl@freefriends.org> | 2018-12-15 22:41:11 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-12-15 22:41:11 +0000 |
commit | b0897576fe379e6d9a0edd6aaa598b8b0d96cfbd (patch) | |
tree | c5abfb20f4ad066073832322369d08177a67b904 /Master/texmf-dist/doc/lualatex | |
parent | f1106de84d0ef7b3aa67dc256c8bcc03aa36b116 (diff) |
luarandom (15dec18)
git-svn-id: svn://tug.org/texlive/trunk@49419 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/lualatex')
-rw-r--r-- | Master/texmf-dist/doc/lualatex/luarandom/Changes | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/luarandom/README | 12 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/luarandom/luarandom-doc.pdf | bin | 0 -> 49787 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/luarandom/luarandom-doc.tex | 90 |
4 files changed, 106 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/lualatex/luarandom/Changes b/Master/texmf-dist/doc/lualatex/luarandom/Changes new file mode 100644 index 00000000000..29cf20e0232 --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/luarandom/Changes @@ -0,0 +1,4 @@ +..... luarandom.sty +0.01 2018-12-15 first CTAN version (hv) + + diff --git a/Master/texmf-dist/doc/lualatex/luarandom/README b/Master/texmf-dist/doc/lualatex/luarandom/README new file mode 100644 index 00000000000..f51f725e010 --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/luarandom/README @@ -0,0 +1,12 @@ +# luarandom.sty # + +This package provides some macros for creating random number +lists between a nd b (Integers). This list can have multiple +numbers or not. + +The macros for random numbers can only be used with LuaLaTeX! + +hvoss@tug.org + + +%% $Id: README 862 2018-12-15 16:25:55Z herbert $ diff --git a/Master/texmf-dist/doc/lualatex/luarandom/luarandom-doc.pdf b/Master/texmf-dist/doc/lualatex/luarandom/luarandom-doc.pdf Binary files differnew file mode 100644 index 00000000000..9f137411ad0 --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/luarandom/luarandom-doc.pdf diff --git a/Master/texmf-dist/doc/lualatex/luarandom/luarandom-doc.tex b/Master/texmf-dist/doc/lualatex/luarandom/luarandom-doc.tex new file mode 100644 index 00000000000..6c17c1647d3 --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/luarandom/luarandom-doc.tex @@ -0,0 +1,90 @@ +%% $Id: luarandom-doc.tex 862 2018-12-15 16:25:55Z 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{xcolor,pstricks,multido} +\usepackage{auto-pst-pdf-lua} + +\usepackage{luarandom} +\let\pstMathFV\fileversion +\lstset{pos=t,wide=true,language=[LaTeX]{TeX},basicstyle=\footnotesize\ttfamily} +% +\makeatletter +\def\DefOfOperator{\@ifstar{\DefOfOperator@}{\DefOfOperator@@}} +\def\DefOfOperator@#1#2#3#4{{\operator@font#1}:\left\{\begin{array}{ccc} #2&\to\\ +x&\mapsto\end{array}\right.} +\def\DefOfOperator@@#1#2#3{{\operator@font#1}:\left\{\begin{array}{ccc} #2&\to\\ +x&\mapsto&{\operator@font#1}(x)\end{array}\right.} +\makeatother + + +\begin{document} + +\title{\texttt{luarandom}} +\subtitle{Create a list of random numbers with or without multiple values; v. 0.01} +\author{Herbert Vo\ss} +\docauthor{Herbert Vo\ss} +\date{\today} +\maketitle + +\tableofcontents + + +\section{Random numbers} +Package \LPack{luarandom} supports the creation of random number lists where a number will +appear only once or multiple times. With Lua\TeX\ all random numbers are build with the help of Lua which +has the advantage that there will be no problem with \TeX's limited parameter stack size. +However, this package will \emph{not} run with other \TeX-engines than Lua\LaTeX. + + +\section{The Macros} +\begin{BDef} +\Lcs{makeSimpleRandomNumberList}\Largb{Left}\Largb{Right}\Largb{N}\% multiple values possible\\ +\Lcs{makeRandomNumberList}\Largb{Left}\Largb{Right}\Largb{N} \% no multiple values!\\ +\Lcs{getNumberFromList}\Largb{number} +\end{BDef} + + +The list of the random numbers is saved in the Lua table \texttt{RandomNumbers}. + + +\section{Examples} + + +\begin{LTXexample}[pos=t] +\small +\makeSimpleRandomNumberList{1}{30}{30}% with multiple values (hopefully ;-) +\multido{\iA=1+1}{30}{\getNumberFromList{\iA}, } + +\makeRandomNumberList{1}{30}{30}% without multiple values +\multido{\iA=1+1}{30}{\getNumberFromList{\iA}, } +\end{LTXexample} + + + +The following example uses PSTricks related packages which cannot be run directly +with Lua\LaTeX. The package \LPack{auto-pst-pdf-lua} will convert the PSTricks stuff +in the baclground into PDF images which will be included in a second run. + + +\begin{LTXexample}[pos=t] +\newcounter{RandNo}\setcounter{RandNo}{1} +\def\n{10} \def\N{\the\numexpr\n*\n} +\makeRandomNumberList{1}{\N}{\N} +\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){\textcolor{randomhsb}{\getNumberFromList{\theRandNo}}}% + \stepcounter{RandNo}}} +\end{pspicture} +\end{LTXexample} + + +\section{The code} + +\lstinputlisting{luarandom.sty} + +\printindex + + +\end{document} |