Tagged Questions
6
votes
3answers
107 views
Expansion issue when adding to CSV list from within a \foreach
Another expansion issue that I am unable to guess at the correct combination of \edef/\expandafters to get to work.
Background:
Below I have defined \AddToCommaSeparateList which uses \g@addto@macro ...
11
votes
1answer
183 views
How to expand a macro used in the range of a foreach loop?
Motivating Example:
Suppose that I want to draw the following tree:
root
/ \
/ \ / \
A B C D
This is easy enough to do by explicitly drawing the two subtrees
as children of ...
6
votes
3answers
143 views
How to “demux” several aspects from a `\foreach` variable with `\ifstrequal`?
How can I "demux" several features from a mode specification given in a \foreach?
I would like to use a \foreach to draw several nodes in a TikZ picture. The loop will specify a mode for each ...
5
votes
2answers
196 views
Preparing macro content in a loop (calling \foreach from \edef)
I need to do something like \def\MyArray{{1, 2, 3, 4}} but with a dynamical number of elements.
The following command makes the string:
\newcommand{\MakeArray}[1]{\{ 1 \foreach \x in {2, ..., #1}{ , ...