Graphics, Figures & TablesTable in a poster

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ssnirgudkar
Posts: 4
Joined: Mon Apr 05, 2021 12:43 am

Table in a poster

Post by ssnirgudkar »

Hi,
I am using overleaf environment to create a A0 size poster. The class used for this purpose is 'baposter'. I am trying to use exact table which I had used for the paper submission. However, it is giving errors in poster environment.

Here is the code -

Code: Select all

\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


\headerbox{Experimental Results}{name=results,span=2,column=1,above=future} {
\begin{table}[t]
\caption{Inference on IR images using WaSR}
\label{wasr_as_is_ir}
    \centering
    \setlength{\tabcolsep}{0.5\dp\strutbox} % the devious trick!
    \begin{tabular}{@{} l @{\quad} ccc @{}}
         \rotatebox{90}{\parbox{7mm}{\raggedright Original IR images}} &
         \includegraphics[width=17mm]{images/input/1603212920.750480_color_grayscale_resized_color.png}  & 
         \includegraphics[width=17mm]{images/input/1603391732.530753_color_grayscale_resized_color.png}  &
         \includegraphics[width=17mm]{images/input/1603391799.096494_color_grayscale_resized_color.png}  \\
        \rotatebox{90}{\parbox{7mm}{\raggedright Direct inference}} &
         \includegraphics[width=17mm]{images/wasr_as_is/ir/1603212920.750480_color_grayscale_resized_color_output_mask.png} & 
         \includegraphics[width=17mm]{images/wasr_as_is/ir/1603391732.530753_color_grayscale_resized_color_output_mask.png} &
         \includegraphics[width=17mm]{images/wasr_as_is/ir/1603391799.096494_color_grayscale_resized_color_output_mask.png} \\
        \rotatebox{90}{\parbox{7mm}{\raggedright Retrained with gray scale images}} &
        \includegraphics[width=17mm]{images/wasr_with_mastr_rgb2gray_retrain/1603212920.750480_color_grayscale_resized_color_output_mask.png} & 
        \includegraphics[width=17mm]{images/wasr_with_mastr_rgb2gray_retrain/1603391732.530753_color_grayscale_resized_color_output_mask.png} &
         \includegraphics[width=17mm]{images/wasr_with_mastr_rgb2gray_retrain/1603391799.096494_color_grayscale_resized_color_output_mask.png} \\
        \rotatebox{90}{\parbox{7mm}{\raggedright Retrained with IR images}} &
        \includegraphics[width=17mm]{images/wasr_with_our_ir_retrain/1603212920.750480_color_grayscale_resized_color_output_mask.png} & 
         \includegraphics[width=17mm]{images/wasr_with_our_ir_retrain/1603391732.530753_color_grayscale_resized_color_output_mask.png} &
          \includegraphics[width=17mm]{images/wasr_with_our_ir_retrain/1603391799.096494_color_grayscale_resized_color_output_mask.png} \\
    \end{tabular}
\end{table}
}
And I am getting these errors -
LaTeX Error: Not in outer par mode.
Undefined control sequence.
\caption@ORI@xfloat ... \global \setbox \@currbox
\color@vbox \normalcolor \...
l.159 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Missing number, treated as zero.

<to be read again>
\vbox
l.159 }

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
All the errors belong to the last closing curly brace.

This produces a box with the correct title but my beautiful table containing images is missing. What am I missing?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Table in a poster

Post by Bartman »

Floating environments like table are not allowed inside boxes. The \captionof command of the already loaded caption package can add a caption outside this kind of environment.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Table in a poster

Post by Stefan Kottwitz »

Here is the link to the documentation: caption. The command, that Bartman referred to, is described in section 3, Commands.

Basically you can add \usepackage{caption} to your preamble, and then use \captionof{table}{Inference on IR images using WaSR} in the headerbox.

Stefan
LaTeX.org admin
ssnirgudkar
Posts: 4
Joined: Mon Apr 05, 2021 12:43 am

Table in a poster

Post by ssnirgudkar »

Thank you very much. It solved my main problem. Now I have 2nd issue. In this table (see attached screenshot), how can I control the placement of text to left of image rows? I want text to appear at the center of each leftmost cell.

Here is the table syntax

Code: Select all

\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}
}
Image URL : https://drive.google.com/file/d/1tUA4WN ... sp=sharing
Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Table in a poster

Post by Bartman »

Please start a new topic for the new question. Try to provide a Infominimal working example if possible and use the button or tags of the same name for code blocks.

You may add images as attachments to your posts. The use of a cloud service is therefore neither necessary nor recommended.

Some hints on how to approach the solution:

Use the column type m of the package array instead of inserting \parboxes in the cells of the first column. This column type and the adjustbox package can help you to align text and images vertically. The array package can also help to align the whole first column left.
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Table in a poster

Post by Ijon Tichy »

BTW: Loading packages multiple times is not recommended. Even if this is not an instant mistake, it too easily leads to errors when making changes and thus makes editing a document more difficult. It also demonstrates an unstructured approach. Structured working results in structured thinking and vice versa.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply