将表格标题展开为子浮点数

将表格标题展开为子浮点数

您好,我正在尝试将表格中子浮点数的标题分散到一行,但却找不到实现这一目标的方法。

以下是一个例子

\documentclass{article}
\usepackage{subfig}% http://ctan.org/pkg/subfig
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\newcommand{\mytab}{% Just for this example
  \begin{tabular}{lcr}
    \toprule
    One & Two & Three \\
    \midrule
    $x$ & $y$ & $z$ \\
    1 & 2 & 3 \\
    \bottomrule
  \end{tabular}
}
\begin{document}


\begin{table}%
  \tiny
  \centering
  \subfloat[here is an example caption to illustrate my question]{\mytab}%
  \hfill
  \subfloat[]{\mytab}
  \caption{Here are some tables in a \texttt{table} environment.}%
  \label{tbl:table}%
\end{table}

\end{document}​

有没有办法让表 1a 的标题位于一行,同时使表格居中?

答案1

如果可以选择切换到subcaption,那么您可以按照以下方法实现预期的单行子标题:

在此处输入图片描述

(垂直线表示边距。)

\documentclass{article}
\usepackage{subcaption}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\newcommand{\mytab}{% Just for this example
  \begin{tabular}{lcr}
    \toprule
    One & Two & Three \\
    \midrule
    $x$ & $y$ & $z$ \\
    1 & 2 & 3 \\
    \bottomrule
  \end{tabular}
}

\captionsetup[sub]{font=footnotesize}
\begin{document}


\begin{table}%
  \tiny
  \centering
  \begin{subfigure}[t]{0.6\linewidth}\centering
  \mytab
  \caption{here is an example caption to illustrate my question}
  \end{subfigure}%
  \begin{subfigure}[t]{0.4\linewidth}\centering
  \mytab
  \caption{caption}
  \end{subfigure}%
  \caption{Here are some tables in a \texttt{table} environment.}%
  \label{tbl:table}%
\end{table}

\end{document}​

相关内容