Graphics, Figures & TablesFloats in Poster

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kostis
Posts: 1
Joined: Wed May 18, 2011 1:55 pm

Floats in Poster

Post by kostis »

I'm using the poster template baposter. My poster includes figures and tables that need captions and labels. So I have to use the figure and table environments. However my figures and tables appear only if I put them raw in the source file (without \begin{figure}\end{figure}).
If I use the table or figure environment, the figure-table does not appear.

Code: Select all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  \headerbox{Data used}{name=data,column=0,below=introduction}{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
... text here ...
\begin{table}
\begin{tabular}{|c|c|c|}
Data-set & something  & something \\ \hline
2003     & something  & something \\
\end{tabular}
\end{table}
\vspace{0.05em}
}
Is this caused because the figure environment does not want to be in a headerbox???
Could someone tell me why this happens or suggest another way to have captions,labels without using the figure-table environments?

If it helps this are the error messages I get:

Code: Select all

! LaTeX Error: There's no line here to end.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... }
"C:\Program Files\MiKTeX 2.8\tex\latex\pgf\basiclayer\pgfbaselayers.sty This package is obsolete and no longer needed
Unused global option(s):[final].
Underfull \hbox (badness 2680) in paragraph at lines 233--233

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Floats in Poster

Post by Stefan Kottwitz »

Hi kostis,

welcome to the board!

figure and table are intended to float, so they are special and cannot be used everywhere. For having captions, use a the caption (or capt-of) package. For example:

Code: Select all

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

\begin{minipage}{\linewidth}
  \centering
  \captionof{table}{Your caption}
  \label{tab:name}
  \begin{tabular}
    % table content
  \end{tabular}
\end{minipage}
\begin{center}
  \includegraphics{filename}
  \captionof{figure}{text}
  \label{fig:name}
\end{center}
Stefan
LaTeX.org admin
sandman
Posts: 1
Joined: Mon Jun 10, 2013 2:31 pm

Floats in Poster

Post by sandman »

See here.

Code: Select all

\usepackage{float}
...

\begin{figure}[H]
  \centering
  \includegraphics{slike/visina8}
  \caption{Write some caption here}\label{visina8}
\end{figure}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Floats in Poster

Post by Johannes_B »

You shouldn't use floating environments (figure and table) where they don't belong. Stefan was completely right in advising \captionof{type}{caption}.

The float package along with the option H is not a very good idea. If you don't want your objects to float, simply don't use floating environments.

LaTeX does a pretty good job in placing figures and if paragraphs are indicated correctly, it will do a good job. Because using the \captionof command can lead to wrong numbering. So be careful.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply