TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use TikZ/PGF 2.00. In the CVS PGF manual pag. 563 we have

\foreach \i in {0,...,6}{\pgfmathparse{\myarray[\i]}\pgfmathresult, }

My question is: How can do the same but in TikZ/PGF 2.00?

share|improve this question

I think you can use them directly:

\foreach \i/\foo in {0/1, 1/two, 2/{2+1}, 3/IV, 4/cinq, 5/sechs, 6/{sin(6*5)*14}}

or use arrayjobx package insdead.

share|improve this answer
in all cases error. i use pgf/tikz 2.0. and arrayjobx – Regis da Silva Dec 29 '10 at 18:03

With PGF 2.0 you could define the array differently and process it outside of \pgfmathparse.

For example:

\foreach \i in \myarray {\pgfmathparse{\i}\pgfmathresult,}

Or with a loop index:

\foreach \i\element in \myarray {\pgfmathparse{\element}\pgfmathresult,}

I tested both and got


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.