\begin{figure}[ht] \centering \begin{tikzpicture}[x=0.85cm,y=0.85cm] \foreach \h in {0,1,2} { \foreach \a in {0,1} { \pgfmathtruncatemacro{\R}{2*\h+\a} \foreach \g in {0,1,2} { \foreach \b in {0,1} { \pgfmathtruncatemacro{\C}{2*\g+\b} \pgfmathtruncatemacro{\j}{mod(\g-\h-\a*(1-\b)+6,3)} \ifnum\j=0 \def\col{clsA}\fi \ifnum\j=1 \def\col{clsB}\fi \ifnum\j=2 \def\col{clsC}\fi \fill[\col] (\C,-\R) rectangle ++(1,-1); \node at (\C+0.5,-\R-0.5) {$\j$}; } } } } \draw[gray!60] (0,0) grid[step=1] (6,-6); \foreach \t in {0,2,4,6} { \draw[thick] (\t,0) -- (\t,-6); \draw[thick] (0,-\t) -- (6,-\t); } \foreach \g in {0,1,2} { \node[above] at (2*\g+1,0.35) {\small block $\g$}; \node[above,font=\scriptsize] at (2*\g+0.5,-0.05) {lower}; \node[above,font=\scriptsize] at (2*\g+1.5,-0.05) {upper}; \node[left] at (-0.9,-2*\g-1) {\small block $\g$}; \node[left,font=\scriptsize] at (0,-2*\g-0.5) {lower}; \node[left,font=\scriptsize] at (0,-2*\g-1.5) {upper}; } \node[above] at (3,1.0) {column sectors}; \node[rotate=90] at (-3.0,-3) {row sectors}; \end{tikzpicture} \caption{The class $\cls(r, c)$ of a cell as a function of the sector of its row and the sector of its column, for $k = 3$. Each sector is drawn as one square; in the family a lower sector has $s_r$ rows or $s_c$ columns, and an upper sector $m - s_r$ rows or $m - s_c$ columns. Away from the upper rows the class is $h_c - h_r$; in an upper row the lower columns are shifted by one block. Every row sector meets each class in one lower and one upper column sector, which is why $K$ is Latin.} \label{fig:sectors} \end{figure}