1

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.

  • 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. – Thomas F. Sturm Oct 22 '14 at 12:30
  • Side note: there is a floating table environment for tabulars you want to float. – Nathanael Farley Oct 22 '14 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 '14 at 13:32
  • @Johannes I've added an answer with an example. Is this the thing you are looking for? – Thomas F. Sturm Oct 22 '14 at 13:44
3

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

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

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.