\pic:未定义的控制序列

\pic:未定义的控制序列

我在 Macbook 上使用 Texmaker,但我的代码有问题。当我运行代码时,它总是显示此消息:

“未定义控制序列 \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}

相关内容