texlive[59515] Master/texmf-dist: ran_toks (7jun21)

commits+karl at tug.org commits+karl at tug.org
Mon Jun 7 22:07:17 CEST 2021


Revision: 59515
          http://tug.org/svn/texlive?view=revision&revision=59515
Author:   karl
Date:     2021-06-07 22:07:17 +0200 (Mon, 07 Jun 2021)
Log Message:
-----------
ran_toks (7jun21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/ran_toks/README.md
    trunk/Master/texmf-dist/doc/latex/ran_toks/docs/ran_toks.pdf
    trunk/Master/texmf-dist/doc/latex/ran_toks/docs/rantoks_man.pdf
    trunk/Master/texmf-dist/doc/latex/ran_toks/docs/rantoks_man.tex
    trunk/Master/texmf-dist/source/latex/ran_toks/ran_toks.dtx
    trunk/Master/texmf-dist/tex/latex/ran_toks/ran_toks.sty
    trunk/Master/texmf-dist/tex/latex/ran_toks/rt-dbapp.def

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/ran_toks/examples/nested-matching.tex

Modified: trunk/Master/texmf-dist/doc/latex/ran_toks/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ran_toks/README.md	2021-06-07 20:06:53 UTC (rev 59514)
+++ trunk/Master/texmf-dist/doc/latex/ran_toks/README.md	2021-06-07 20:07:17 UTC (rev 59515)
@@ -1,6 +1,6 @@
 The ran_toks Package
 Author: D. P. Story
-Dated: 2021-01-19 
+Dated: 2021-06-06
 
 This short package, with minimal requirements, defines macros for
 randomizing a list of tokens.  There are two approaches:
@@ -40,20 +40,22 @@
 For users of AeB or eqexam, the latter structure can be used to randomize
 the order of the questions on a quiz or exam.
 
-What's New (2021-01-19) A new option, usedbapp, was added to 
-support a DB application. Extensive work was done on the DB 
-application. Added \uniqueXDBChoicesOn, which if expanded, tries 
-to choose a random token that has not already been chosen, 
-across versions of a multi-version eqexam document. Changes are 
-discussed in the documentation and in the new examples in the 
-distribution. 
+What's New (2021-06-06) Added support for nested \bRTVToks/\eRTVToks command 
+  pairs. Demo files: ran_toks.tex and nested-matching.tex. 
 
+What's New (2021-01-19) A new option, usedbapp, was added to support a DB 
+  application. Extensive work was done on the DB application. Added 
+  \uniqueXDBChoicesOn, which if expanded, tries to choose a random token that 
+  has not already been chosen, across versions of a multi-version eqexam 
+  document. Changes are discussed in the documentation and in the new 
+  examples in the distribution. 
+
 What's New (2019-12-28) Defined \rtVWHook to insert at the top of the
-rtVW environment. Also created an alternate package name of ran-toks.
+  rtVW environment. Also created an alternate package name of ran-toks. 
 
-What's new in v1.1: Added the convenience command \useTheseDBs to input files for
-an application to constructing exams (using eqexam) from a series of DB files. Refer to the
-new demo file mc-db.tex.
+What's new in v1.1: Added the convenience command \useTheseDBs to input files 
+  for an application to constructing exams (using eqexam) from a series of DB 
+  files. Refer to the new demo file mc-db.tex. 
 
 Enjoy!
 

Modified: trunk/Master/texmf-dist/doc/latex/ran_toks/docs/ran_toks.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/ran_toks/docs/rantoks_man.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/ran_toks/docs/rantoks_man.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ran_toks/docs/rantoks_man.tex	2021-06-07 20:06:53 UTC (rev 59514)
+++ trunk/Master/texmf-dist/doc/latex/ran_toks/docs/rantoks_man.tex	2021-06-07 20:07:17 UTC (rev 59515)
@@ -8,7 +8,8 @@
 ]{aeb_pro}
 \usepackage{ran_toks}
 
-\useThisSeed{1441984427}
+\useThisSeed{227819015}
+%\useThisSeed{1441984427}
 %\useLastAsSeed
 %\useThisSeed{2001383846}
 
@@ -30,6 +31,7 @@
 %\usepackage{makeidx}
 %\makeindex
 \usepackage{acroman}
