Threeparttable 標題寬度被 floatrow 包破壞

Threeparttable 標題寬度被 floatrow 包破壞

當我使用該floatrow包時,threeparttable更改標題寬度以適合表格的能力似乎丟失了。第一張圖顯示了我的期望:

這就是我想要的行為

但這種行為在floatrow.

它隨著 floatrow 丟失

有任何想法嗎?

MWE如下。

\documentclass[11pt]{scrartcl}
\usepackage{threeparttable}
\usepackage[font=small,labelfont=sc]{caption}
%%% comment the next two lines out and the caption width wortks
\usepackage{floatrow}  % this package removes tpt caption width
\floatsetup[table]{capposition=top}
%%%
\begin{document}


\begin{table}[htb]   %% add [htb] here for better
    \begin{threeparttable}
        \caption{Some caption to demonstrate my issue}
            \begin{tabular}{lll}
                Letter & Number & Number\\
                \hline
                Alpha & 123 & 10\\
                Beta & 246 & 100\\
                Delta & 369 & 1000\\
        \end{tabular}
        \begin{tablenotes}
            \item[] Some notes, these seem to be working
        \end{tablenotes}
    \end{threeparttable}
\end{table}

\end{document}

答案1

只需使用 floatrow 語法即可。我藉此機會使用 中的規則稍微改進了表格booktabs,其中有一些垂直填充,使表格看起來不那麼緊。

\documentclass[11pt]{article}%{scrartcl}
\usepackage[flushleft]{threeparttable}
\usepackage[font=small,labelfont=sc]{caption}
%%% comment the next two lines out and the caption width wortks
\usepackage{floatrow} % this package removes tpt caption width
\floatsetup[table]{capposition=top}
\usepackage{booktabs}
%%%
\begin{document}

\begin{table}[htb] %% add [htb] here for better
   \ttabbox{\caption{Some caption to demonstrate my issue}}{\begin{threeparttable}
            \begin{tabular}{lll}
                Letter & Number & Number\\
               \midrule
                Alpha & 123 & 10\\
                Beta & 246 & 100\\
                Delta & 369 & 1000\\
        \end{tabular}
        \begin{tablenotes}
            \item[]\hskip-0.25em Some notes, these seem to be working
        \end{tablenotes}
    \end{threeparttable}}
\end{table}

\end{document} 

在此輸入影像描述

相關內容