This question is similar to TikZ \foreach loop with macro-defined list but here I'd like the macro-defined list to take an argument.
For example, in the following MWE:
\documentclass{article}
\usepackage{pgffor}
\begin{document}
\begin{description}
\item[Macro without argument]
\newcommand{\macrowithoutargument}{0,...,10}%
\foreach \x in \macrowithoutargument {[\x]}
\item[Macro with argument]
\newcommand{\macrowithargument}[1]{#1,...,10}%
% \foreach \x in \macrowithargument{1} {[\x]}
\end{description}
\end{document}
the \foreach loop with:
- macro-without-argument-defined list (
\macrowithoutargument)works like a charm, - macro-with-argument-defined list (
\macrowithargument{1}) fails.
Please note that I'm stick with TikZ's \foreach loops: the previous MWE is a minimization of a problem I encounter with TikZ picture where I'd like to draw just a part of a protactor, with the start and end angles given as arguments of a macro.
Hence my question: is it possible for the TikZ's \foreach loop list to be defined with a macro that takes argument(s)?
\edef\tmp{\macrowithargument{1}} \foreach \x in \tmp {[\x]}– Steven B. Segletes Nov 17 '16 at 19:29\foreachis programmed to accept either a list, or a macro without arguments that produces a list. – Pieter van Oostrum Nov 17 '16 at 20:02\VoltageCurvecommand in http://tex.stackexchange.com/questions/339611/improving-tikz-coordinate-system-voltage-curve/339625#339625 ? – Nov 17 '16 at 20:22