I am creating a student workbook. There are ~30 chapters, each containing ~20 activities, called "Activity A", "Activity B", and so on.
The `workbook.tex` itself uses a recurse function, so it prints chapter 1-30. The reason I use this, is if I need to do a fast test of the code, I can compile a specific range of chapters, not the whole workbook.
\define\activityA{}
\define\activityB{}
\dostepwiserecurse{1}{30}{1}{
\chapter{\recurselevel}
\activityA
\activityB
}
\activityA prints the workbook activity "Activity A".
\activityB prints the workbook activity "Activity B".
The problem comes in that some activities have varied versions. Just as an example, "Activity C might be a crossword puzzle in some chapters, but a word search in other chapters. My poor solution has been to use registercyclist:
\define\altCa{print a crossword}
\define[3]\altCb{print a word search}
\registercyclelist{activityClist}{\altCa, \altCb{}{}{}, \altCb{}{}{}}
\define\activityC{%
\usecyclelist{activityClist}
}
This code works okay, but becomes broken if I try to change the page range in `dostepwiserecurse` when testing my code. The other problem is the syntax is super messy. Within this single line, tones of data is crammed in:
\registercyclelist{activityClist}{\altCa, \altCb{}{}{}, \altCb{}{}{}}
...not only is it not easy to read which chapter gets which activity, I also have to fill in the {}{}{} with data, making it more difficult to read.
How can I create a much cleaner, human-readable syntax for storing this? Is there some simpler way to tell ConTeXt Chapter 1 gets one variant, Chapter 2, 3, and 4 get another, etc.?