What I've been trying to do, futilely, is to use the foreach[counter=\xi] x in {1,2,3} statement in tikz/pgf with LaTeX. This fails, every time. Whatever. So I moved on to trying to use a counter, surely that would work. Here's a MWE that fails unexpectedly.
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\newcommand{\test}[1]{
\newcounter{i}
\setcounter{i}{0}
\foreach \x in #1
{
\draw (0,\i) -- (1,0);
\setcounter{i}{\i+1}
}
}
\begin{tikzpicture}
\test{{1,2,3}}
\end{tikzpicture}
\end{document}
This code, at least for me, produces

Can anyone explain why? How I would fix this, or how I could actually get foreach[counter=\xi] to work without returning an \inaccessible exception upon compilation in pdfLaTeX

\xias counter variable is not a good idea, at least if you also want to use the Greek letter ΞΎ in your document (which becomes inaccessible after running the loop). – Caramdir Nov 26 '10 at 23:44