# Side by side tables as one figure

\begin{figure}
\begin{minipage}{0.5\textwidth}
\centering
\caption{***}
$\begin{array}{cccccccc} T_1: & c_{12} & & c_{23} & & c_{34} & & c_{45}\\ T_2: & & c_{13|2} & & c_{24|3} & & c_{35|2} & \\\hline T_3: & & &\pi_{14|23}& &\pi_{25|34}& & \\ T_4: & & & &\pi_{15|234}& & & \\ \end{array}$
\end{minipage}
\begin{minipage}{0.5\textwidth}
\caption{***}
$\begin{array}{cccccccc} T_1: & c_{12} & & c_{23} & & c_{34} & & c_{45}\\ T_2: & & c_{13|2} & & c_{24|3} & & c_{35|2} & \\ T_3: & & &c_{14|23}& &c_{25|34}& & \\\hline T_4: & & & &\pi_{15|234}& & & \\ \end{array}$
\end{minipage}
\end{figure}


This is my code, what's the problem?

(1) I want to have 1 figure (number). So I need a way to place those minipage in 1 environment (table doesn't work).

(2) The 2 arrays are a bit to wide. Can I change the distance between the columns?

• Not that LaTeX minds, but shouldn't you use table rather than figure for tables? – David Carlisle Apr 28 '13 at 17:20

You can adjust arraycolsep before each of your array environments- or else you could set it globally in the preamble.

As for the caption- just put \caption{<stuff>} immediately before the first minipage as demonstrated below.

% arara: pdflatex
% !arara: indent: {overwrite: on}
\documentclass{article}

\begin{document}

\begin{figure}
\caption{Global caption}
\begin{minipage}{0.5\textwidth}
\centering
\caption{***}
\setlength{\arraycolsep}{.5pt}
$\begin{array}{cccccccc} T_1: & c_{12} & & c_{23} & & c_{34} & & c_{45} \\ T_2: & & c_{13|2} & & c_{24|3} & & c_{35|2} & \\ \hline T_3: & & & \pi_{14|23} & & \pi_{25|34} & & \\ T_4: & & & & \pi_{15|234} & & & \\ \end{array}$
\end{minipage}%
\begin{minipage}{0.5\textwidth}
\caption{***}
\setlength{\arraycolsep}{.5pt}
$\begin{array}{cccccccc} T_1: & c_{12} & & c_{23} & & c_{34} & & c_{45} \\ T_2: & & c_{13|2} & & c_{24|3} & & c_{35|2} & \\ T_3: & & & c_{14|23} & & c_{25|34} & & \\ \hline T_4: & & & & \pi_{15|234} & & & \\ \end{array}$
\end{minipage}
\end{figure}

\end{document}


For future reference, you might also like to look at

• Did you mean to remove the two dummy captions? – Mico Apr 28 '13 at 17:55

I don't think it's necessary to place the two array environments inside minipage environments. Reducing the value of the \arraycolsep parameter from 6pt (the default) to 4.5pt, combined with inserting \hspace{\fill} between the two array environments, should be enough to allow the two arrays to be typeset side by side -- assuming more-or-less standard values for page sizes and margins.

\documentclass{article}
\usepackage[margin=1in]{geometry}
\setlength\arraycolsep{4.5pt} % default is 6pt
\begin{document}
\begin{table}
\caption{***} \label{tab:threestars}

\bigskip
$\begin{array}{@{} *{8}{c} @{}} T_1: & c_{12} & & c_{23} & & c_{34} & & c_{45}\\ T_2: & & c_{13|2} & & c_{24|3} & & c_{35|2} & \\ \hline T_3: & & &\pi_{14|23}& &\pi_{25|34}& & \\ T_4: & & & &\pi_{15|234}& & & \\ \end{array}$
\hspace{\fill}
$\begin{array}{@{} *{8}{c} @{}} T_1: & c_{12} & & c_{23} & & c_{34} & & c_{45}\\ T_2: & & c_{13|2} & & c_{24|3} & & c_{35|2} & \\ T_3: & & &c_{14|23}& &c_{25|34}& & \\ \hline T_4: & & & &\pi_{15|234}& & & \\ \end{array}$
\end{table}
\end{document}

\documentclass{article}
\begin{document}

\setlength{\arraycolsep}{0pt} %rather a little bit more

\begin{figure}
\caption{***}
\begin{minipage}{0.5\textwidth}
\centering
%\caption{***}
$\begin{array}{cccccccc} T_1: & c_{12} & & c_{23} & & c_{34} & & c_{45}\\ T_2: & & c_{13|2} & & c_{24|3} & & c_{35|2} & \\ \hline T_3: & & &\pi_{14|23}& &\pi_{25|34}& & \\ T_4: & & & &\pi_{15|234}& & & \\ \end{array}$
\end{minipage}
\begin{minipage}{0.5\textwidth}
%\caption{***}
$\begin{array}{cccccccc} T_1: & c_{12} & & c_{23} & & c_{34} & & c_{45}\\ T_2: & & c_{13|2} & & c_{24|3} & & c_{35|2} & \\ T_3: & & &c_{14|23}& &c_{25|34}& & \\ \hline T_4: & & & &\pi_{15|234}& & & \\ \end{array}$
\end{minipage}
\end{figure}

\end{document}


• Seems nice! Is there a possibility to put a title above each array (without figure (number):*** or table (number):***). – user22962 Apr 28 '13 at 20:11
• A title as a simple string may appear, as the other elements, in the minipage environment. – Przemysław Scherwentke Apr 28 '13 at 21:04