+\usepackage[active]{srcltx}
 
 \makeatletter
 \def\eq at fititin#1{\noindent\unskip\nobreak\hfill\penalty50
@@ -77,17 +79,19 @@
 
 \urlstyle{rm}
 
+\let\tops\texorpdfstring
+
 \DeclareDocInfo
 {
     university={\AcroTeX.Net},
-    title={\texorpdfstring{The \textsf{ran\_toks}}{The manual for the ran\_toks}
-        Package\texorpdfstring{\\[6pt]\large}{: }
+    title={\tops{The \textsf{ran\_toks}}{The manual for the ran\_toks}
+        Package\tops{\\[6pt]\large}{: }
         Randomizing the order of tokens},
     author={D. P. Story},
     email={dpstory at acrotex.net},
     subject=Documentation for the ran\_toks package,
     talksite={\url{www.acrotex.net}},
-    version={1.3.1, 2021/01/19},
+    version={1.4, 2021/06/06},
     Keywords={LaTeX, PDF, random, tokens, JavaScript, Adobe Acrobat},
     copyrightStatus=True,
     copyrightNotice={Copyright (C) \the\year, D. P. Story},
@@ -106,7 +110,7 @@
 \sectionLayout{indent=-62.5pt,fontsize=large,color=aeb}
 \subsectionLayout{indent=-31.25pt,color=aeb}
 \subsubsectionLayout{indent=0pt,color=aeb}
-\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}}
+\subsubDefaultDing{\tops{$\bullet$}{\textrm\textbullet}}
 
 \def\exSrc{\makebox[0pt][r]{\large{\Pisymbol{webd}{157}}\enspace}}
 
@@ -241,7 +245,7 @@
 using either the \cs{ranToks} command or the \cs{bRTVToks}/\cs{eRTVToks}
 pair. Each of these is discussed in the next two subsections.
 
-\subsection{The \texorpdfstring{\protect\cs{ranToks}}{\CMD{ranToks}} command}\label{s:ranToks}
+\subsection{The \tops{\protect\cs{ranToks}}{\CMD{ranToks}} command}\label{s:ranToks}
 
 The \cs{ranToks} command was the original concept; declare a series of
 tokens to be randomized.
@@ -334,13 +338,13 @@
 \reorderRanToks{!ameta(name)}
 \end{Verbatim}
 \end{minipage}\eVerb Now, executing \verb~\reorderRanToks{myPals}~ and compiling the sentence again yields,
-``I have {\nToksFor{myPals}} pals, they are
+``I~have {\nToksFor{myPals}} pals, they are
 \useRanTok{1}, \useRanTok{2}, \useRanTok{3}, \useRanTok{4},
 {\useRanTok{5}} and \useRanTok{6}.'' For most applications, re-randomizing
 the same token list in the same document is not very likely something you
 need to do.
 
-The \cs{reorderRanToks\darg{\ameta{name}}} rearranges the list of tokens
+The \cs{reorderRanToks\darg{\ameta{name}}} command rearranges the list of tokens
 associated with \ameta{name}, which may not be what you want; the
 \cs{copyRanToks} command, on the other hand, makes a (randomized) copy of its
 first required argument \ameta{name\SUB1} and saves it as \ameta{name\SUB2}, without
@@ -364,7 +368,7 @@
 and verbatim environments.
 
 \subsection{The
-\texorpdfstring{\protect\cs{bRTVToks}/\protect\cs{eRTVToks}}
+\tops{\protect\cs{bRTVToks}/\protect\cs{eRTVToks}}
     {\CMD{bRTVToks}/\CMD{eRTVToks}} pair of commands}\label{ss:RTVToks}
 
 Sometimes the content to be randomized is quite large or contains verbatim
@@ -495,7 +499,6 @@
 The command \cs{copyRanToks} works for list created by
 \cs{bRTVToks}/\penalty0\cs{bRTVToks} as well.
 
-
 \paragraph*{On the \cs{displayListRandomly} command.}\label{para:DLR}
 In the enumerate example immediately above, the items in the list are
 explicitly listed as \cs{item \cs{useRanTok\darg{1}}} and so on; an
