2

I'm trying to use \multirow to fit a figure into a table in a tikzposter style document and can't quite figure it out. My code is as follows:

\documentclass[24pt, a1paper, landscape]{tikzposter}
\usepackage[utf8]{inputenc}

\usepackage[labelfont=bf]{caption}
\captionsetup{font=small}

\usepackage{float}
\usepackage{graphicx}
\usepackage{subcaption}


\title{\textbf{title}}
\author{me}
\date{}
\institute{\small{institute}}

\usepackage{multirow}

\begin{document}


\begin{columns}
\column{0.7}
\block{Block Title}
{
Some Text.

\begin{tikzfigure}
\begin{tabular}{ p{6cm}|p{6cm}|p{6cm}}
\hline
\hline
Partial Pressure of Water (mbar) & Decay Lifetime '$\tau_{decay}$' (ms) & 
\multirow{5}
{ 
\begin{tikzfigure} 
\centering
\includegraphics[width=0.3\linewidth]{sample}
\end{tikzfigure}} \\
\hline
 $5.17\times10^{-6}$ & $0.48$ & \\
 $5.13\times10^{-7}$ & $0.95$ & \\
 $2.40\times10^{-8}$ & $0.91$ & \\
 $5.07\times10^{-8}$ & $1.0$ & \\
\hline
\hline
\end{tabular}
\end{tikzfigure}

 }
\end{columns}


\end{document}

I receive the following error, which I don't understand:

Underfull \hbox (badness 7030) in paragraph at lines 48--48
[]\T1/aer/m/n/29.86 Partial Pres-
Underfull \hbox (badness 10000) in paragraph at lines 48--48
[]\T1/aer/m/n/29.86 Decay Life-
Underfull \hbox (badness 10000) in paragraph at lines 48--48
\T1/aer/m/n/29.86 time '$\OML/cmm/m/it/29.86 []$\T1/aer/m/n/29.86 '
! Missing number, treated as zero.
<to be read again> 
                   \def 
l.48 }
? 
  • 1
    What exactly is the purpose of the tikzfigure environment around the \includegraphics command? Apart from that, your \multirow command misses its second argument: \multirow{<number of rows>}{<width>}{<content>}. – leandriis Mar 24 at 19:04
2

Here is a possible solution assuming that the images should be the column header of the third column.

enter image description here

I have used the following:

  • \usepackage[export]{adjustbox} and valign=c to vertically center the image in the column header
  • wc{6cm} from the array package to achieve a column that is 6cm wide and horizontally centered
  • the S type column from siunitx for an improved alignment (and easier input) of numbers
  • the makecell package for the linebreaks in teh column headers of the first and second column.
  • removed the 24pt class option as this is unknown (see warning).

\documentclass[a1paper, landscape]{tikzposter}
\usepackage[utf8]{inputenc}

\usepackage{graphicx}

\usepackage{array}
\usepackage[export]{adjustbox}
\usepackage{siunitx}
\usepackage{makecell}

\begin{document}


\begin{columns}
\column{0.7}
\block{Block Title}
{
Some Text.

\begin{center}
\begin{tabular}{ S[table-format=1.2e-1]|S[table-format=1.2]|wc{6cm}}
\hline
\hline
{\makecell[cc]{Partial Pressure \\ of Water (\si{\milli\bar})}} & {\makecell[cc]{Decay Lifetime \\ $\tau_{\text{decay}}$ (\si{\milli\second})}} & \includegraphics[width=2cm,valign=c]{example-image}\\
\hline
 5.17e-6 & 0.48 & \\
 5.13e-7 & 0.95 & \\
 2.40e-8 & 0.91 & \\
 5.07e-8 & 1.0 & \\
\hline
\hline
\end{tabular}
\end{center}
 }
\end{columns}


\end{document}

Regarding the code in your question: First of all, I don't get the same messages as you. If I fix the \multirow command, that misses its second argument (\multirow{<number of rows>}{<width>}{<content>}) and use \multirow{5}{=}{...} the code becomes compilable and I get several warnings about underfull boxes. These are generated because content in p type columns is by default justified and your column width is too small to achieve a good justified alignment. You can see a huge white space in the column header of the second column between decay and lifetime. I would therefor recommend to use a different alignment for the column headers.

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.