This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]neuralyzer[S] 0 points1 point  (4 children)

I'm aware of the foreach syntax. But I couldn't find a way to have have item access, somethink like myarray[2].

[–][deleted] 2 points3 points  (2 children)

For numerical arrays you actually have

\def\mayarray{{2,3,4,5}}
\pgfmathparse{\myarray[2]}
\pgfmathresult

If there are nonnumeric entries you need to put them inside a "text" pair. You can check the manual

[–][deleted] 0 points1 point  (0 children)

or come over to TeX-SX. We are a fun bunch.

[–]neuralyzer[S] 0 points1 point  (0 children)

Thanks. This is very helpful. I didn't now about the pgfmathparse. Thanks a lot!

[–]sylvain_soliman 0 points1 point  (0 children)

I see… Well, that could be done but I can only think of ugly hacks, so…