5

I'm trying to reproduce the following figure:

enter image description here

But the only thing i was able to do so far is (but i'm not able to change the curly brackets colors nor the put multiple tables in a same curly bracket):

\documentclass[11pt]{report}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{array, multirow, bigdelim, makecell, booktabs} 

\begin{document}

\begin{center}
\renewcommand{\theadfont}{\normalsize\bfseries}
\begin{tabular}{c c c c l}
\cmidrule{2-4}
& $1$ & $2$ & $3$ & \hspace{0.3em}\rdelim\}{11}{*}[Discernable ($A\neq B$)]\\
\cmidrule{2-4}
\ldelim\{{9}{*}[$9$ distinct states] & $AB$ & $\ldots$ & $\ldots$  \\
& $\ldots$ & $AB$ & $\ldots$ \\
& $\ldots$ & $\ldots$ & $AB$ \\
& $A$ & $B$ & $\ldots$ \\
& $B$ & $A$ & $\ldots$ \\
& $A$ & $\ldots$ & $B$ \\
& $B$ & $\ldots$ & $A$ \\
& $\ldots$ & $A$ & $B$ \\
& $\ldots$ & $B$ & $B$ \\
\end{tabular}
\end{center}

\end{document}

Thanks for your help...

2
  • Should the captions really be part of the braced area? Commented Mar 5, 2023 at 21:15
  • No. I don't think it's useful for my purpose. Commented Mar 5, 2023 at 21:36

2 Answers 2

6

You can do this with tikzmark.

enter image description here

Place each table in a tikzmarknode with a different name. Then you can create a tikzpicture with options overlay, remember picture and draw braces using TikZ. The decorations.pathreplacing library is useful with the built-in brace style. The vertical line can be drawn similarly.

\documentclass[11pt]{report}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{array, multirow, bigdelim, makecell, booktabs} 
\usepackage{tikz}
\usetikzlibrary{tikzmark, decorations.pathreplacing, arrows.meta}

\tikzset{mybrace/.style={decorate, decoration={brace, amplitude=2mm}, red, thick}}

\begin{document}

\begin{center}
\renewcommand{\theadfont}{\normalsize\bfseries}
\tikzmarknode[outer xsep=1mm]{A}{\begin{tabular}{c c c}
\midrule
$1$ & $2$ & $3$\\
\midrule
$\ldots$ & $AB$ & $\ldots$ \\
$\ldots$ & $\ldots$ & $AB$ \\
$A$ & $B$ & $\ldots$ \\
$B$ & $A$ & $\ldots$ \\
$A$ & $\ldots$ & $B$ \\
$B$ & $\ldots$ & $A$ \\
$\ldots$ & $A$ & $B$ \\
$\ldots$ & $B$ & $B$ 
\end{tabular}}

\vspace{5mm}
\tikzmarknode[outer xsep=1mm]{B}{\begin{tabular}{c c c}
\midrule
$1$ & $2$ & $3$\\
\midrule
$AA$ & $\ldots$ & $\ldots$ \\
$\ldots$ & $AA$ & $\ldots$ \\
$\ldots$ & $\ldots$ & $AA$ \\
$A$ & $A$ & $\ldots$ \\
$A$ & $\ldots$ & $A$ \\
$\ldots$ & $A$ & $A$
\end{tabular}}

\vspace{5mm}
\tikzmarknode[outer xsep=1mm]{C}{\begin{tabular}{c c c}
\midrule
$1$ & $2$ & $3$\\
\midrule
$A$ & $A$ & $\ldots$ \\
$A$ & $\ldots$ & $A$ \\
$\ldots$ & $A$ & $A$
\end{tabular}}
\end{center}


\begin{tikzpicture}[overlay, remember picture]
\draw[mybrace](A.south west)--node[left=2mm, text=black]{9 different states}(A.north west);
\draw[mybrace](B.south west)--node[left=2mm, text=black]{6 different states}(B.north west);
\draw[mybrace](C.south west)--node[left=2mm, text=black]{3 different states}(C.north west);
\draw[mybrace](B.north east)--node[right=2mm, text=black]{Indistinguishable}(B.north east|-C.south east);
\draw[thick, red, Latex-]([xshift=-3.5cm]C.south west)--
    node[sloped, above, align=center, text=black]{Some long text\\on two lines}([xshift=-3.5cm]C.south west|-A.north west);
\end{tikzpicture}

\end{document}
1
  • Wow! That's indeed not trivial solution. I wouldn't have been able to do it so properly without spending weeks and even months maybe... Thx a lot for your help Commented Mar 5, 2023 at 23:15
6

In one TikZ picture:

  • matrix for the delimiters,
  • fit to find the border of two nodes,
  • positioning for the below=of … (see node distance) and
  • arrows.meta for the Triangle tip.

Code

\documentclass[tikz]{standalone}
\tikzset{
  @/.style 2 args={
    #1 Delimiter/.style 2 args={append after command={
      \bgroup[every #2 delimiter/.append style={##2}]
        nodealso[#2 delimiter={##1}](\tikzlastnode)\egroup}}},
  @/.list={{Left}{left}, {Right}{right}}}
\usetikzlibrary{arrows.meta, fit, positioning, matrix}
% An alternative to Left Delimiter and Right Delimiter:
%\DeclareDocumentCommand{\tikzbrace}{m O{} m}{
%  \path[every #1 delimiter/.append style={#2}] node also[#1 delimiter={#3}]}
\begin{document}
\begin{tikzpicture}[
  node distance=.5cm,
  every delimiter/.append style=red,
  braced/.style={inner xsep=+0pt}]
\node[
  braced,
  Left Delimiter =\{{label=left:9 different states},
  Right Delimiter=\}{label={[name=Dis]right:Discernables ($A \neq B$)}}
] (mb) {$
\begin{array}{ccc}
  \hline
  1      & 2      & 3      \\ \hline
  AB     & \cdots & \cdots \\
  \cdots & AB     & \cdots \\
  \cdots & \cdots & AB     \\
  A      & B      & \cdots \\
  B      & A      & \cdots \\
  A      & \cdots & B      \\
  B      & \cdots & A      \\
  \cdots & A      & B      \\
  \cdots & B      & A      \\ \hline
\end{array}$};

\node[
  braced, below=of mb,
  Left Delimiter=\{{label=left:6 different states}
] (be) {$
\begin{array}{ccc}
  \hline
  1      & 2      & 3      \\ \hline
  AA     & \cdots & \cdots \\
  \cdots & AA     & \cdots \\
  \cdots & \cdots & AA     \\
  A      & A      & \cdots \\
  A      & \cdots & A      \\
  \cdots & A      & A      \\ \hline
\end{array}$};

\node[
  braced, below=of be,
  Left Delimiter=\{{label=left:3 different states}
] (fd) {$
\begin{array}{ccc}
  \hline
  1      & 2      & 3      \\ \hline
  A      & A      & \cdots \\
  A      & \cdots & A      \\
  \cdots & A      & A      \\ \hline
\end{array}$};

\node[
  fit=(be)(fd),
  inner sep=+0pt,
  Right Delimiter=\}{label=right:{Indistignuishable ($A = B$)}}]{};

\node[align=left, anchor=north west] at (mb.north-|Dis.west) {
  Example:\\
  Two particles: $A$ and $B$\\
  Three states: 1, 2 and 3};
\draw[red, thick, -Triangle] (current bounding box.north west)
 -- node[above, black, rotate=90, align=center] {
   More restrictive: when a particle is in a negative state,\\
   less states are available for the other particles.
 } (current bounding box.south west);

% Here's the alternative to Left Delimiter and Right Delimiter:
%\tikzbrace{left} [label=left:9 different states]         \{ (mb);
%\tikzbrace{right}[label=right:Discernables ($A \neq B$)] \} (mb);
%\tikzbrace{left} [label=left:6 different states]         \{ (be);
% and so one …
\end{tikzpicture}
\end{document}

Output

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .