```tex
\documentclass[tikz]{standalone}
\usetikzlibrary{fit}
\tikzset{%
pics/abc/.style={%
cod...
```tex
\documentclass[tikz]{standalone}
\usetikzlibrary{fit}
\tikzset{%
pics/abc/.style={%
code={
\node {this is some path};
}
}
}
\begin{document}
\begin{tikzpicture}
%fit失败
\foreach \i in {1,...,3} \pic[local bounding box=a\i] at (0,\i) {abc};
\node[draw,fit={(a1)(a2)(a3)}] {};
%fit成功
\pic[local bounding box=a4] at (10,4) {abc};
\pic[local bounding box=a5] at (10,5) {abc};
\pic[local bounding box=a6] at (10,6) {abc};
\node[draw,fit={(a4)(a5)(a6)}] {};
\end{tikzpicture}
\end{document}
```
请问在保留`foreach`语句的条件下,如何让`(a1)(a2)(a3)`成功被`fit`?
一周热门 更多>