| 1 |
The ran_toks Package |
| 2 |
Author: D. P. Story |
| 3 |
Dated: 2021-06-06 |
| 4 |
|
| 5 |
This short package, with minimal requirements, defines macros for |
| 6 |
randomizing a list of tokens. There are two approaches: |
| 7 |
|
| 8 |
1. \ranToks{myList}{ {One}{Two}{Three}{Four}{Five} }: Here the token |
| 9 |
list occurs as the argument of the \ranToks command. myList is the |
| 10 |
name of this list. The tokens can be anything that \TeX accepts as |
| 11 |
a macro argument, this excludes \verb, for example. |
| 12 |
|
| 13 |
2. Another construct writes verbatim to the disk, so the tokens can |
| 14 |
be of arbitrary size, and include \verb and the verbatim |
| 15 |
environment, for example, |
| 16 |
|
| 17 |
\bRTVToks{myStuff} |
| 18 |
\begin{rtVW} |
| 19 |
The inline answer is \verb!x^3! |
| 20 |
\end{rtVW} |
| 21 |
\begin{rtVW} |
| 22 |
This is my stuff, leave it alone! |
| 23 |
\end{rtVW} |
| 24 |
... |
| 25 |
\begin{rtVW} |
| 26 |
The verbatim listing is |
| 27 |
\begin{verbatim} |
| 28 |
\bRTVToks{myStuff} |
| 29 |
... (missing stuff) |
| 30 |
\eRTVToks |
| 31 |
\end{verbatim} |
| 32 |
\end{rtVW} |
| 33 |
\eRTVToks |
| 34 |
|
| 35 |
To actually see the randomized list, use the \useRanTok{num} command: For |
| 36 |
myList, we would write \useRanTok{1}, \useRanTok{2}, \useRanTok{3}, |
| 37 |
\useRanTok{4}, and {\useRanTok{5}} to obtain a random listing of the |
| 38 |
tokens in the myList list. |
| 39 |
|
| 40 |
For users of AeB or eqexam, the latter structure can be used to randomize |
| 41 |
the order of the questions on a quiz or exam. |
| 42 |
|
| 43 |
What's New (2021-06-06) Added support for nested \bRTVToks/\eRTVToks command |
| 44 |
pairs. Demo files: ran_toks.tex and nested-matching.tex. |
| 45 |
|
| 46 |
What's New (2021-01-19) A new option, usedbapp, was added to support a DB |
| 47 |
application. Extensive work was done on the DB application. Added |
| 48 |
\uniqueXDBChoicesOn, which if expanded, tries to choose a random token that |
| 49 |
has not already been chosen, across versions of a multi-version eqexam |
| 50 |
document. Changes are discussed in the documentation and in the new |
| 51 |
examples in the distribution. |
| 52 |
|
| 53 |
What's New (2019-12-28) Defined \rtVWHook to insert at the top of the |
| 54 |
rtVW environment. Also created an alternate package name of ran-toks. |
| 55 |
|
| 56 |
What's new in v1.1: Added the convenience command \useTheseDBs to input files |
| 57 |
for an application to constructing exams (using eqexam) from a series of DB |
| 58 |
files. Refer to the new demo file mc-db.tex. |
| 59 |
|
| 60 |
Enjoy! |
| 61 |
|
| 62 |
Now, I must get back to my retirement. |
| 63 |
|
| 64 |
dps |
| 65 |
|