I've got an expansion issue with the following code:
\def\sizes{huge, LARGE, Large, large, normalsize, small, footnotesize, scriptsize, tiny}
\forcsvlist\sampletext{\sizes}
My problem is that \sizes should be expanded before being passed to \forcsvlist, otherwise \sampletext will simply receive the list and not know how to parse it.
How can I make it so that \sizes is expanded?
Note: Putting the list hardcoded in the \sampletext call works, but I don't want to do that because I might override \sizes with other values.
\expandafteris still something a bit hard for me to grasp. I don't get why I have to use 3 of them. – raphink Jul 05 '11 at 15:48\xto expand to\endgroup\forcsvlist{<full expansion of \sizes>}; executing\xwill close the group started with\begingroupand do\forcsvlist. – egreg May 08 '14 at 07:25\noexpandis put before{\sizes}? I generally think I need not a\noexpandbefore{\sizes}, because I can let\edefto expand the{\sizes}to{<full expansion of \sizes>}. – ollydbg23 May 08 '14 at 07:50\noexpand! Well, it was supposed to be in front of\sampletext. Thanks for noting. – egreg May 08 '14 at 17:48