2

Minimal example:

\documentclass{scrreprt}

\begin{document}

\begin{figure}
\centering
\begin{tabular}{cc}

\begin{figure}
\begin{tabular}{cc}
    0 & 1 \\
    2 & 3 \\
\end{tabular}
\caption{table 1}\label{table1}
\end{figure}

&

\begin{figure}
\begin{tabular}{cc}
    0 & 1 \\
    2 & 3 \\
\end{tabular}
\caption{table 2}
\end{figure}

\end{tabular}
\caption{tables}\label{tables}
\end{figure}

\end{document}

This produces the error:

! LaTeX Error: Not in outer par mode.

While I understand the error's meaning, I have no idea how to get my table of tables working. Any ideas?

Please note: I can not use another documentclass.

4
  • 2
    You cannot nest a figure into a figure. The same goes for table which you may have in mind? Anyway, take a look at the subcaption package mirrors.ctan.org/macros/latex/contrib/caption/subcaption.pdf for subtables. Oct 22, 2014 at 12:30
  • Side note: there is a floating table environment for tabulars you want to float. Oct 22, 2014 at 12:51
  • @ThomasF.Sturm I can not find any example where there is a subtable used with two tabulars. Could you please answer with a minimal example?
    – Johannes
    Oct 22, 2014 at 13:32
  • @Johannes I've added an answer with an example. Is this the thing you are looking for? Oct 22, 2014 at 13:44

1 Answer 1

5

The following uses the subcaption package:

\documentclass{scrreprt}
\usepackage{subcaption}

\begin{document}

\begin{table}
  \begin{subtable}[t]{.5\linewidth}%
    \centering%
    \begin{tabular}{cc}
        0 & 1 \\
        2 & 3 \\
    \end{tabular}
    \caption{table 1}\label{table1}
  \end{subtable}%
  \begin{subtable}[t]{.5\linewidth}
    \centering
    \begin{tabular}{cc}
        0 & 1 \\
        2 & 3 \\
    \end{tabular}
    \caption{table 2}
  \end{subtable}
  \caption{tables}\label{tables}
\end{table}

\end{document}

enter image description here

UPDATE:

For a second row, just add another pair of subtable(s):

\documentclass{scrreprt}
\usepackage{subcaption}

\begin{document}

\begin{table}
  \begin{subtable}[t]{.5\linewidth}%
    \centering%
    \begin{tabular}{cc}
        0 & 1 \\
        2 & 3 \\
    \end{tabular}
    \caption{table 1}\label{table1}
  \end{subtable}%
  \begin{subtable}[t]{.5\linewidth}
    \centering
    \begin{tabular}{cc}
        0 & 1 \\
        2 & 3 \\
    \end{tabular}
    \caption{table 2}
  \end{subtable}\par\bigskip
  \begin{subtable}[t]{.5\linewidth}%
    \centering%
    \begin{tabular}{cc}
        0 & 1 \\
        2 & 3 \\
    \end{tabular}
    \caption{table 3}
  \end{subtable}%
  \begin{subtable}[t]{.5\linewidth}
    \centering
    \begin{tabular}{cc}
        0 & 1 \\
        2 & 3 \\
    \end{tabular}
    \caption{table 4}
  \end{subtable}
  \caption{tables}\label{tables}
\end{table}

\end{document}

enter image description here

3
  • Thanks, but: How to align 2x2 tables, i.e. two additional tables below?
    – Johannes
    Oct 22, 2014 at 14:59
  • @Johannes It's just like adding some more text. See my updated answer. Oct 23, 2014 at 6:13
  • 1
    This works fine. Alternatively, I found out one can wrap an outer \tabular around the small tables.
    – Johannes
    Oct 23, 2014 at 14:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .