当我使用该floatrow
包时,threeparttable
更改标题宽度以适合表格的功能似乎消失了。第一张图片显示了我所期望的:
但这种行为却随着 而消失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}