summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/ran_toks/README.md
blob: ca048779fa629cff82665c4a99f3e5775f1da99e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
The ran_toks Package
Author: D. P. Story
Dated: 2016/02/06 
Version: v1.0e

This short package, with minimal requirements, defines macros for
randomizing a list of tokens.  There are two approaches:

    1.  \ranToks{myList}{ {One}{Two}{Three}{Four}{Five} }: Here the token
        list occurs as the argument of the \ranToks command. myList is the
        name of this list. The tokens can be anything that \TeX accepts as
        a macro argument, this excludes \verb, for example.

    2.  Another construct writes verbatim to the disk, so the tokens can
        be of arbitrary size, and include \verb and the verbatim
        environment, for example,

        \bRTVToks{myStuff}
        \begin{rtVW}
        The inline answer is \verb!x^3!
        \end{rtVW}
        \begin{rtVW}
        This is my stuff, leave it alone!
        \end{rtVW}
        ...
        \begin{rtVW}
        The verbatim listing is
        \begin{verbatim}
        \bRTVToks{myStuff}
        ... (missing stuff)
        \eRTVToks
        \end{verbatim}
        \end{rtVW}
        \eRTVToks

To actually see the randomized list, use the \useRanTok{num} command: For
myList, we would write \useRanTok{1}, \useRanTok{2}, \useRanTok{3},
\useRanTok{4}, and {\useRanTok{5}} to obtain a random listing of the
tokens in the myList list.

For user of AeB or eqexam, the latter structure can be used to randomize
the order of the questions on a quiz or exam.

If the ran_toks.sty file is not provided in the distribution, then tex (not latex)
the file ran_toks.dtx.

Enjoy!

Now, I must get back to my retirement.

dps
2016/02/08