
피라미드 그림을 컴파일하는 동안 인식할 수 없는 명령 팝업이 나타납니까? 이유는 무엇이며 어떻게 해결할 수 있나요?
제발, 아래 사진을 참조하세요:
\begin{figure}[!h]
\centering
\tikzset{tri/.style={%
regular polygon,
regular polygon sides=3, %% For fun, vary this number at will
minimum size=#1,
draw,
thick,
anchor=north
},
ptext/.style={font=\bfseries,align=center,text width=0.8*\pyrsize}
}
\NewDocumentCommand{\pyramid}{sO{}mm}{% #3 size; #4 entries
\begin{tikzpicture}
\pgfmathsetmacro{\incrrate}{0.80}% The rate at which the triangles decrease in size
\coordinate (T) at (0,0);
\foreach \test/\testi [count=\testnum from 1] in {#4}{\xdef\tot{\testnum}}%
\pgfmathsetmacro{\incr}{#3/\tot}
\foreach \step/\col [count=\stepnum from 0] in {#4}{%
\pgfmathsetlengthmacro{\pyrsize}{#3-\incrrate*\stepnum*\incr}
\node[tri=\pyrsize,fill=\col] (T\stepnum) at (T) {};
\ifnum\stepnum=\numexpr\tot-1\relax
\pgfmathsetlengthmacro{\lift}{0.0*\incr*\incrrate}% raise text in top shape
\else
\pgfmathsetlengthmacro{\lift}{0.1*\incr*\incrrate}% raise text in remaining shapes
\fi
\node[above=\lift of T\stepnum.south,ptext] {\step\strut};
}%
\end{tikzpicture}%
}
\pyramid{3.0in}{Inner control/green, Primery Control/olive, Secondary control/yellow, Tertiary\\control/orange}
\end{figure}