I have the following code, but I don't understand why the TikZ code does not accept addition and subtraction operations but accepts multiplication and division operations.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \i in {1,2,3,4,5} {
\node[draw,circle,minimum size=0.2cm,fill=blue!20] () at ({\the\numexpr
72*(\i-1) \relax}:2cm) {\i};
\node[draw,circle,minimum size=1cm,fill=red!20] () at (
\i*360/5:1cm ) {\i};
}
\end{tikzpicture}
\end{document}
It has to go through the following processing {\the\numexpr 72*(\i-1) \relax}
, but \i*360/5
is Ok.
At least addition and subtraction are more basic operations than multiplication and division, why is there such an inconsistent design?
Edits: Many thanks to Cabohah for correcting my mistaken idea. But I have another example, why does the second code show an error.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \i in {1,2,3,4,5} {
\node[draw,circle] (\i) at (72*\i-36:1cm) {$\i$};
}
\foreach \i in {1,2,3,4} {
\draw (\i) -- ({\i+1});
}
\end{tikzpicture}
\end{document}
Package pgf Error: No shape named `1+1' is known. }...
It seems that TikZ does not accept any operation at this time.