[Tex/LaTex] Putting two tables inside a table with different captions

captionsfloatssubfloatstables

I need to create a table with two cells, with one further tables inside each cell, and put captions beneath the two subtables (see the attached figure). However, it's my understanding that (i) the table environment cannot be nested (I can nest the tabular environment, but not the table environment, right?); (ii) the subtables environment will give me two different tables, not two tables inside a larger one. Any ideas? It doesn't need to be a "clean" solution…

Incidentally, I'm aware that this looks kinda ugly, but I'm translating that book and so I have to follow the tables very precisely…

Tables inside a table

Best Answer

A very simple solution, using minipage, \fbox, and \captionof from the caption package:

enter image description here

\documentclass{article}

\usepackage{caption}

\begin{document}

\fbox{%
\begin{minipage}{0.5\textwidth}
  \centering
  \begin{tabular}{c@{\(\quad\rightarrow\quad\)}c}
    (frown, calm) & angry\\
    (smile, calm) & happy\\
    \vdots & \vdots
  \end{tabular}
  \captionof{table}{The function F}
\end{minipage}}%
\fbox{%
\begin{minipage}{0.5\textwidth}
  \centering
  \begin{tabular}{c@{\(\quad\rightarrow\quad\)}c}
    (frown, calm) & frown back\\
    (smile, calm) & smile back\\
    \vdots & \vdots
  \end{tabular}
  \captionof{table}{The function G}
\end{minipage}}

\end{document}