4

After reading many related questions here about "Missing number, treated as zero", I still do not understand why the following example results in such an error message:

\documentclass[11pt]{article} 

\usepackage{tikz}
\begin{document}



\begin{figure}
\begin{tikzpicture}

\clip(2.5,-1.5) rectangle (6,2);
\draw(4+{sin(0)}, {cos(0)}) circle(4pt);

\end{tikzpicture}
\end{figure}

\end{document}

1 Answer 1

6

Change 4+{sin(0)} to {4+sin(0)}. The mathematics routines only apply to stuff inside curly brackets.

2
  • 1
    Your solution is correct, but the rationale is wrong: try, for example, \draw (4+0,0) circle (4pt);: math expressions work fine without curly braces. The curly braces are required around the entire expression if and only if it contains parentheses. Commented Feb 23, 2015 at 18:29
  • 1
    @PaulGessler That condition is a suffucient one. Not necessary ;)
    – percusse
    Commented Feb 25, 2015 at 18:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .