
答え1
チェスに特化したものを使っていない限り、私はティックズそれよりもスカックの基本的な考え方はティックズxy 座標のコマンドを使用する方法です\draw
。以下は、2x2 の正方形を塗りつぶす方法の 1 つです。
\documentclass{article}
\usepackage{tikz}
% \BackSquares{ list of south west coordinates of squares to fill }
\newcommand\BlackSquares[1]{
\begin{tikzpicture}
\draw[ultra thick](0,0) rectangle (2,2);
\draw[ultra thick](0,1)--(2,1);
\draw[ultra thick](1,0)--(1,2);
\foreach \sq in {#1} {\draw[fill=black]\sq rectangle ++(1,1);}
\end{tikzpicture}
}
\begin{document}
\BlackSquares{{(0,0)},{(1,0)}}
\BlackSquares{{(0,0)},{(0,1)}}
\BlackSquares{{(0,0)},{(1,1)}}
\BlackSquares{{(1,0)},{(0,1)}}
\end{document}