答案1
这是循环的一个例子。
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\begin{document}
\tikzset
{triangle/.pic =
{\path[fill] (0,0) -- (-0.3,0.8) -- (0.3,0.8) -- cycle;
}
}
\begin{tikzpicture}
\foreach \y in {0, ..., 7}
{\foreach \x in {-\y, ..., \y}
\pic at (\x,-\y) {triangle};
}
\end{tikzpicture}
\end{document}