2

Text is not placed correctly w.r.t. each row

Here is the code for the following rendering

\headerbox{Experimental Results}{name=results,span=2,column=1,above=future}{
\begin{minipage}{\linewidth}
\centering
\captionof{table}{Inference on IR images using WaSR} 
%\begin{table}[t]
\label{wasr_as_is_ir}
    \setlength{\tabcolsep}{0.5\dp\strutbox} % the devious trick!
    \begin{tabular}{@{} t @{\quad} ccc @{}}
         {\parbox{20mm}{\raggedright Original IR images}} &
         \includegraphics[width=40mm]{images/input/1603212920.750480_color_grayscale_resized_color.png}  & 
         \includegraphics[width=40mm]{images/input/1603391732.530753_color_grayscale_resized_color.png}  &
         \includegraphics[width=40mm]{images/input/1603391799.096494_color_grayscale_resized_color.png}  \\
        {\parbox{20mm}{\raggedright Direct inference}} &
         \includegraphics[width=40mm]{images/wasr_as_is/ir/1603212920.750480_color_grayscale_resized_color_output_mask.png} & 
         \includegraphics[width=40mm]{images/wasr_as_is/ir/1603391732.530753_color_grayscale_resized_color_output_mask.png} &
         \includegraphics[width=40mm]{images/wasr_as_is/ir/1603391799.096494_color_grayscale_resized_color_output_mask.png} \\
        {\parbox{20mm}{\raggedright Retrained with gray scale images}} &
        \includegraphics[width=40mm]{images/wasr_with_mastr_rgb2gray_retrain/1603212920.750480_color_grayscale_resized_color_output_mask.png} & 
        \includegraphics[width=40mm]{images/wasr_with_mastr_rgb2gray_retrain/1603391732.530753_color_grayscale_resized_color_output_mask.png} &
         \includegraphics[width=40mm]{images/wasr_with_mastr_rgb2gray_retrain/1603391799.096494_color_grayscale_resized_color_output_mask.png} \\
        {\parbox{20mm}{\raggedright Retrained with IR images}} &
        \includegraphics[width=40mm]{images/wasr_with_our_ir_retrain/1603212920.750480_color_grayscale_resized_color_output_mask.png} & 
         \includegraphics[width=40mm]{images/wasr_with_our_ir_retrain/1603391732.530753_color_grayscale_resized_color_output_mask.png} &
          \includegraphics[width=40mm]{images/wasr_with_our_ir_retrain/1603391799.096494_color_grayscale_resized_color_output_mask.png} \\
    \end{tabular}
%\end{table}
\end{minipage}
}

I tried with different size of parbox but it did not place the text correctly.

Update:: I failed to explain that I am creating A0 poster and creating a header box in it. So I cannot use table (float) environment in it. After incorporating js' suggestion, I am close but text is still an issue. See latest code below and the new result.

\begin{posterbox}[name=results,span=2,column=1,below=setup,above=future]{Results}
\begin{minipage}{\linewidth}
\centering
\captionof{table}{Inference on IR images using WaSR} 
\label{wasr_as_is_ir}
    \begin{tabular}{@{} p{1.1cm} @{\quad} ccc @{}}
{\multirow{-8}{*}{\makecell[l]{ Original \\IR images}}} &
     \includegraphics[width=40mm]{images/input/1603212920.750480_color_grayscale_resized_color.png}  & 
     \includegraphics[width=40mm]{images/input/1603391732.530753_color_grayscale_resized_color.png}  &
     \includegraphics[width=40mm]{images/input/1603391799.096494_color_grayscale_resized_color.png}  \\
    {\multirow{-8}{*}{\makecell[l]{Direct \\inference}}} &
     \includegraphics[width=40mm]{images/wasr_as_is/ir/1603212920.750480_color_grayscale_resized_color_output_mask.png} & 
     \includegraphics[width=40mm]{images/wasr_as_is/ir/1603391732.530753_color_grayscale_resized_color_output_mask.png} &
     \includegraphics[width=40mm]{images/wasr_as_is/ir/1603391799.096494_color_grayscale_resized_color_output_mask.png} \\
    {\multirow{-8}{*}{\makecell[l]{Retrained \\with \\gray scale}}} &
    \includegraphics[width=40mm]{images/wasr_with_mastr_rgb2gray_retrain/1603212920.750480_color_grayscale_resized_color_output_mask.png} & 
    \includegraphics[width=40mm]{images/wasr_with_mastr_rgb2gray_retrain/1603391732.530753_color_grayscale_resized_color_output_mask.png} &
     \includegraphics[width=40mm]{images/wasr_with_mastr_rgb2gray_retrain/1603391799.096494_color_grayscale_resized_color_output_mask.png} \\
    {\multirow{-8}{*}{\makecell[l]{Retrained \\with \\IR images}}} &
    \includegraphics[width=40mm]{images/wasr_with_our_ir_retrain/1603212920.750480_color_grayscale_resized_color_output_mask.png} & 
     \includegraphics[width=40mm]{images/wasr_with_our_ir_retrain/1603391732.530753_color_grayscale_resized_color_output_mask.png} &
      \includegraphics[width=40mm]{images/wasr_with_our_ir_retrain/1603391799.096494_color_grayscale_resized_color_output_mask.png} \\
    \end{tabular}

