使用下面的代码时,我遇到extra options not allowed for clipping path command
错误,我该如何解决?
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}
\begin{scope}
\clip[draw=black,postaction={fill=black, draw=white, line width=6mm}] (58,77) rectangle +(9,9);
\clip[postaction={fill=black, line width=6mm}] (61,80) rectangle +(3,3);
\end{scope}
\end{tikzpicture}
\end{document}
答案1
只需使用preaction
。
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}
\begin{scope}
\path[preaction={clip},draw=black,postaction={fill=black, draw=white, line width=6mm}] (58,77) rectangle +(9,9);
\clip[postaction={fill=black, line width=6mm}] (61,80) rectangle +(3,3);
\end{scope}
\end{tikzpicture}
\end{document}
如果preaction
被占用,请记住preaction
可以嵌套。例如
preaction={preaction={scale=1.1},rotate=10}