I need an alpha counter in a foreach loop :
\documentclass{article}
\usepackage{tikz}
\makeatletter
\newcommand{\TRAA}[1]{%
% node/angle list
\foreach \x/\y [count=\i from 1] in {#1} {%
\expandafter\xdef\csname Pt@\Alph{\i}\endcsname{\x}
\expandafter\xdef\csname Ang@\Alph{\i}\endcsname{\y}
}
\draw (\Pt@A) -- (\Pt@B) ;
}
\makeatother
\begin{document}
essai
\begin{tikzpicture}
\coordinate (C) at (0,0) ;
\coordinate (B) at (109:7) ;
\TRAA{B/71,C/45}
\end{tikzpicture}
\end{document}
\Alph{}
requires its argument to be a counter, so if you create one (\newcounter{temp}
) in the preamble, then set it (\setcounter{temp}{\i}
) and use it as\Alph{temp}
, the code becomes working. – Sergei Golovan Jan 4 '18 at 11:05