Here's basically what I try to do:
\begin{tikzpicture}
\foreach \x in {1,2,3,4,5}
{
\draw (\x,1) node{\Alph{\x}};
}
\end{tikzpicture}
However if I do that, I get
ERROR: Missing number, treated as zero.
I tried to prefix the number with \the
:
\begin{tikzpicture}
\foreach \x in {1,2,3,4,5}
{
\draw (\x,1) node{\Alph{\the\x}};
}
\end{tikzpicture}
and got:
ERROR: You can't use `the character 1' after \the.
After searching around on TeX.SE, I thought the following solution should work:
\begin{tikzpicture}
\foreach \c [count=\x] in {{A},{B},{C},{D},{E}}
{
\draw (\x,1) node{\c};
}
\end{tikzpicture}
However that got me an error that \x
is not defined.
So, how do I get the desired result?
\Alph
takes a counter as an argument, not just a number. Your last methods works fine for me, what version ofpgf
are you using?2.10
, since the last solution should work fine then. If your example is an accurate description of what you want to do then the last solution seems preferrable anyway, in case you want to leave certain letters out and keep consistent spacing.