Group of tabulars under one table reference
I suggest you load the subcaption
package, which provides an environment called subtable
. To (more or less) replicate the structure shown in the screenshot you posted, you could set up three subtable
environments, each with its own \caption
, inside the overall table
environment. In the code below, each subtable
contains two tabular
environments.
\documentclass{article} % or some other, more suitable document class
\usepackage{array} % for '\extrarowheight' macro
\usepackage{subcaption} % for 'subtable' environment
\begin{document}
\begin{table}[!htb]
\setlength{\extrarowheight}{1pt} % for a more open "look"
\centering
\begin{subtable}{.55\linewidth} % choose width suitably
\begin{tabular}{|c|c|} % 1st tabular
\multicolumn{2}{c}{$G$}\\
\hline
Vertex & Label\\
\hline
b & 1 \\
c & 1 \\
d & 1 \\ \hline
\end{tabular}%
\hfill % maximize distance between adjacent tabulars
\begin{tabular}{|c|c|} % 2nd tabular
\multicolumn{2}{c}{$H$}\\
\hline
Vertex & Label\\
\hline
c & 1 \\
a & 1 \\
d & 1 \\ \hline
\end{tabular}
\smallskip
\caption{$M=\{a,b\}$}
\end{subtable}
\vspace{5mm} % insert a bit of vertical whitespace
\begin{subtable}{.55\linewidth}
\begin{tabular}{|c|c|}
\multicolumn{2}{c}{$G$}\\
\hline
Vertex & Label\\
\hline
c & 11 \\
d & 10 \\ \hline
\end{tabular}%
\hfill
\begin{tabular}{|c|c|}
\multicolumn{2}{c}{$H$}\\
\hline
Vertex & Label\\
\hline
a & 11 \\
d & 11 \\ \hline
\end{tabular}
\smallskip
\caption{$M=\{ab,bc\}$}
\end{subtable}
\vspace{5mm}
\begin{subtable}{.55\linewidth}
\begin{tabular}{|c|c|}
\multicolumn{2}{c}{$G$}\\
\hline
Vertex & Label\\
\hline
d & 101 \\ \hline
\end{tabular}%
\hfill
\begin{tabular}{|c|c|}
\multicolumn{2}{c}{$H$}\\
\hline
Vertex & Label\\
\hline
d & 110 \\ \hline
\end{tabular}
\smallskip
\caption{$M=\{abc,bca\}$}
\end{subtable}
\caption{Labels on the non-mapped vertices of $G$ and $H$, for selected choices of mapping $M$}
\end{table}
\end{document}
It is also possible to build these tabulars using cals and one calstable
. By defining shortcuts for removing cell border, it is convinient to remove the necessary borders around the cells. Of cause, sub-labels are ordinary text, so it is not possible to refer to subtable 1(c)
. If you prefer more narrow table, just increase the the divisor when calculating the column width.
\documentclass{article}
\usepackage{cals, caption}
\let\nc=\nullcell % Shortcuts
\let\sc=\spancontent
\begin{document}
\begin{table}[ht]
\begin{calstable}[c] % Centre the tabular
% Defining columns relative to the margin
\colwidths{{\dimexpr(\columnwidth)/5\relax} % Increase 5 to 6 or 7 to make the tabular more narrow
{\dimexpr(\columnwidth)/5\relax}
{\dimexpr(\columnwidth)/5\relax}
{\dimexpr(\columnwidth)/5\relax}
{\dimexpr(\columnwidth)/5\relax}
}
% Set up the tabular
\makeatletter
\def\cals@framers@width{0.4pt} % Outside frame rules, reduce if the rule is too heavy
\def\cals@framecs@width{0.4pt}
\def\cals@bodyrs@width{0.4pt}
\def\cals@cs@width{0.4pt} % Inside rules, reduce if the rule is too heavy
\def\cals@rs@width{0.4pt}
\def\tb{\ifx\cals@borderT\relax % Top border switch (off-on)
\def\cals@borderT{0pt}
\else \let\cals@borderT\relax\fi}
\def\bb{\ifx\cals@borderB\relax % Botton border switch (off-on)
\def\cals@borderB{0pt}
\else \let\cals@borderB\relax\fi}
\def\rb{\ifx\cals@borderR\relax % Right border switch (off-on)
\def\cals@borderR{0pt}
\else \let\cals@borderR\relax\fi}
\def\lb{\ifx\cals@borderL\relax % Left border switch (off-on)
\def\cals@borderL{0pt}
\else \let\cals@borderL\relax\fi}
% R1H1
\brow
\lb\tb\rb\alignC\nc{ltb}
\nc{rtb}\sc{$G$}
\bb\cell{}\bb
\nc{ltb}
\nc{rtb}\sc{$H$}\lb\tb\rb
\erow
% R2B1
\brow
\cell{Vertex}
\cell{Label}
\bb\cell{}\bb
\cell{Vertex}
\cell{Label}
\erow
% R3B2
\brow
\cell{b}
\cell{1}
\bb\cell{}\bb
\cell{c}
\cell{1}
\erow
% R4B3
\brow
\cell{c}
\cell{1}
\bb\cell{}\bb
\cell{a}
\cell{1}
\erow
% R5B4
\brow
\cell{d}
\cell{1}
\bb\cell{}\bb
\cell{d}
\cell{1}
\erow
% R6B5
\brow
\lb\rb\nc{ltb}
\nc{tb}
\nc{tb}
\nc{tb}
\nc{rtb}\sc{(a)}\lb\rb
\erow
% R7B6
\brow
\lb\tb\rb\alignC\nc{ltb}
\nc{rtb}\sc{$G$}
\bb\cell{}\bb
\nc{ltb}
\nc{rtb}\sc{$H$}\lb\tb\rb
\erow
% R8B7
\brow
\cell{Vertex}
\cell{Label}
\bb\cell{}\bb
\cell{Vertex}
\cell{Label}
\erow
% R9B8
\brow
\cell{c}
\cell{11}
\bb\cell{}\bb
\cell{a}
\cell{11}
\erow
% R10B9
\brow
\cell{d}
\cell{10}
\bb\cell{}\bb
\cell{d}
\cell{11}
\erow
% R11B10
\brow
\rb\lb\nc{ltb}
\nc{tb}
\nc{tb}
\nc{tb}
\nc{rtb}\sc{(b)}\rb\lb
\erow
% R12B11
\brow
\lb\tb\rb\alignC\nc{ltb}
\nc{rtb}\sc{$G$}
\bb\cell{}\bb
\nc{ltb}
\nc{rtb}\sc{$H$}\lb\tb\rb
\erow
% R13B12
\brow
\cell{Vertex}
\cell{Label}
\bb\cell{}\bb
\cell{Vertex}
\cell{Label}
\erow
% R14B13
\brow
\cell{d}
\cell{101}
\bb\cell{}\bb
\cell{d}
\cell{101}
\erow
% R15B14
\brow
\lb\rb\bb\nc{ltb}
\nc{tb}
\nc{tb}
\nc{tb}
\nc{rtb}\sc{(c)}\lb\rb\bb
\erow
\makeatletter
\end{calstable}\par % \par to align the tabular
\caption{Labels on the non-mapped vertices of $G$ and $H$ with mapping: Fig (a) $M={a,b}$, Fig. (b) $M={ab,bc}$, and (c) $M={abc, bca}$}
\end{table}
\end{document}