texlive[73304] Master/texmf-dist: randintlist (4jan25)
commits+karl at tug.org
commits+karl at tug.org
Sat Jan 4 21:48:57 CET 2025
Revision: 73304
https://tug.org/svn/texlive?view=revision&revision=73304
Author: karl
Date: 2025-01-04 21:48:57 +0100 (Sat, 04 Jan 2025)
Log Message:
-----------
randintlist (4jan25)
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 2025-01-04 20:48:46 UTC (rev 73303)
+++ trunk/Master/texmf-dist/doc/latex/randintlist/randintlist-doc.tex 2025-01-04 20:48:57 UTC (rev 73304)
@@ -27,8 +27,8 @@
\hypersetup{pdfborder=0 0 0}
\usepackage[margin=2cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.1.2}
-\def\TPdate{24/10/2024}
+\def\TPversion{0.1.3}
+\def\TPdate{04/01/2025}
\usepackage{tcolorbox}
\usepackage{pgffor}
\tcbuselibrary{breakable,skins,hooks,listingsutf8}
@@ -101,7 +101,7 @@
basicstyle=\scriptsize\ttfamily,%
tabsize=4,%
commentstyle={\itshape\color{gray}},%
- lastline=148
+ lastline=246
},%
breakable,
listing only,%
@@ -192,9 +192,13 @@
\medskip
\emph{%
- The \textsf{luarandom} package do the same things, but with the obligation to compile with \hologo{LuaLaTeX}.
+ 1. The \textsf{luarandom} package do the same things, but with the obligation to compile with \hologo{LuaLaTeX}.
}
+\emph{%
+ 2. The \textsf{tuple} package is so much better\ldots\ but I keep \texttt{randintlist}, without new features\ldots
+}
+
\medskip
\hrule
@@ -287,7 +291,7 @@
\begin{DemoCode}{listing only}
%accessing item
-\getitemfromrandintlist[separator]{\macro}{index}
+\getitemfromrandintlist[separator]{\macro}{index}[\macrores]
\end{DemoCode}
\begin{DemoCode}{}
@@ -295,9 +299,16 @@
\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}\par
\end{DemoCode}
+\begin{DemoCode}{}
+\getitemfromrandintlist{\mylistE}{3}[\myres]%
+third element: \myres
+\end{DemoCode}
+
+\pagebreak
+
\subsection{Version française}
Voilà les commandes en version française, la syntaxe et les clés ne seront pas explicitées.
@@ -307,7 +318,7 @@
\ListeRandint[Min=..,Max=..,Nb=..,Repet=..,Graine=..,Tri=..,Sep=..,Exclure=..]{\macro}
%extraire un élément
-\ExtraireEltListeRandint[sep]{\macro}{position}
+\ExtraireEltListeRandint[sep]{\macro}{position}[\macrores]
\end{DemoCode}
\begin{DemoCode}{}
@@ -317,6 +328,14 @@
\ExtraireEltListeRandint[/]{\maliste}{4}
\end{DemoCode}
+\begin{DemoCode}{}
+%liste
+\ListeRandint[Min=50,Max=100,Nb=10,Repet,Tri=croiss]{\malisteB}\malisteB\\
+%troisième élément
+\ExtraireEltListeRandint{\malisteB}{3}[\montroisieme]%
+troisième élément : \montroisieme
+\end{DemoCode}
+
\pagebreak
\section{Example}
@@ -340,6 +359,8 @@
\section{History}
+\texttt{0.1.3: Bugfix}
+
\texttt{0.1.2: Changing name of internal macro}
\texttt{0.1.1: Possibility to exclude values}
Modified: trunk/Master/texmf-dist/tex/latex/randintlist/randintlist.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/randintlist/randintlist.sty 2025-01-04 20:48:46 UTC (rev 73303)
+++ trunk/Master/texmf-dist/tex/latex/randintlist/randintlist.sty 2025-01-04 20:48:57 UTC (rev 73304)
@@ -1,10 +1,11 @@
% Author : C. Pierquet
-% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
+% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{randintlist}[2024/10/24 0.1.2 Create a list of random numbers with or without multiple values]
+\ProvidesPackage{randintlist}[2025/01/04 0.1.3 Create a list of random numbers with or without multiple values]
%------History
+% 0.1.3 new usage of extracting element (with storing \macro)
% 0.1.2 Changing name of macro
% 0.1.1 Possibility to exclude values
% 0.1.0 Initial version
@@ -136,8 +137,8 @@
}
%-----Macro for extracting
-\NewDocumentCommand\getitemfromrandintlist{ O{,} m m }{%
- \IfEq{#1}{/}%
+\NewDocumentCommand\getitemfromrandintlist{ O{,} m m o }{%
+ \IfStrEq{#1}{/}%
{%
\setsepchar[.]{#1}%
}%
@@ -145,7 +146,7 @@
\setsepchar{#1}%
}%
\readlist*\TMPLISTRANDINT{#2}%
- \TMPLISTRANDINT[#3]%
+ \IfNoValueTF{#4}{\TMPLISTRANDINT[#3]}{\itemtomacro\TMPLISTRANDINT[#3]#4}%
}
%-----french version
@@ -232,8 +233,8 @@
}
%-----Macro for extracting
-\NewDocumentCommand\ExtraireEltListeRandint{ O{,} m m }{%
- \IfEq{#1}{/}%
+\NewDocumentCommand\ExtraireEltListeRandint{ O{,} m m o }{%
+ \IfStrEq{#1}{/}%
{%
\setsepchar[.]{#1}%
}%
@@ -241,7 +242,7 @@
\setsepchar{#1}%
}%
\readlist*\TMPLISTRANDINT{#2}%
- \TMPLISTRANDINT[#3]%
+ \IfNoValueTF{#4}{\TMPLISTRANDINT[#3]}{\itemtomacro\TMPLISTRANDINT[#3]#4}%
}
\endinput
\ No newline at end of file
More information about the tex-live-commits
mailing list.