%\end{table}
\end{minipage}
\end{posterbox}

The text is too close to the image cell. I do not know why! Any help in getting the text a little toward left will be much appreciated.

enter image description here

Update2:: Answer to @egreg. I am using minipage but the text is almost touching with the image. Here is my code -

\documentclass[a0paper,portrait,showframe]{baposter} \usepackage{calc} \usepackage{amsmath} \usepackage{amssymb} \usepackage{relsize} \usepackage{multirow} \usepackage{rotating} \usepackage{bm} \usepackage{url} \usepackage{enumitem}% for customizing the lists

\usepackage{graphicx} \usepackage{multicol}

\usepackage{palatino} \usepackage[font=small,labelfont=bf]{caption} \usepackage{textcomp} \usepackage{xcolor} \usepackage{amsmath,mathtools} \usepackage{amssymb} \usepackage{colortbl,booktabs} \usepackage{array,ragged2e} \usepackage{stfloats} \usepackage{fancyhdr} \usepackage{graphicx,subcaption,ragged2e} \usepackage{comment} \usepackage[export]{adjustbox} \usepackage{rotating} \usepackage{booktabs, makecell, tabularx} \usepackage{textcomp} % trademark symbol \usepackage{caption}

%%% Global Settings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \graphicspath{{figures/}} % Root directory of the pictures \tracingstats=2 % Enabled LaTeX logging with conditionals %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Save space in lists. Use this after the opening of the list %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\compresslist}{% \setlength{\itemsep}{1pt}% \setlength{\parskip}{0pt}% \setlength{\parsep}{0pt}% } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Document Start %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \typeout{Poster rendering started} \definecolor{lightblue}{rgb}{0.145,0.6666,1} %%% General Poster Settings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%% Eye Catcher, Title, Authors and University Images %%%%%%%%%%%%%%%%%%%%%% \begin{poster} % { % Poster Options % Show grid to help with alignment %grid=true, % Column spacing colspacing=1em, % Color style bgColorOne=white, bgColorTwo=white, borderColor=lightblue, headerColorOne=black, headerColorTwo=lightblue, headerFontColor=white, boxColorOne=white, boxColorTwo=lightblue, % Format of textbox textborder=roundedleft, % Format of text header %eyecatcher=false, headerborder=closed, headerheight=0.1\textheight, % a0 poster % textfont=\sc, An example of changing the text font headershape=roundedright, headershade=shadelr, headerfont=\Large\bf\textsc, %Sans Serif textfont={\setlength{\parindent}{1.5em}}, %a0 poster boxshade=plain, % background=shade-tb, background=plain, linewidth=2pt } % Eye Catcher { }

