2

I'm trying to put a figure (with \tabular) inside a table (\tabular):

I've tried the code:

\begin{tabular}{cc}
    \begin{figure}
        \begin{tabular}{ccc}
            \includegraphics[width=0.16\linewidth]{example-image} &  
            \includegraphics[width=0.16\linewidth]{example-image} &
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{tabular}
        \caption{Some text}
    \end{figure}
    &
    \begin{figure}
        \begin{tabular}{ccc}
            \includegraphics[width=0.16\linewidth]{example-image} &  
            \includegraphics[width=0.16\linewidth]{example-image} &
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{tabular}
        \caption{Some text}
    \end{figure}
\end{tabular}

and

\begin{table}{cc}
    \begin{figure}
        \begin{subfigure}
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{subfigure}
        \begin{subfigure}
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{subfigure}
                \begin{subfigure}
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{subfigure}
        \caption{Some text}
    \end{figure}
&
    \begin{figure}
        \begin{subfigure}
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{subfigure}
        \begin{subfigure}
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{subfigure}
                \begin{subfigure}
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{subfigure}
        \caption{Some text}
    \end{figure}
\end{table}

both of these code blocks make an error.

I'm trying to make it look like this: enter image description here

Thanks!

0
4

Welcome to TeX:SE!

With help of tabularx package:

\documentclass{article}
\usepackage{geometry}
\usepackage{tabularx}
\usepackage{graphicx}

\begin{document}
    \begin{figure}[ht]
    \setkeys{Gin}{width=0.32\linewidth}
\begin{tabularx}{\linewidth}{@{} XX @{}}
    \includegraphics{example-image-duck}\hfill 
    \includegraphics{example-image-duck}\hfill
    \includegraphics{example-image-duck}
%
   \caption{Some text}
    &   \includegraphics{example-image-duck}\hfill
        \includegraphics{example-image-duck}\hfill
        \includegraphics{example-image-duck} 
%
        \caption{Some text}
\end{tabularx}
    \end{figure}
\end{document}

enter image description here

1
  • Although it was not the answer I was looking for. It definately works in a \documentclass{article} environment, so therefore it does answer the question. However, I want it to work in a \documentclass{tikzposter} environment. That was my fault, I've now reposted a new question. Thanks anyway! – AlexLee Feb 22 at 17:03
3

Here's a solution that doesn't require any tabular-like structures.

enter image description here

\documentclass{article} 
\usepackage{graphicx} % for '\includegraphics' macro
\usepackage{caption}  % for '\captionof' macro
\begin{document}

\noindent     
\begin{minipage}[t]{0.48\textwidth}
    \includegraphics[width=0.32\linewidth]{example-image}\hfill  
    \includegraphics[width=0.32\linewidth]{example-image}\hfill
    \includegraphics[width=0.32\linewidth]{example-image}
\captionof{figure}{Some text}
\end{minipage}\hfill
\begin{minipage}[t]{0.48\textwidth}
    \includegraphics[width=0.32\linewidth]{example-image}\hfill  
    \includegraphics[width=0.32\linewidth]{example-image}\hfill
    \includegraphics[width=0.32\linewidth]{example-image}
\captionof{figure}{Some more text}
\end{minipage}
\end{document}

Alternatively, if you prefer to place the images in a figure float, you could employ the following code:

\begin{figure}   
\begin{minipage}[t]{0.48\textwidth}
    \includegraphics[width=0.32\linewidth]{example-image}\hfill  
    \includegraphics[width=0.32\linewidth]{example-image}\hfill
    \includegraphics[width=0.32\linewidth]{example-image}
\caption{Some text}
\end{minipage}\hfill
\begin{minipage}[t]{0.48\textwidth}
    \includegraphics[width=0.32\linewidth]{example-image}\hfill  
    \includegraphics[width=0.32\linewidth]{example-image}\hfill
    \includegraphics[width=0.32\linewidth]{example-image}
\caption{Some more text}
\end{minipage}
\end{figure}

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.