Comprehensive TeX Archive Network

Direc­tory macros/latex/contrib/ran_toks


The rantoks Pack­age Author: D. P. Story Dated: 2017/05/04

This short pack­age, with min­i­mal re­quire­ments, de­fines macros for ran­dom­iz­ing a list of to­kens. There are two ap­proaches:

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,
    The inline answer is \verb!x^3!
    This is my stuff, leave it alone!
    The verbatim listing is
    ... (missing stuff)

To ac­tu­ally see the ran­dom­ized list, use the useRanTok{num} com­mand: For myList, we would write useRanTok{1}, useRanTok{2}, useRanTok{3}, useRanTok{4}, and {useRanTok{5}} to ob­tain a ran­dom list­ing of the to­kens in the myList list.

For users of AeB or eqexam, the lat­ter struc­ture can be used to ran­dom­ize the or­der of the ques­tions on a quiz or exam.

What's new in v1.1: Added the con­ve­nience com­mand useTh­e­seDBs to in­put files for an ap­pli­ca­tion to con­struct­ing ex­ams (us­ing eqexam) from a se­ries of DB files. Re­fer to the new demo file mc-db.tex.


Now, I must get back to my re­tire­ment.


Down­load the con­tents of this pack­age in one zip archive (223.2k).

ran_toks – Ran­domise to­ken strings

The pack­age pro­vides means of ran­domis­ing lists of to­kens, or lists of chunks of to­kens. Two mech­a­nisms for defin­ing chunks are pro­vided:

  • the macro \ranToks com­mand ac­cepts an ar­gu­ment con­tain­ing to­kens to be ran­domised; and
  • the \bRTVToks/\eRTVToks com­mands de­limit a col­lec­tion of to­kens for ran­domis­ing; each group in­side a rtVw con­sti­tutes one of these (typ­i­cally larger) to­ken sets.

Li­cense The Project Public Li­cense 1
Copy­right2012 D. P. Story
Main­tainerDon­ald P. Story
Con­tained inTeX Live as ran_toks
MiKTeX as ran_toks
Topics sup­port for de­vel­op­ment of macros
Guest Book Sitemap Contact Contact Author