\begin{posterbox}[name=results,span=2,column=1,below=setup,above=bottom]{Results} \begin{minipage}{\linewidth} \centering \captionof{table}{Inference on IR images using WaSR} \label{wasr_as_is_ir} \begin{tabular}{@{} p{1.1cm} @{\quad} ccc @{}} {\multirow{-9}{}{\makecell[l]{ Original \IR images}}} & \includegraphics[width=40mm]{images/input/1603212920.750480_color_grayscale_resized_color.png} & \includegraphics[width=40mm]{images/input/1603391732.530753_color_grayscale_resized_color.png} & \includegraphics[width=40mm]{images/input/1603391799.096494_color_grayscale_resized_color.png} \ \ {\multirow{-9}{}{\makecell[l]{Direct \inference}}} & \includegraphics[width=40mm]{images/wasr_as_is/ir/1603212920.750480_color_grayscale_resized_color_output_mask.png} & \includegraphics[width=40mm]{images/wasr_as_is/ir/1603391732.530753_color_grayscale_resized_color_output_mask.png} & \includegraphics[width=40mm]{images/wasr_as_is/ir/1603391799.096494_color_grayscale_resized_color_output_mask.png} \ \ {\multirow{-9}{}{\makecell[l]{Retrained \with \gray scale}}} & \includegraphics[width=40mm]{images/wasr_with_mastr_rgb2gray_retrain/1603212920.750480_color_grayscale_resized_color_output_mask.png} & \includegraphics[width=40mm]{images/wasr_with_mastr_rgb2gray_retrain/1603391732.530753_color_grayscale_resized_color_output_mask.png} & \includegraphics[width=40mm]{images/wasr_with_mastr_rgb2gray_retrain/1603391799.096494_color_grayscale_resized_color_output_mask.png} \ \ {\multirow{-9}{}{\makecell[l]{Retrained \with \IR images}}} & \includegraphics[width=40mm]{images/wasr_with_our_ir_retrain/1603212920.750480_color_grayscale_resized_color_output_mask.png} & \includegraphics[width=40mm]{images/wasr_with_our_ir_retrain/1603391732.530753_color_grayscale_resized_color_output_mask.png} & \includegraphics[width=40mm]{images/wasr_with_our_ir_retrain/1603391799.096494_color_grayscale_resized_color_output_mask.png} \ \ \end{tabular} \vspace{1cm}
\captionof{table}{Quantitative results}
\begin{tabular}{|c|c|} \hline Precision & 0.4583 \ \hline Recall & 0.9167 \ \hline \end{tabular} %\end{table} \end{minipage} \end{posterbox}

2

3 Answers 3

1

enter image description here

  \begin{tabular}{@{} p{2cm} @{\quad} ccc @{}}
     {\multirow{-9}{*}{\makecell[l]{ Original \\IR images}}} &
     \includegraphics[width=40mm]{images/input/1603212920.750480_color_grayscale_resized_color.png}  & 
     \includegraphics[width=40mm]{images/input/1603391732.530753_color_grayscale_resized_color.png}  &
     \includegraphics[width=40mm]{images/input/1603391799.096494_color_grayscale_resized_color.png}  \\
    {\multirow{-9}{*}{\makecell[l]{Direct \\inference}}} &
     \includegraphics[width=40mm]{images/wasr_as_is/ir/1603212920.750480_color_grayscale_resized_color_output_mask.png} & 
     \includegraphics[width=40mm]{images/wasr_as_is/ir/1603391732.530753_color_grayscale_resized_color_output_mask.png} &
     \includegraphics[width=40mm]{images/wasr_as_is/ir/1603391799.096494_color_grayscale_resized_color_output_mask.png} \\
    {\multirow{-9}{*}{\makecell[l]{Retrained \\with \\gray scale}}} &
    \includegraphics[width=40mm]{images/wasr_with_mastr_rgb2gray_retrain/1603212920.750480_color_grayscale_resized_color_output_mask.png} & 
    \includegraphics[width=40mm]{images/wasr_with_mastr_rgb2gray_retrain/1603391732.530753_color_grayscale_resized_color_output_mask.png} &
     \includegraphics[width=40mm]{images/wasr_with_mastr_rgb2gray_retrain/1603391799.096494_color_grayscale_resized_color_output_mask.png} \\
    {\multirow{-9}{*}{\makecell[l]{Retrained \\with \\IR images}}} &
    \includegraphics[width=40mm]{images/wasr_with_our_ir_retrain/1603212920.750480_color_grayscale_resized_color_output_mask.png} & 
     \includegraphics[width=40mm]{images/wasr_with_our_ir_retrain/1603391732.530753_color_grayscale_resized_color_output_mask.png} &
      \includegraphics[width=40mm]{images/wasr_with_our_ir_retrain/1603391799.096494_color_grayscale_resized_color_output_mask.png} \\
