添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Visit Stack Exchange

TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.

Sign up to join this community

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams
LaTeX Error: Not in outer par mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
l.10                 \bgroup

This is the document:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\begin{document}
    \begin{center}
      \begin{tabular}{ c c }
            \begin{table}
                \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}
      Other text
      \end{tabular}
    \end{center}
\end{document}

What does this mean?

You are using the wrong order: table should be around tabular (and use \centering instead of center). – TeXnician Aug 31, 2018 at 17:16

for this i suggest to use the tabularx table environment for outer table:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{document}
   \begin{table}
   \centering
\begin{tabularx}{\linewidth}{ C C }
    \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 of the first table}
    \label{tab:1}
    \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 of the second table}
    \label{tab:2}
\end{tabularx}
    \end{table}
\end{document}
                Thanks @Zarko! Actually, I would like to have two tables 1 and 2 (instead of "Other Text") The problem with your answer is that I would get only a single title
– Juan Leni
                Aug 31, 2018 at 17:54
                Let's say that I actually want to have two tables/grids side by side each with its own title
– Juan Leni
                Aug 31, 2018 at 17:55