1

I'm trying to put a table with figures inside a table in a "tikzposter" block environment. Whilst the method below works in documentclass{article} + \begin{document} ... \end{document}. It doesn't work in a \documentclass[...]{tikzposter} environment.

See code:

\documentclass[20pt, a0paper, landscape]{tikzposter}
\usepackage{geometry}
\usepackage{tabularx}
\usepackage{graphicx}

\usetheme{Simple}

\begin{document}

\begin{columns}
\column{0.5}
\block{block title}{
\begin{figure}[ht]
\setkeys{Gin}{width=0.32\linewidth}
\begin{tabularx}{\linewidth}{@{} XX @{}}
    \includegraphics{example-image}\hfill 
    \includegraphics{example-image}\hfill
    \includegraphics{example-image}
   \caption{Some text}
    &   \includegraphics{example-image}\hfill
        \includegraphics{example-image}\hfill
        \includegraphics{example-image} 
        \caption{Some text}
\end{tabularx}
\end{figure}
}

\end{columns}
\end{document}

For this I get an error message.

I also tried:

\documentclass[20pt, a0paper, landscape]{tikzposter}
\usepackage{geometry}
\usepackage{tabularx}
\usepackage{graphicx}

\begin{document}

\begin{columns}
\column{0.5}
\block{block title}{
    \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}
}

\end{columns}
\end{document}

For this I also get an error message.

Inside the block I'm trying to get the table to look like this: enter image description here

Thanks!

4
  • tex.stackexchange.com/q/174856/134144 seems to be related.
    – leandriis
    Commented Feb 22, 2021 at 17:12
  • @leandriis there needs to be a tabular or something equivalent, that post doesn't answer the question.
    – AlexLee
    Commented Feb 22, 2021 at 17:33
  • The first example results in an error message since floating environments, such as figure, are not allowed inside of a tikzposter. The question, I linked to in my previous comment currently has three answers. The one to use for your case, is this one. As described there, take your first example code, remove the figure environment, add \usepackage{capt-of} to the preamble and replace all \caption{...} commands with \captionof{figure}{...}.
    – leandriis
    Commented Feb 22, 2021 at 18:18
  • You mention "Table with figures inside a table" as well as "there needs to be a tabular". Could you please explain this requirement. From the code you added I currently don't see the need for a second tabular environment.
    – leandriis
    Commented Feb 22, 2021 at 18:20

1 Answer 1

1

enter image description here

Float environments had not to be inside box. Just remove figure environment and for caption use \captionof{figure}{...}:

\documentclass[20pt, a0paper, landscape]{tikzposter}
\usepackage{geometry}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{capt-of} % <--- for captions outside floats

\usetheme{Simple}

\begin{document}

\begin{columns}
\column{0.5}
\block{block title}{
\setkeys{Gin}{width=0.32\linewidth}
\begin{tabularx}{\linewidth}{@{} X@{\qquad}X @{}} % <---
    \includegraphics{example-image}\hfill
    \includegraphics{example-image}\hfill
    \includegraphics{example-image}
   \captionof{figure}{Some text}
    &   \includegraphics{example-image}\hfill
        \includegraphics{example-image}\hfill
        \includegraphics{example-image}
        \captionof{figure}{Some text}
\end{tabularx}
}
\end{columns}
\end{document}
2
  • Thanks a lot, it works!
    – AlexLee
    Commented Feb 23, 2021 at 8:48
  • @AlexLee, you are welcome :-)
    – Zarko
    Commented Feb 23, 2021 at 8:49

You must log in to answer this question.

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