texlive[72646] Master/texmf-dist: randintlist (24oct24)
commits+karl at tug.org
commits+karl at tug.org
Thu Oct 24 22:03:11 CEST 2024
Revision: 72646
https://tug.org/svn/texlive?view=revision&revision=72646
Author: karl
Date: 2024-10-24 22:03:11 +0200 (Thu, 24 Oct 2024)
Log Message:
-----------
randintlist (24oct24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/randintlist/randintlist-doc.pdf
trunk/Master/texmf-dist/doc/latex/randintlist/randintlist-doc.tex
trunk/Master/texmf-dist/tex/latex/randintlist/randintlist.sty
Modified: trunk/Master/texmf-dist/doc/latex/randintlist/randintlist-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/randintlist/randintlist-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/randintlist/randintlist-doc.tex 2024-10-24 20:03:02 UTC (rev 72645)
+++ trunk/Master/texmf-dist/doc/latex/randintlist/randintlist-doc.tex 2024-10-24 20:03:11 UTC (rev 72646)
@@ -27,8 +27,8 @@
\hypersetup{pdfborder=0 0 0}
\usepackage[margin=2cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.1.1}
-\def\TPdate{24/09/2024}
+\def\TPversion{0.1.2}
+\def\TPdate{24/10/2024}
\usepackage{tcolorbox}
\usepackage{pgffor}
\tcbuselibrary{breakable,skins,hooks,listingsutf8}
@@ -148,37 +148,37 @@
\vfill
\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
-10 numbers, between 1 and 100, without repetition :
+10 numbers, between 1 and 100, without repetition:
\hfill\randintlist[min=1,max=100,nb=10]{\mylist}\textcolor{red}{\mylist}\hfill~
-The 5th value is :
+The 5th value is:
\hfill\textcolor{blue}{\getitemfromrandintlist{\mylist}{5}}\hfill~
\end{tcolorbox}
\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
-10 numbers, between 1 and 100, without multiples of 5 :
+10 numbers, between 1 and 100, without multiples of 5:
\hfill\randintlist[min=1,max=100,nb=10,exclude={5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100}]{\mylist}\textcolor{olive}{\mylist}\hfill~
-The 9th value is :
+The 9th value is:
\hfill\textcolor{purple}{\getitemfromrandintlist{\mylist}{9}}\hfill~
\end{tcolorbox}
\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
-15 numbers, between 1 and 20, with repetition :
+15 numbers, between 1 and 20, with repetition:
\hfill\randintlist[min=1,max=20,nb=15,repeat]{\mylist}\textcolor{red}{\mylist}\hfill~
-The last value is :
+The last value is:
\hfill\textcolor{blue}{\getitemfromrandintlist{\mylist}{-1}}\hfill~
\end{tcolorbox}
\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
-6 sorted numbers, between 1 and 51, without repetition :
+6 sorted numbers, between 1 and 51, without repetition:
\hfill\randintlist[min=1,max=51,nb=6,sort=asc]{\mylist}ascending : \textcolor{red}{\mylist}\hfill~
@@ -217,13 +217,13 @@
\section{Loading, useful packages}
-In order to load \texttt{randintlist}, simply use :
+In order to load \texttt{randintlist}, simply use:
\begin{DemoCode}{listing only}
\usepackage{randintlist}
\end{DemoCode}
-Loaded packages are \texttt{ifthen}, \texttt{simplekv}, \texttt{listofitems}, \texttt{randomlist}, \texttt{xintexpr} and \texttt{xstring}
+Loaded packages are \texttt{ifthen}, \texttt{simplekv}, \texttt{listofitems}, \texttt{randomlist}, \texttt{xintexpr} and \texttt{xstring}.
\section{The Macros}
@@ -240,17 +240,17 @@
\randintlist[keys]{\macro}
\end{DemoCode}
-Available keys are :
+Available keys are:
\begin{itemize}
- \item \ShowCode{min} : minimum value (default \ShowCode{1}) ;
- \item \ShowCode{max} : maximum value (default \ShowCode{50}) ;
- \item \ShowCode{nb} : number of values (default \ShowCode{6}) ;
- \item \ShowCode{sep} : separator for the list (default \ShowCode{,}) ;
- \item \ShowCode{sort} : sorting options, within \ShowCode{no/asc/dec} (default \ShowCode{no}) ;
- \item \ShowCode{repeat} : boolean to authorize repeating values (default \ShowCode{false}) ;
- \item \ShowCode{exclude} : list of excluded values (default \ShowCode{empty}) ;
- \item \ShowCode{seed} : random seed value according to used packages (default \ShowCode{-}).
+ \item \ShowCode{min}: minimum value (default \ShowCode{1});
+ \item \ShowCode{max}: maximum value (default \ShowCode{50});
+ \item \ShowCode{nb}: number of values (default \ShowCode{6});
+ \item \ShowCode{sep}: separator for the list (default \ShowCode{,});
+ \item \ShowCode{sort}: sorting options, within \ShowCode{no/asc/dec} (default \ShowCode{no});
+ \item \ShowCode{repeat}: boolean to authorize repeating values (default \ShowCode{false});
+ \item \ShowCode{exclude}: list of excluded values (default \ShowCode{empty});
+ \item \ShowCode{seed}: random seed value according to used packages (default \ShowCode{-}).
\end{itemize}
\begin{DemoCode}{}
@@ -280,7 +280,7 @@
%list used with listofitems
\randintlist{\mylistD}\mylistD\par
\readlist*\mylistused{\mylistD}\showitems{\mylistused}\par
-\mylistused[1] ; \mylistused[-1]
+\mylistused[1]; \mylistused[-1]
\end{DemoCode}
\subsection{Accessing elements}
@@ -292,10 +292,10 @@
\begin{DemoCode}{}
%with default keys
-\randintlist{\mylistE}raw list : \mylistE\par
-items list :\par
+\randintlist{\mylistE}raw list: \mylistE\par
+items list:\par
\xintFor* #1 in {\xintSeq{1}{6}}\do{\getitemfromrandintlist{\mylistE}{#1}\par}
-first element : \getitemfromrandintlist{\mylistE}{1}
+first element: \getitemfromrandintlist{\mylistE}{1}
\end{DemoCode}
\subsection{Version française}
@@ -340,10 +340,12 @@
\section{History}
-\texttt{0.1.1 : Possibility to exclude values}
+\texttt{0.1.2: Changing name of internal macro}
-\texttt{0.1.0 : Initial version}
+\texttt{0.1.1: Possibility to exclude values}
+\texttt{0.1.0: Initial version}
+
\section{The code}
\DemoCodeFile{randintlist.sty}
Modified: trunk/Master/texmf-dist/tex/latex/randintlist/randintlist.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/randintlist/randintlist.sty 2024-10-24 20:03:02 UTC (rev 72645)
+++ trunk/Master/texmf-dist/tex/latex/randintlist/randintlist.sty 2024-10-24 20:03:11 UTC (rev 72646)
@@ -2,9 +2,10 @@
% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{randintlist}[2024/09/24 0.1.1 Create a list of random numbers with or without multiple values]
+\ProvidesPackage{randintlist}[2024/10/24 0.1.2 Create a list of random numbers with or without multiple values]
%------History
+% 0.1.2 Changing name of macro
% 0.1.1 Possibility to exclude values
% 0.1.0 Initial version
@@ -44,7 +45,7 @@
\newcommand\boolvalueinlist[2]{\IfSubStr{,#2,}{,#1,}{\def\resisinlist{1}}{\def\resisinlist{0}}}
-\newcommand\xintifintvalueinlist[4]{%
+\newcommand\testifintvalueinlist[4]{%
\IfSubStr{,#2,}{,#1,}{\xdef\RESTMPVALUE{1}}{\xdef\RESTMPVALUE{0}}%
\xintifboolexpr{ \RESTMPVALUE == 1}{#3}{#4}%
}
More information about the tex-live-commits
mailing list.