I have look at the answer from @AlainMatthes at Sieve of Eratosthenes in tikz where I have added the suggested extra code:



 % |#1| = 0 
 % |#1| = 1
% |#1| = 2
% |#1| = 3
 % |#1| > 3
\c@pgfmath@countd=\thr@@ \pgf@isaprimetrue
 \divide\c@pgfmath@countb by\c@pgfmath@countd
  \ifnum\c@pgfmath@countb>\c@pgfmath@countd \pgf@unknowntrue
    \multiply\c@pgfmath@countb by\c@pgfmath@countd
  \ifpgf@unknown\advance\c@pgfmath@countd by 2\relax% 


  \foreach \x in {0,...,9}
    \foreach \y in {1,...,10}
    { \draw (\x,\y) +(-.5cm,-.5cm) rectangle ++(.5cm,.5cm);
       \ifnum\nb=1 \def\pgfmathresult{1}
      \node[minimum size= 1cm](last) at (\y-1,\x+1) {\nb};
      \draw[red](last.north west)--(last.south east)
                (last.north east)--(last.south west);


When I compile, I get the following error:

! Undefined control sequence.
l.5 \tkzutil@ifundefined

What am I doing wrong?

closed as too localized by zeroth, Svend Tveskæg, Speravir, T. Verron, Werner Mar 3 '13 at 19:34

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    its not \tkzutil@ifundefined but \pgfutil@ifundefined. Hence, it doesn't recognize tkz...ned. :) I think maybe Alain has defined it in his package tkz-euclid? I don't believe it to be standard. – zeroth Mar 3 '13 at 18:55

Browse other questions tagged or ask your own question.