@@ -549,8 +552,132 @@
 comma? (\displayListRandomly[\ifnum\i=\last and \fi][\ifnum\i=\last.\else\ifnum\i=\lessone\relax\space\else, \fi\fi]{myPals})
 Hint: a solution involves the other command \cs{lessone}.
 
+\subsubsection{Nested
+\tops{\protect\cs{bRTVToks}/\protect\cs{eRTVToks}}
+    {\CMD{bRTVToks}/\CMD{eRTVToks}} command pairs}\label{ss:NestedRTVToks}
 
+These is at least one example of using nested
+\cs{bRTVToks}/\allowbreak\cs{eRTVToks}. When nested
+\cs{bRTVToks}/\allowbreak\cs{eRTVToks} command pairs, use the \env{rtVWi}
+environment instead of the \env{rtVW} environment. The nested
+\cs{bRTVToks}/\allowbreak\cs{eRTVToks} pair is placed\FmtMP{placement} within
+a \env{rtWV} environment; in this way the contents of that \env{rtWV}
+environment, itself can be randomized. The \cs{displayListRandomly} (or
+\cs{useRanTok}) command is used to list out the nested items. See the next
+page for an example.
 
+\newpage
+
+\bRTVToks{Depth0}
+  \begin{rtVW}
+    Depth0: Item 1
+\end{rtVW}
+  \begin{rtVW}
+    Depth0: Item 2:
+    \bRTVToks{Depth1}
+      \begin{rtVWi}
+        Depth1: Item 1
+\end{rtVWi}
+      \begin{rtVWi}
+        Depth1: Item 2
+        \bRTVToks{Depth2}
+          \begin{rtVWii}
+              Depth2: Item 1
+\end{rtVWii}
+          \begin{rtVWii}
+              Depth2: Item 2
+\end{rtVWii}
+          \begin{rtVWii}
+              Depth2: Item 3
+\end{rtVWii}
+        \eRTVToks
+\begin{itemize}
+        \displayListRandomly[\item]{Depth2}
+\end{itemize}
+\end{rtVWi}
+      \begin{rtVWi}
+        Depth1: Item 3
+\end{rtVWi}
+\eRTVToks
+\begin{itemize}
+\displayListRandomly[\item]{Depth1}
+\end{itemize}
+\end{rtVW}
+  \begin{rtVW}
+      Depth0: Item 3
+\end{rtVW}
+  \begin{rtVW}
+      Depth0: Item 4
+\end{rtVW}
+  \begin{rtVW}
+      Depth0: Item 5
+\end{rtVW}
+\eRTVToks
+   \begin{enumerate}\small
+\displayListRandomly[\item]{Depth0}
+\end{enumerate}
+The verbatim listing for this example follows.
+\begin{Verbatim}[commandchars=!(),fontsize=\small]
+\bRTVToks{Depth0}
+  \begin{rtVW}
+    Depth0: Item 1
+\end{rtVW}
+  \begin{rtVW}
+    Depth0: Item 2:
+    \bRTVToks{Depth1} % !textsf(begin Depth2 within an rtVW env.)
+      \begin{rtVWi}
+        Depth1: Item 1
+\end{rtVWi}
+      \begin{rtVWi}
+        Depth1: Item 2
+        \bRTVToks{Depth2} % !textsf(begin Depth1 within an rtVWi env.)
+          \begin{rtVWii}
+              Depth2: Item 1
+\end{rtVWii}
+          \begin{rtVWii}
+              Depth2: Item 2
+\end{rtVWii}
+          \begin{rtVWii}
+              Depth2: Item 3
+\end{rtVWii}
+        \eRTVToks
+\begin{itemize}
+        \displayListRandomly[\item]{Depth2} % !textsf(display Depth2 toks)
+\end{itemize}
+\end{rtVWi}
+      \begin{rtVWi}
+        Depth1: Item 3
+\end{rtVWi}
+\eRTVToks
+\begin{itemize}
+\displayListRandomly[\item]{Depth1} % !textsf(display Depth1 toks)
+\end{itemize}
+\end{rtVW}
+  \begin{rtVW}
+      Depth0: Item 3
+\end{rtVW}
+  \begin{rtVW}
+      Depth0: Item 4
+\end{rtVW}
+  \begin{rtVW}
+      Depth0: Item 5
+\end{rtVW}
+\eRTVToks
+\begin{enumerate}
+\displayListRandomly[\item]{Depth0} % !textsf(display Depth0 toks)
+\end{enumerate}
+\end{Verbatim}
+Oops. Did I forget to mention that \pkg{ran\_toks} supports nested to a depth of two.
+
+Some authors like to indent nested things, but to avoid spurious spaces
+appearing, \cs{end\darg{rtVW}} (and \cs{end\darg{rtVWi}}) should be placed in
+the far left margin, as shown above. Recall the \env{rtVW} is a verbatim
+environment.
+
+The above example is reproduced in the \texttt{ran\_toks.tex} sample file found in the
+\texttt{examples} folder. Also found in that folder is \texttt{nested-matching.tex}, a \pkg{exerquiz}
+quiz that motivated creating nested \cs{bRTVToks}/\allowbreak\cs{eRTVToks} command pairs.
+
 \section{Additional arguments and commands}\label{AddCmds}
 
 The syntax given earlier for \cs{useRanTok} was not completely specified.