\end{tabular}
1

enter image description here

\documentclass{article}
\usepackage{graphicx,lipsum}
\usepackage[export]{adjustbox}
\begin{document}
\lipsum[1]
\begin{table}
\caption{Inference on IR images using WaSR}
\newcommand\rowlabel[1]{\parbox{.2\linewidth}{\raggedright #1}\hfill}
\newcommand\IRimage[1]{\includegraphics[valign=c,width=.24\linewidth]{#1}}
\hrulefill\bigskip\par
\rowlabel{Original IR images}  
\IRimage{example-image-a} \hfill  
\IRimage{example-image-b} \hfill  
\IRimage{example-image-c} \medskip\par
\rowlabel{Direct Interference}
\IRimage{example-image-a} \hfill  
\IRimage{example-image-b} \hfill  
\IRimage{example-image-c} \medskip\par
\rowlabel{Retrained with gray scale images}  
\IRimage{example-image-a} \hfill  
\IRimage{example-image-b} \hfill  
\IRimage{example-image-c} \medskip\par
\rowlabel{Retrained with IR images}  
\IRimage{example-image-a} \hfill  
\IRimage{example-image-b} \hfill  
\IRimage{example-image-c} \bigskip\par
\hrulefill
\end{table}
\lipsum[2]
\end{document}
0

The devious trick doesn't work in this case. Here's an alternative version.

\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{booktabs}

\newlength{\modulewidth}

\begin{document}

\begin{table}[htp]
\centering

\caption{Inference on IR images using WaSR} 
\label{wasr_as_is_ir}

\setlength{\tabcolsep}{1mm}
\setlength{\aboverulesep}{2\tabcolsep}
\setlength{\belowrulesep}{2\tabcolsep}
\setlength{\modulewidth}{\dimexpr(\textwidth-1em-4\tabcolsep)/7}

\begin{tabular}{@{} c @{\quad} ccc @{}}
\toprule
\parbox{\modulewidth}{\raggedright Original IR images} &
  \includegraphics[valign=c,width=2\modulewidth]{example-image} &
  \includegraphics[valign=c,width=2\modulewidth]{example-image} &
  \includegraphics[valign=c,width=2\modulewidth]{example-image} \\
\addlinespace[2mm]
\parbox{\modulewidth}{\raggedright Direct inference} &
  \includegraphics[valign=c,width=2\modulewidth]{example-image} &
  \includegraphics[valign=c,width=2\modulewidth]{example-image} &
  \includegraphics[valign=c,width=2\modulewidth]{example-image} \\
\addlinespace[2mm]
\parbox{\modulewidth}{\raggedright Retrained with gray scale images} &
  \includegraphics[valign=c,width=2\modulewidth]{example-image} &
  \includegraphics[valign=c,width=2\modulewidth]{example-image} &
  \includegraphics[valign=c,width=2\modulewidth]{example-image} \\
\addlinespace[2mm]
\parbox{\modulewidth}{\raggedright Retrained with IR images} &
  \includegraphics[valign=c,width=2\modulewidth]{example-image} &
  \includegraphics[valign=c,width=2\modulewidth]{example-image} &
  \includegraphics[valign=c,width=2\modulewidth]{example-image} \\
\bottomrule
\end{tabular}

\end{table}

\end{document}

enter image description here

3
  • Thank you all. However, I failed to mention one important thing here. I am creating a A0 size poster using 'baposter' class. I am creating a headerbox and the above table is inside this header box. It means I cannot use 'table' environment. Solution of 'js bibra' is coming closest to what I want except there is still an issue with spacing of text. I will share the new code and the output.
    – shaileshn
    Commented May 28, 2021 at 2:35
  • @shaileshn And where’s the problem? Use a minipage like in your example
    – egreg
    Commented May 28, 2021 at 6:52
  • please see update 2 above.
    – shaileshn
    Commented May 31, 2021 at 4:23

You must log in to answer this question.

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