I am trying to learn how to use Tikz and its library Tikzmath to make graphics. I am trying to practice by drawing a series of circles along a line.
My code is as follows:
\documentclass[tikz]{standalone}
\usetikzlibrary{math}
\tikzmath
{
function num(\n)
{
int \i;
\i=0;
for \i in {\i,1,...,\n}
{
\draw[red] circle[radius=0.5] (\i, 0);
};
};
}
\begin{document}
\begin{tikzpicture}
\draw[help lines,step=2mm] (-1,-1) grid (4,1);
\tikzmath{num(2);}
\end{tikzpicture}
\end{document}
However I keep getting an error message that states:
.Math.tex.swp:20: Argument of \tikz@@math has an extra }.
\par
l.20 \tikzmath{num(2);}
I cannot find any extra braces in my code that might be causing this error. I have been trying for the past 40 minutes!
\tikzmath{{num(2)};}which is found in http://tex.stackexchange.com/questions/41828/using-math-in-tikz. So, you have two issues. First, your installation of tikz is out of date; so, it is time for a complete update of your LaTeX system. Second, this is probably a duplicate question. – R. Schumacher Jul 27 '15 at 03:28tikzmathis notcalc. – Kpym Jul 31 '15 at 07:18