I need to iterate over two lists:
\begin{tikzpicture}[x=5mm, y=5mm]
\foreach \x in {0,2,...,8} {
\node[] at (\x, 0) {value};
}
\end{tikzpicture}
The "value" has to be a value from the second list: {2, 3, 5, 7, 11} (yes, these are first five prime numbers).
I know, TeX is not really a programming language, but is there a way to do so?
Nesting foreach doesn't solve the problem:
\foreach \x in {0,2,...,8} {
\foreach \value in {2,3,5,7,11} {
\node[] at (\x, 0) {\value};
}
}
The output looks as expected like this:

Solution (thank you Pier Paolo):
\foreach \x/\value in {0/2,2/3,4/5,6/7,8/11} {
\node[] at (\x, 0) {\value};
}
\foreach \x/\value in {0/2,2/3,4/5,6/7,8/11} \node at (\x,0) {\value};. – Pier Paolo May 20 '15 at 10:02...facility to automatically compute the step and insert all missing values between first and last. – Pier Paolo May 20 '15 at 10:11xvalue all the\valuevalues are evaluated. Hence @PierPaolo's solution is not an alternative it is the only correct one. – percusse May 20 '15 at 11:47