@@ -633,7 +760,7 @@
 \displayListRandomly[\ifnum\i=\last\space and \fi(\the\i)~][\ifnum\i=\last.\else,\fi\space]{myPals}
 
 The \cs{useRanTok} command---whether it operates on a randomized token list
-or not---behaves similarly to an array. Thus, if we wanted the extract
+or not---behaves similarly to an array. Thus, if we wanted to extract
 the third entry of the non-randomized token list (array)
 \texttt{myOriginalPals}, we do so by expanding the command
 \verb!\useRanTok[myOriginalPals]{3}! to produce
@@ -752,7 +879,7 @@
 or perhaps in the preamble. The syntax is,
 \bVerb\takeMeasure{\string\useTheseDBs\darg{\ameta{db\SUB{1}},\ameta{db\SUB{2}},...,\ameta{db\SUB{n}}}}%
 \setlength\eflength{\bxSize}%
-\begin{minipage}{\bxSize}\kern0pt\def\1{\rlap{\sffamily\hskip\eflength(An alias for \cs{useTheseDBs})}}\relax
+\begin{minipage}{\bxSize}\def\1{\rlap{\sffamily\hskip\eflength(An alias for \cs{useTheseDBs})}}\kern0pt
 \begin{Verbatim}[frame=single,commandchars=!()]
 \useTheseDBs{!ameta(db!SUB(1)),!ameta(db!SUB(2)),...,!ameta(db!SUB(n))}
 !1\useProbDBs{!ameta(db!SUB(1)),!ameta(db!SUB(2)),...,!ameta(db!SUB(n))}

