1

I am using Texmaker on Macbook but I have a problem with my code. When I run my code it always shows this message:

"undefined control sequence \pic".

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\usepackage{xcolor,pict2e}% to allow any radius

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  \tikzset{pics/myarc/.style args={inner #1 and outer #2 with fill #3}{
  code={
    \draw[very thick, #1] (1,0) arc (0:90:1cm);
    \draw[very thick] (0,1) -- (0,2.2);
    \draw[very thick, #2] (0,2.2) arc (90:0:2.2cm);
    \draw[very thick] (2.2,0) -- (1,0);
    \fill[#3] (1,0) arc (0:90:1cm) -- (0,2.2) arc (90:0:2.2cm) -- cycle;
  }
}}
\begin{document}
\begin{tikzpicture}
\draw[very thick,<->] (-6,0) -- (6,0)node[anchor=north west] {$x$};
\pic [draw,very thick, rotate=-45]      {myarc={inner blue!90 and outer blue with fill green!}};\end{tikzpicture}\end{document}

closed as off-topic by Qrrbrbirlbel, user31729, Symbol 1, user13907, Paul Gessler May 1 '15 at 14:38

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Welcome! What version of MacTeX are you using? If you are not using an updated 2014 installation, update to ensure that you have the current version of TiKZ. In particular, if you are using a version of TiKZ prior to 3, it will not work. – cfr Apr 23 '15 at 3:48
  • Your code compiles fine. You almost certainly just need to update. Also, you don't need to load pict2e. I don't know why your comment says it allows 'any radius'. And xcolor is loaded by tikz already. But none of that is a problem. It still compiles fine. – cfr Apr 23 '15 at 3:51
  • 4
    I'm voting to close this question as off-topic because the problem should have been resolved with an up-to-date distribution and version of TikZ/PGF. – Qrrbrbirlbel May 1 '15 at 14:13

Browse other questions tagged or ask your own question.