# How can I fix “Missing \endcsname inserted.” in tikz?

So I'm very new to tikz and I'm trying to create a pattern using a for loop.

\foreach \k in {60,120,180,240,300}
\filldraw[fill=green!20,draw=anglecolor] (0,0) -- ({\k - 60}:0.35) arc [start angle=\k-60, end angle=\k, radius=0.35];
\draw (\k - 30:2.2mm) node[anglecolor] {$\theta_r$};
\draw[very thick, color=tancolor] (0,0) -- (\k:1);


Unfortulately, I get an error saying Missing \endcsname inserted. on the third line. I am using lualatex and I know that all my custom variables (anglecolor, tancolor) are properly defined. How can I fix this error?

• compare ({\k - 60}:0.35) with (\k - 30:2.2mm) should resolve the issue – js bibra Jun 26 '20 at 15:52
• Unfortunately, that doesn't actually solve the issue... – Kookie Jun 26 '20 at 15:57

You should use curly braces {} to wrap the loop body.
\foreach \k in {60,120,180,240,300}
\draw (\k - 30:2.2mm) node[anglecolor] {$\theta_r$};