1

If I have a minipage like the following:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow}

\begin{document}

\begin{minipage}{1\linewidth}
\centering
A
\medskip
B
\end{minipage}

\end{document}

Why it is not possible to insert tables instead of A and B? If I try, I get "LaTeX Error: Not in outer par mode."

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow}

\begin{document}

\begin{minipage}{1\linewidth}
\centering
            \begin{table}[h]
                \centering
                \bgroup
                \def\arraystretch{1.2}
                \begin{tabular}{ c c | c | c | }
                    & & \multicolumn{2}{c|}{P2} \\
                    & & $a_1$ & $a_2$ \\
                    \hline
                    \multirow{2}{*}{P1} & $a_1$ & 0, 0 & 0, 0 \\
                    & $a_2$ & 0, 0 & 0, 0 \\
                    \hline
                \end{tabular}
                \egroup
                \caption{Title}
            \end{table}
\medskip
            \begin{table}[h]
                \centering
                \bgroup
                \def\arraystretch{1.2}
                \begin{tabular}{ c c | c | c | }
                    & & \multicolumn{2}{c|}{P2} \\
                    & & $a_1$ & $a_2$ \\
                    \hline
                    \multirow{2}{*}{P1} & $a_1$ & 0, 0 & 0, 0 \\
                    & $a_2$ & 0, 0 & 0, 0 \\
                    \hline
                \end{tabular}
                \egroup
                \caption{Title}
            \end{table}
\end{minipage}

\end{document}

Ideally, I would like to understand the meaning of "LaTeX Error: Not in outer par mode."

3

A table environment cannot be part of a minipage. Use only one environment table and no minipage! Such an environment can have more than one caption:

\documentclass{article}
\usepackage{multirow}

\begin{document}

\begin{table}
\centering
\def\arraystretch{1.2}
\begin{tabular}{ c c | c | c | }
    & & \multicolumn{2}{c|}{P2} \\
    & & $a_1$ & $a_2$ \\    \hline
 \multirow{2}{*}{P1} & $a_1$ & 0, 0 & 0, 0 \\
& $a_2$ & 0, 0 & 0, 0 \\\hline
\end{tabular}
\caption{Title}

\bigskip
\begin{tabular}{ c c | c | c | }
                & & \multicolumn{2}{c|}{P2} \\
                & & $a_1$ & $a_2$ \\
                \hline
                \multirow{2}{*}{P1} & $a_1$ & 0, 0 & 0, 0 \\
                & $a_2$ & 0, 0 & 0, 0 \\
                \hline
\end{tabular}
\caption{Title}
\end{table}

\end{document}

enter image description here

fro two tabulars side by side use:

\begin{table}
\centering
\def\arraystretch{1.2}
\begin{minipage}{0.48\linewidth}\centering
\begin{tabular}{ c c | c | c | }
    & & \multicolumn{2}{c|}{P2} \\
    & & $a_1$ & $a_2$ \\    \hline
 \multirow{2}{*}{P1} & $a_1$ & 0, 0 & 0, 0 \\
& $a_2$ & 0, 0 & 0, 0 \\\hline
\end{tabular}
\caption{Title}
\end{minipage}
%
\begin{minipage}{0.48\linewidth}\centering
\begin{tabular}{ c c | c | c | }
                & & \multicolumn{2}{c|}{P2} \\
                & & $a_1$ & $a_2$ \\
                \hline
                \multirow{2}{*}{P1} & $a_1$ & 0, 0 & 0, 0 \\
                & $a_2$ & 0, 0 & 0, 0 \\
                \hline
\end{tabular}
\caption{Title}
\end{minipage}
\end{table}

enter image description here

2
  • The problem is that I would like these two tables to be side by side – Juan Leni Aug 31 '18 at 18:22
  • no problem: Then put two minipages inside the table environment. See edited answer in a minute. – user2478 Aug 31 '18 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.