## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Floats in Poster

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

### Floats in Poster

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.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   \headerbox{Data used}{name=data,column=0,below=introduction}{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... text here ...\begin{table}\begin{tabular}{|c|c|c|}Data-set & something  & something \\ \hline2003     & 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:
! 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 neededUnused global option(s):[final].Underfull \hbox (badness 2680) in paragraph at lines 233--233

Tags:

Stefan Kottwitz
Posts: 9563
Joined: Mon Mar 10, 2008 9:44 pm
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:

\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

sandman
Posts: 1
Joined: Mon Jun 10, 2013 2:31 pm
See here.
\usepackage{float}... \begin{figure}[H]   \centering   \includegraphics{slike/visina8}   \caption{Write some caption here}\label{visina8}\end{figure}

Johannes_B
Site Moderator
Posts: 4145
Joined: Thu Nov 01, 2012 4:08 pm
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.