In the manual one can find the ...
option to obtain a range in the for-loop. For example:
\foreach \x in {0,0.1,...,6} {\x, }
On the other hand, one can have a for-loop which runs over two variables simultaneously. For example:
\foreach \i / \y in {1/0,2/0.25,3/0.5,4/0.75,5/1} {
\only<\i>{
\draw (0,0) -- (1,0) -- (1,1) -- (0,1) -- cycle;
\draw (0,0) -- (1,\y);
}
}
which can produce some simple "animation" when used along with beamer. My question is how to combine the two. Namely, I would like to have something like:
\foreach \i / \y in {1/0,2/0.25,...,5/1}
which will produce the list (1,0),(2,0.25),(3,0.5),(4,0.75),(5,1). Is there a way to do it?
\foreach \x in {0\pi,0.5\pi,...\pi,3\pi} {$\x$, }
the ... statement have exactly the same pattern, except that, instead of dots, they have a number or a character. So you need to avoid ... in your case but perhaps I'm wrong and a great expert can find a solution. – Alain Matthes Jun 25 '11 at 9:42