Varias tablas con llaves de color rojo

Varias tablas con llaves de color rojo

Estoy intentando reproducir la siguiente figura:

ingrese la descripción de la imagen aquí

Pero lo único que pude hacer hasta ahora es (pero no puedo cambiar los colores de las llaves ni poner varias tablas en una misma llave):

\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}

Gracias por tu ayuda...

Respuesta1

Puedes hacer esto con tikzmark.

ingrese la descripción de la imagen aquí

Coloque cada tabla en un tikzmarknodecon un nombre diferente. Luego puedes crear un tikzpicturecon opciones overlay, remember picturey dibujar llaves usando TikZ. La decorations.pathreplacingbiblioteca es útil con el estilo integrado brace. La línea vertical se puede trazar de manera similar.

\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}

Respuesta2

En una imagen de TikZ:

  • matrixpara los delimitadores,
  • fitpara encontrar el borde de dos nodos,
  • positioningpara below=of …(ver node distance) y
  • arrows.metapor la Trianglepropina.

Código

\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}

Producción

ingrese la descripción de la imagen aquí

información relacionada