![带标签的方块](https://linux22.com/image/440484/%E5%B8%A6%E6%A0%87%E7%AD%BE%E7%9A%84%E6%96%B9%E5%9D%97.png)
答案1
首先要说的是:
\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
%braces
\draw [] (8.5,0) arc (-80:80:0.2cm and 0.5cm);
\draw [rotate=180] (-0.5,-1) arc (-80:80:0.2cm and 0.5cm);
%draw
\foreach \x in {1,2.5,4,5.5}{
\draw (\x,0) rectangle (\x+1,1);
\node at (\x+1.25,0) {,};
\draw (\x+1.5,0) rectangle (\x+2.5,1);
}
%nodes
\foreach \x \y \z in {1/1/3,2.5/2.5/6,4/4/5,5.5/5.5/4}{
\node [inner sep=0] (A) at (\x+0.5,0) {};
\node [inner sep=0] (B) at (\x+0.5,-\y*0.2) {};
\draw [->] (B) edge (A) node[below] {\tiny $\z$ choices};
}
\end{tikzpicture}
\end{document}
答案2
使用 TikZ 矩阵:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix, positioning}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\matrix[matrix of nodes,
nodes in empty cells,
inner sep=0pt,
nodes={draw, very thick, minimum size = 16pt},
column sep=6pt,
left delimiter={(},
right delimiter={)}]
(mymatr)
{&&&&\\};
\foreach \ind in {1,...,4}
\node[font=\bfseries] at ([xshift=2pt]mymatr-1-\ind.south east) {,};
\foreach \ind \descr in {1/3,2/6,3/5,4/4}{
\node[below=\ind*12pt of mymatr-1-\ind] (u\ind) {\descr\ chioces};
\draw[-Stealth] (u\ind) -- (mymatr-1-\ind);
}
\end{tikzpicture}
\end{document}