Added: trunk/Master/texmf-dist/doc/latex/ran_toks/examples/nested-matching.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ran_toks/examples/nested-matching.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/ran_toks/examples/nested-matching.tex	2021-06-07 20:07:17 UTC (rev 59515)
@@ -0,0 +1,150 @@
+\documentclass{article}
+\usepackage{amstext}
+\usepackage[forcolorpaper]{web}
+\usepackage[usesumrytbls,allowrandomize]{exerquiz}[2021/05/29]
+\usepackage{ran_toks}[2021/05/29]
+\usepackage{multicol}
+
+\DeclareQuiz{Qz1}
+
+\useRandomSeed{1294278923}
+%\useLastAsSeed
+
+\hypersetup{pdfpagemode=UseNone} % don't need to see bookmarks
+\hypersetup{pdfpagelayout=OneColumn}
+\reversemarginpar
+\showCreditMarkup
+
+%\previewOn\pmpvOn
+
+\useBeginQuizButton[\CA{Begin}]
+\useEndQuizButton[\CA{End}]
+\PTsHook{($\eqPTs^{\text{pts}}$)}
+\useMCCircles
+
+\newcommand{\presetMatch}{\Q{1}\AddAAKeystroke{event.change=event.change.toUpperCase();}\rectW{\widthof{AA}}}
+
+\begin{document}
+
+\bRTVToks{\currQuiz}
+
+\begin{quiz*}{\currQuiz}
+Solve each of these problems, passing is 100\%.
+\begin{questions}
+    \begin{rtVW}
+        \item\PTs{2} $9+8=\RespBoxMath{17}*{1}{.0001}{[0,1]}\cgBdry[1bp]
+      \CorrAnsButton{17}$
+        \begin{solution}
+            Blimey! Everyone knows that $ 9 + 8 = 17$, why don't you ? BTW, $17$ is my formerly favorite number.
+\end{solution}
+\end{rtVW}
+
+    \begin{rtVW}
+        \item\PTs{3} Which of the following are numbers?
+        \begin{manswers}*{6}
+            \bChoices[random=true]
+            \Ans[-1]{0}D\eAns
+            \Ans[1]{1}17\eAns
+            \Ans[-1]{0}P\eAns
+            \Ans[1]{1}88\eAns
+            \Ans[-1]{0}S\eAns
+            \Ans[1]{1}105\eAns
+            \eChoices
+        \end{manswers}
+        \begin{solution}
+         Which are  numbers? 17, 88, and 105, silly
+\end{solution}
+\end{rtVW}
+
+    \begin{rtVW}
+  \item\PTs{3} $ \cos(\pi) = \RespBoxMath{-1}*{1}{.0001}{[0,1]}\cgBdry[1bp]
+      \CorrAnsButton{-1} $
+\begin{solution}
+$ \cos(\pi) = -1 $
+\end{solution}
+\end{rtVW}
+
+    \begin{rtVW}
+\item\PTs{4} $\displaystyle\frac{d}{dx}{\sin(x)}=\RespBoxMath{cos(x)}*{4}{.0001}{[0,1]}\cgBdry[1bp]
+      \CorrAnsButton{cos(x)} $
+\begin{solution}
+ $\displaystyle\frac{d}{dx}{\sin(x)}= \cos(x) $
+\end{solution}
+\end{rtVW}
+
+    \begin{rtVW}
+\hideCreditMarkup
+        \item\PTs{3} Match the last name of the U.S. President with his first
+        name in the right most two columns. Each problem is worth 1 point.
+
+\bRTVToks{RandomQzQuesB}
+\begin{rtVWi}
+   \PTs*{1}\RespBoxTxt[\presets{\presetMatch}\rectW{5mm}\MaxLen{1}]{0}{0}*{1}{\txtRef{willy}} Brandt
+   \begin{solution}
+       \underbar{Willy} Brandt
+\end{solution}
+\end{rtVWi}
+\begin{rtVWi}
+   \PTs*{1}\RespBoxTxt[\presets{\presetMatch}\rectW{5mm}\MaxLen{1}]{0}{0}*{1}{\txtRef{roman}} Herzog
+   \begin{solution}
+       \underbar{Roman} Herzog
+\end{solution}
+\end{rtVWi}
+\begin{rtVWi}
+   \PTs*{1}\RespBoxTxt[\presets{\presetMatch}\rectW{5mm}\MaxLen{1}]{0}{0}*{1}{\txtRef{konrad}} Adenauer
+   \begin{solution}
+       \underbar{Konrad} Adenauer
+\end{solution}
+\end{rtVWi}
+\eRTVToks
+\bRTVToks{RandomQzAltsB}
+\begin{rtVWi}
+   Gustav
+\end{rtVWi}
+\begin{rtVWi}
+   \label{konrad} Konrad
+\end{rtVWi}
+\begin{rtVWi}
+   \label{willy} Willy
+\end{rtVWi}
+\begin{rtVWi}
+   \label{roman} Roman
+\end{rtVWi}
+\begin{rtVWi}
+   Ludwig
+\end{rtVWi}
+\begin{rtVWi}
+   Hermann
+\end{rtVWi}
+\begin{rtVWi}
+   Karl
+\end{rtVWi}
+\begin{rtVWi}
+   J\"{u}rgen
+\end{rtVWi}
+\eRTVToks
+    \begin{multicols}{4}
+       \begin{questions}[labelwidthTo={\textbf{A}}]
+           \hideCreditMarkup
+           \renewcommand{\theeqquestionnoii}{\Alph{eqquestionnoii}}
+           \displayListRandomly[\item]{RandomQzAltsB}
+           \showCreditMarkup
+       \end{questions}
+    \end{multicols}
+    \begin{questions}
+       \showCreditMarkup
+       \displayListRandomly[\item]{RandomQzQuesB}
+    \end{questions}
+\end{rtVW}
+  \eRTVToks
+  \displayListRandomly{\thisQuiz}
+\end{questions}
+%\writeProListAux
+\end{quiz*}\cgBdry[1em]\ScoreField{\currQuiz}\olBdry\CorrButton{\currQuiz}\vcgBdry[6pt]
+
+Answers: \AnswerField\currQuiz
+
+\begin{center}
+\displaySumryTbl[showmarkup]{\currQuiz}
+\end{center}
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/ran_toks/examples/nested-matching.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex/ran_toks/ran_toks.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/ran_toks/ran_toks.dtx	2021-06-07 20:06:53 UTC (rev 59514)
+++ trunk/Master/texmf-dist/source/latex/ran_toks/ran_toks.dtx	2021-06-07 20:07:17 UTC (rev 59515)
@@ -16,7 +16,7 @@
 %</copyright>
 %<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01]
 %<package>\ProvidesPackage{ran_toks}
