3

I am trying to make tables and figure work side by side with seperate captions, with float not floatrow. I use float and subfigure in a number of places already.

I made a small example with my full preamble.

\documentclass[runningheads,a4paper]{llncs}
\usepackage{import}
\usepackage{amssymb}
\usepackage{amsmath}
\setcounter{tocdepth}{3}
\usepackage{graphicx}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{framed}
\usepackage{url}
\usepackage[colorinlistoftodos]{todonotes}
\newcommand{\itodo}[1]{\todo[inline, color=green!40]{#1}}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usepackage{tikz}
\usetikzlibrary{plotmarks}
\usetikzlibrary{patterns}
\usetikzlibrary{chains}
\usepackage{tkz-euclide}
\tikzstyle{important line}=[very thick]
\tikzstyle{information text}=[rounded corners,fill=white,inner sep=1ex]

\usepackage{float}
\usepackage{subfigure}
\usepackage{adjustbox}
\usepackage{array}
\usepackage{rotating}
\usepackage{booktabs, multicol, multirow}
\usepackage{adjustbox}
\usepackage{array}
\usepackage{tikz}
\usepackage{lmodern}
\usepackage{floatrow}
\begin{document}

\begin{figure}
  \centering
  \subfigure[a]{\includegraphics[width=0.24\textwidth]{...}}
  \hspace{.02\textwidth}
  \subfigure[a]{\includegraphics[width=0.24\textwidth]{...}}
  \label{fig:aa}
\end{figure}



\begin{figure}
\begin{floatrow}
\ffigbox
  {\begin{tikzpicture}
    \end{tikzpicture}
  }
  {\caption{One}}\label{fig:1}}
\killfloatstyle
\ttabbox
{\scriptsize
\begin{tabular}{ll}
    \hline
    column1a & column2a \\
    column1b & column2b \\
    column1c & column2c \\
    \hline
  \end{tabular}
}
{\caption{2}\label{tab:ss}}
\end{floatrow}
\end{figure}


\end{document}
3
  • There is still a \usepackage{floatrow} and a \begin{floatrow} in your example. Are you going to use it, or not to use?
    – Symbol 1
    Dec 31, 2014 at 12:58
  • That is in there to show the desired effect.
    – jmerkow
    Jan 8, 2015 at 22:53
  • subfigure is obsolete and ought not be used. subfig or subcaption are alternatives. \tikzstyle is deprecated and should be replaced by \tikzset (unless you are using a quite old version of PGF/TikZ which is not recommended). Don't load packages more than once. It is a recipe for mysterious, hard-to-diagnose problems whose underlying causes turn out to be annoyingly simple. When posting examples, only use a non-standard class if it is essential to the question. In that case, please provide a link so that people can obtain the class. Otherwise, use a standard class.
    – cfr
    Dec 25, 2015 at 2:59

1 Answer 1

2

From your question I guess, that you like to have independent numbering figures in tables even if they are partly in the same float:

enter image description here

Is this, what you like to achieve? The code for above image is:

\documentclass[a4paper]{article}
    \usepackage{graphicx}
    \usepackage{capt-of}

    \begin{document}
\begin{figure}[hbt]
  \centering
\includegraphics[width=0.2\textwidth]{example-image-a}
  \caption{figure a}
  \label{fig:a}
\end{figure}
some text
\begin{figure}[hbt]
  \centering
\includegraphics[width=0.2\textwidth]{example-image-b}
  \caption{figure b}
  \label{fig:b}
\end{figure}

some text
\begin{figure}[hbt]
    \begin{minipage}{0.48\hsize}
\includegraphics[width=0.9\hsize]{example-image-c}
  \captionof{figure}{figure c}
  \label{fig:c}
\end{minipage}
    \hfill
\begin{minipage}{0.48\hsize}
\begin{tabular}{ll}
    \hline
    column1a & column2a \\
    column1b & column2b \\
    column1c & column2c \\
    \hline
  \end{tabular}
\captionof{table}{table 1}
    \label{tab:1}
\end{minipage}
    \end{figure}

 Regarding to figures \ref{fig:a}, \ref{fig:b}, \ref{fig:c} and table \ref{tab:1} \dots
    \end{document}

As you can see, for it I didn't use float nor floatrow. Desired goal I obtain by use of small package capt-of. For example-images I also add package graphicx. I'm not familiar with package llncs, but I'm sure that it will not interfere to shoved solution.

By the way, in the preamble of your document some packages are load twice ...

2
  • Using h for float placement is not recommended. If h is specified, LaTeX tries to place the float here even if other options are listed. If it cannot place it here, it changes it to ht automatically. So it is kind of misleading to write h since it will not always mean here. It is better to say explicitly where else is OK if you want to specify preferred positioning at all. (And, of course, LaTeX will still fall back to p if it has to because it may not be able to place the float either here or at the top of a page.)
    – cfr
    Dec 25, 2015 at 3:06
  • @cfr, thank you for explanation about placement option h. I'm aware about this. Personally I usual add to preamble \def\fps@figure{hbtp} (wrapped by \makeatletter and \makeatother) and then don't care about them.
    – Zarko
    Dec 25, 2015 at 4:44

You must log in to answer this question.

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