1

I was running a \tikzmath function as shown below:

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary {math}
\usetikzlibrary{calc}   % required for coordinate calculations
\begin{document}
    \begin{tikzpicture} 
        \draw[loosely dashed] (0,0) grid [step=2] (5,5)
\tikzmath{
    function    arcStartPoint(\cx, \cy, \bAngle, \eAngle, \radius)  {
        coordinate \sp; % arc starting point
        \sp = (\cx, \cy) + ({\radius * cos(\bAngle)}, {\radius * sin(\bAngle)});
        { \draw[ultra thick, orange] (\sp) arc (\bAngle:\eAngle:\radius);   };
    };
    arcStartPoint(1, 2, -30, 30, 1);
};
\end{tikzpicture}
\end{document}

and got lots of errors:

l.8 \tikzmath ! Missing \endcsname inserted.

\sp l.15 } ; The control sequence marked should not appear between \csname and \endcsname.

! Extra \endcsname. \tikz@math@next ...ocess@keyword@ \sp =\endcsname

Once I changed \sp to \spt, it worked. Is \sp a reserved word?

0 Answers0