-%<package> [2021/01/19 v1.3.1 Randomizing tokens (dps)]
+%<package> [2021/06/06 v1.4 Randomizing tokens (dps)]
 %<*driver>
 \documentclass{ltxdoc}
 \usepackage[colorlinks,hyperindex=false]{hyperref}
@@ -113,7 +113,7 @@
 %\useRanTok{1}, \useRanTok{2},..., \useRanTok{n}
 %\end{Verbatim}
 % Other details are left to the readers' imagination.
-%
+% \changes{v1.4}{2021/06/06}{Rounded up v1.3.3 to v1.4 for publication}
 % \paragraph{Requirements.} As of this writing, we require only the \texttt{verbatim} package
 % and \texttt{random.tex}, the package was written by Donald Arseneau.
 %    \begin{macrocode}
@@ -437,8 +437,8 @@
 % access to the contents of the \texttt{rtVW} environments, this done by
 % \cs{r at nVToks}.
 %    \begin{macrocode}
-\newcommand{\eRTVToks}{\global
-  \rt at nameedef{\rt at BaseName Cnt}{\the\rt at nCnt}\expandafter
+\newcommand{\eRTVToks}{%
+  \global\rt at nameedef{\rt at BaseName Cnt}{\the\rt at nCnt}\expandafter
   \r at nVToks\expandafter{\rt at BaseName}}
 %    \end{macrocode}
 %    \end{macro}
@@ -445,7 +445,7 @@
 %    \begin{environment}{rtVW}
 % \cs{rtVW} is a verbatim write environment. It saves its contents to the file
 % \verb!\jobname_\rt at BaseName-\the\rt at nCnt.cut!. The file is later input back into
-% the source file in a random way. % J14
+% the source file in a random way.
 %    \begin{macrocode}
 \def\reVerbEnd{\ifhmode\unskip\fi}
 %    \end{macrocode}
@@ -464,6 +464,8 @@
 \def\rtVWId#1{\ifviewIDs\noindent#1\fi
   \ifxDBUnique\ifrt at InputUsedIDs\wrtProbIds{#1}\fi\fi
 }
+%    \end{macrocode}
+%    \begin{macrocode}
 \newenvironment{rtVW}{\global\advance\rt at nCnt\@ne
   \immediate\openout\rt at Verb@write
     \jobname_\rt at BaseName-\the\rt at nCnt.cut
@@ -478,6 +480,15 @@
   \immediate\closeout\rt at Verb@write
 }
 %    \end{macrocode}
+%    (2021/05/29) In support of nested |\bRTVToks/\eRTVToks| constructs, we \cs{let}
+%    \cs{rtVWi} and \cs{rtVWii} to \cs{rtVW}, and \cs{endrtVWi} and \cs{endrtVWii} to \cs{endrtVW}.
+%    \changes{v1.3.3}{2021/05/29}{Assign \string\cs{rtVWi} and \string\cs{endrtVWi}}
+%    \begin{macrocode}
+\let\rtVWi\rtVW % dps5-29
+\let\endrtVWi\endrtVW
+\let\rtVWii\rtVW % dps5-29
+\let\endrtVWii\endrtVW
+%    \end{macrocode}
 %    \end{environment}
 % \DescribeMacro{\r at nVToks} randomizes the contents of the \texttt{rtVW}
 % environment.
@@ -699,12 +710,14 @@
 %\changes{v1.0b}{2013/07/29}{Added \string\cs{displayListRandomly}}
 %\changes{v1.0e}{2016/02/06}{Added optional argument to \string\cs{displayListRandomly}}
 %\changes{v1.1}{2017/05/04}{Added second optional argument to \string\cs{displayListRandomly}}
+%\changes{v1.3.3}{2021/05/29}{In support of nested \string\cs{bRTVToks}/\string\cs{eRTVToks}\space
+%   constructs, replace the counter \string\cs{rt at nCnt} with \string\cs{@tempcntb}}
 %    \begin{macrocode}
-\newcommand{\displayListRandomly}[1][]{\bgroup
+\newcommand{\displayListRandomly}[1][]{\begingroup
   \def\rt at prior{#1}\displ at yListRandomly
 }
-\newcommand{\displ at yListRandomly}[2][]{\rt at nCnt\z@\expandafter
-  \ifx\csname nMax4#2\endcsname\relax
+\newcommand{\displ at yListRandomly}[2][]{\@tempcntb\z@  % dps5-29
+  \expandafter\ifx\csname nMax4#2\endcsname\relax
     \rt at rgi\space\textbf{??}\rt at badTokName{#2}#1%
   \else
     \rt at recordingfalse
@@ -715,14 +728,21 @@
 %   These four macro are defined locally and not available outside the command
 %   \cs{displayListRandomly}.
 %    \begin{macrocode}
-    \def\rt at post{#1}\useRTName{#2}\let\i\rt at nCnt
+    \def\rt at post{#1}\useRTName{#2}\let\i\@tempcntb
     \def\first{1}\edef\last{\@nameuse{nMax4#2}}\@tempcnta\last
     \advance\@tempcnta\m at ne
-    \edef\lessone{\the\@tempcnta}\@whilenum\rt at nCnt<\last
-      \advance\rt at nCnt\@ne
-      \do{\rt at prior\useRanTok{\the\rt at nCnt}\rt at post
+    \edef\lessone{\the\@tempcnta}\@whilenum\@tempcntb<\last
+      \advance\@tempcntb\@ne
+%    \end{macrocode}
+%    There is one example of this command getting confused and printing the wrong
+%    number of items. Here, we pass the optional argument of \cs{useRanTok} and that
+%    cleared up the problem.
+%    \changes{v1.3.2}{2021/05/25}{Insert optional argument for \string\cs{useRanTok}
+%       within \string\cs{displ at yListRandomly}}
+%    \begin{macrocode}
+      \do{\rt at prior\useRanTok[#2]{\the\@tempcntb}\rt at post
     }\fi
-  \egroup
+  \endgroup
 }
 %</package>
 %<*dbapp>
@@ -866,10 +886,11 @@
   \def\rt at STOP{\relax}%
 %    \end{macrocode}
 %We use the randomized list for the \ameta{name}
-%\begin{verbatim}
-% \@nameuse{#1-List} is the randomized list: eg,
-% \\{3}\\{2}\\{4}\\{5}\\{1}
-%\end{verbatim}
+\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
+%commandchars={!()},codes={\catcode`\%=9}]
+%\@nameuse{#1-List} is the randomized list: eg,
+%\\{3}\\{2}\\{4}\\{5}\\{1}
+%\end{Verbatim}
 %    \begin{macrocode}
   \let\\\relax\edef\x{\@nameuse{#1-List}}%
   \toks@=\expandafter{\x}\let\\\getR at nIndx

Modified: trunk/Master/texmf-dist/tex/latex/ran_toks/ran_toks.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/ran_toks/ran_toks.sty	2021-06-07 20:06:53 UTC (rev 59514)
+++ trunk/Master/texmf-dist/tex/latex/ran_toks/ran_toks.sty	2021-06-07 20:07:17 UTC (rev 59515)
@@ -19,7 +19,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \NeedsTeXFormat{LaTeX2e}[1997/12/01]
 \ProvidesPackage{ran_toks}
- [2021/01/19 v1.3.1 Randomizing tokens (dps)]
+ [2021/06/06 v1.4 Randomizing tokens (dps)]
 \RequirePackage{verbatim}
 \@ifundefined{nextrandom}{\input{random.tex}}{}
 \def\nextrandom{\begingroup
@@ -191,8 +191,8 @@
 \newcommand{\useRTName}[1]{\gdef\rt at BaseName{#1}}%
 \let\rt at BaseName\@empty
 \newcommand{\bRTVToks}[1]{\rt at nCnt\z@\useRTName{#1}}
-\newcommand{\eRTVToks}{\global
-  \rt at nameedef{\rt at BaseName Cnt}{\the\rt at nCnt}\expandafter
+\newcommand{\eRTVToks}{%
+  \global\rt at nameedef{\rt at BaseName Cnt}{\the\rt at nCnt}\expandafter
   \r at nVToks\expandafter{\rt at BaseName}}
 \def\reVerbEnd{\ifhmode\unskip\fi}
 \def\rtVWHook#1{\def\@rgi{#1}\ifx\@rgi\@empty
@@ -219,6 +219,10 @@
   \immediate\write\rt at Verb@write{\string\reVerbEnd}%
   \immediate\closeout\rt at Verb@write
 }
+\let\rtVWi\rtVW % dps5-29
+\let\endrtVWi\endrtVW
+\let\rtVWii\rtVW % dps5-29
+\let\endrtVWii\endrtVW
 \def\r at nVToks#1{\begingroup
   \gdef\rt at BaseName{#1}%
   \expandafter\rt at nMax\@nameuse{#1Cnt}%
@@ -314,22 +318,22 @@
   \egroup
   \rt at next
 }
-\newcommand{\displayListRandomly}[1][]{\bgroup
+\newcommand{\displayListRandomly}[1][]{\begingroup
   \def\rt at prior{#1}\displ at yListRandomly
 }
-\newcommand{\displ at yListRandomly}[2][]{\rt at nCnt\z@\expandafter
-  \ifx\csname nMax4#2\endcsname\relax
+\newcommand{\displ at yListRandomly}[2][]{\@tempcntb\z@  % dps5-29
+  \expandafter\ifx\csname nMax4#2\endcsname\relax
     \rt at rgi\space\textbf{??}\rt at badTokName{#2}#1%
   \else
     \rt at recordingfalse
-    \def\rt at post{#1}\useRTName{#2}\let\i\rt at nCnt
+    \def\rt at post{#1}\useRTName{#2}\let\i\@tempcntb
     \def\first{1}\edef\last{\@nameuse{nMax4#2}}\@tempcnta\last
     \advance\@tempcnta\m at ne
-    \edef\lessone{\the\@tempcnta}\@whilenum\rt at nCnt<\last
-      \advance\rt at nCnt\@ne
-      \do{\rt at prior\useRanTok{\the\rt at nCnt}\rt at post
+    \edef\lessone{\the\@tempcnta}\@whilenum\@tempcntb<\last
+      \advance\@tempcntb\@ne
+      \do{\rt at prior\useRanTok[#2]{\the\@tempcntb}\rt at post
     }\fi
-  \egroup
+  \endgroup
 }
 \endinput
 %%

Modified: trunk/Master/texmf-dist/tex/latex/ran_toks/rt-dbapp.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/ran_toks/rt-dbapp.def	2021-06-07 20:06:53 UTC (rev 59514)
+++ trunk/Master/texmf-dist/tex/latex/ran_toks/rt-dbapp.def	2021-06-07 20:07:17 UTC (rev 59515)
@@ -70,6 +70,7 @@
    question}}
 \def\xdb at unique#1{\@tempcnta\z@
   \def\rt at STOP{\relax}%
+\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,
   \let\\\relax\edef\x{\@nameuse{#1-List}}%
   \toks@=\expandafter{\x}\let\\\getR at nIndx
   \the\toks@\\\rt at STOP



More information about the tex-live-commits mailing list.