I'd like to write a single file with a collection of e.g. questions, but I want to produce various outputs with a different subsets of all questions each.
So at the beginning of my file I want to state which subset should be printed and I just get the according output.
I found this useful question and came up with the following MWE:
\documentclass{article}
\usepackage{etoolbox}
%% toggles
\newtoggle{A}
\newtoggle{B}
\newtoggle{C}
%% chosen toggle
\toggletrue{C}
\newcommand{\question}[2]{%
\ifboolexpr { #1 } { #2 }{}
}
\begin{document}
\question { togl {A} or togl {B} } {
Question is part of subset A or subset B!
}{}%
\question { togl {A} or togl {C} } {
Question is part of subset A or subset C!
}{}%
\end{document}
which gets a little clumsy, the more questions and subsets I got. So I actually just want to write
\question { A,B } {Question is part of subset A or subset B!}%
Can this be done?
There seems to be the possibilty to use any to expand the macro, but I can't get it work with the toggles, or at least it doesn't shorten the code.


\ifboolexprstuff. I think, it could be easier withexpl3to extend this – Apr 19 '16 at 17:21etoolboxhas the means to handle csv lists so it should be doable. (I'm not at home right now so I can't test at the moment, though) – cgnieder Apr 19 '16 at 17:43