I've been using LaTeX for a while, but only recently I made myself a mission to create a class. I needed to learn the details of TeX, and I couldn't find answers to some of my questions. One of them is:
How can I implement a dynamically allocated array in TeX? One of the environments I defined takes a single parameter such as {1234}. I need to split this into characters, which can be done this way. Then I need to list the numbers such that array=[1,2,3,4].
Then I want to loop the elements of this array and place a single-row tabular environment with i columns for each i in the array.
To make things clearer, here's is my purpose. One will define a choices environment such that:
\begin{choices}{32}
\choice ch1
\choice ch2
\choice ch3
\choice ch4
\choice ch5
\end{choices}
is going to create multiple choices in two rows, 3 for the first and 2 for the second (3+2=5):
A) ch1 B) ch2 C) ch3
D) ch4 E) ch5
This notation is going to help create more flexible choices, with a maximum number of 9 choices per line.