表格和圖形並排。使用 float,而不是 floatrow,單獨的標題

表格和圖形並排。使用 float,而不是 floatrow,單獨的標題

我正在嘗試使表格和圖形與單獨的標題並排工作,而float不是floatrow.我已經在很多地方使用了floatand 。subfigure

我用完整的序言做了一個小例子。

\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}

答案1

從你的問題我猜想,你喜歡在表格中擁有獨立的編號數字,即使它們部分位於同一浮點數中:

在此輸入影像描述

這是您想要實現的目標嗎?上圖的程式碼是:

\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}

正如你所看到的,我沒有使用floatnor floatrow。我透過使用小包裝獲得了預期的目標capt-of。對於example-images 我還添加了 package graphicx。我不熟悉 package llncs,但我確信它不會幹擾推送的解決方案。

順便說一下,在文檔的前言中,某些包被加載兩次......

相關內容