2
\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?

Troy
  • 13,741

3 Answers3

1

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.

screenshow

% 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

Mico
  • 506,678
cmhughes
  • 100,947
1
\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}

enter image description here

Mico
  • 506,678
1

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.

enter image description here

\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}
Mico
  • 506,678