Subtable 行为不正常

Subtable 行为不正常

我想并排渲染两个表格。因此,我开始使用该subtable环境。下面是 MWE,问题是表格没有并排,标题没有对齐,如附图所示:

\documentclass{article}

\usepackage{booktabs}

\usepackage[flushleft]{threeparttable}

\usepackage{cuted}
\usepackage{diagbox}
\usepackage{slashbox}
\usepackage{subcaption}

\begin{document}

\begin{table}[!htb]
\caption{Results of Entropy}
    \begin{footnotesize}
      \begin{threeparttable}
    \begin{subtable}{.5\linewidth}
      \centering
      \caption{(N\tnote{a}=17)}
\begin{tabular}{|l|l|l|l|}
        \toprule
 \hline
   & a & b  \\
 \hline\hline
         \midrule
 Entropy \tnote{b} & 2.1 & 3.34\\
 \hline
  \bottomrule
 \hline
\end{tabular}
    \end{subtable}

    \begin{subtable}{.5\linewidth}
      \centering
       \caption{ (N\tnote{a}=1696)}
\begin{tabular}{|l|l|l|l|}
        \toprule

 \hline
   & a & b  \\
   \hline\hline
            \midrule

 Entropy \tnote{b} & 6.76 & 8.9 \\
 \hline
 \bottomrule

 \hline
\end{tabular}
    \end{subtable}


      \begin{tablenotes}\tiny
        \item[a] Number of queries.
        \item[b] Total acquired entropy
      \end{tablenotes}
    \end{threeparttable}

\end{footnotesize}

\end{table}

 \end{document} 

在此处输入图片描述

答案1

threeparttable努力捕捉tabular其中的环境和\caption命令。

你可以不用它:

\documentclass{article}

\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}
\usepackage{subcaption}

\begin{document}

\begin{table}[!htbp]
\renewcommand{\tnote}[1]{\textsuperscript{#1}}

\caption{Results of Entropy}

\subcaptionbox{(N\tnote{a}=17)}[.45\textwidth]{%
  \centering
  \begin{tabular}{llll}
  \toprule
    & a & b  \\
  \midrule
  Entropy\tnote{b} & 2.1 & 3.34\\
  \bottomrule
  \end{tabular}%
}
\subcaptionbox{(N\tnote{a}=1696)}[.45\textwidth]{%
  \centering
  \begin{tabular}{llll}
  \toprule
    & a & b  \\
  \midrule
  Entropy\tnote{b} & 6.76 & 8.9 \\
  \bottomrule
  \end{tabular}%
}

\begin{tablenotes}
  \item[a] Number of queries.
  \item[b] Total acquired entropy
\end{tablenotes}

\end{table}

 \end{document} 

在此处输入图片描述

相关内容