subcaption 和 threeparttable 能否从此幸福相处?两者结合有困难

subcaption 和 threeparttable 能否从此幸福相处?两者结合有困难

subcaption我正在尝试将这张 MWE表放入subtable环境或者,subcaption使用subcaption命令- 参见subcaption手册 - 达到相同的目的:将该表两次并排放置。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabulary}
\usepackage{threeparttable}
\usepackage{array}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{caption}
\usepackage[list=true]{subcaption}
%\usepackage[list=true]{subcaption}

\renewcommand{\arraystretch}{1.2}
\sisetup{round-mode=places,round-precision=1, add-decimal-zero=true, add-integer-zero=true, round-integer-to-decimal}

\begin{document}

\begin{table}
\centering
\begin{threeparttable}
\caption{Some long boring caption don't fall asleep 2013}

\begin{tabulary}{\textwidth}{@{}*{1}{l}*{2}{S[table-format=3.2]}@{}}
\toprule
& {incl.\ Ingredients A\tnote{3}} & {excl.\ Ingredients A} \\
\midrule
DDDD & 36.1 & 22.0\\
EEEE & 30.9 & 20.0\\
\bottomrule
\end{tabulary}

\begin{tablenotes}
\item [2] Unweighted Average
\item [] Source: radiowaves from outer space 1999
\end{tablenotes}

\end{threeparttable}
\end{table}

\end{document}

除其他外我尝试过这个:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabulary}
\usepackage{threeparttable}
\usepackage{array}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{caption}
\usepackage[list=true]{subcaption}
%\usepackage[list=true]{subcaption}

\renewcommand{\arraystretch}{1.2}
\sisetup{round-mode=places,round-precision=1, add-decimal-zero=true, add-integer-zero=true, round-integer-to-decimal}

\begin{document}

\begin{table}

\begin{subtable}{.5\linewidth}
\centering
\begin{threeparttable}
\caption{Sub_caption A 2013}

\begin{tabulary}{\textwidth}{@{}*{1}{l}*{2}{S[table-format=3.2]}@{}}
\toprule
& {incl.\ Ingredients A\tnote{3}} & {excl.\ Ingredients A} \\
\midrule
DDDD & 36.1 & 22.0\\
EEEE & 30.9 & 20.0\\
\bottomrule
\end{tabulary}

\begin{tablenotes}
\item [2] Unweighted Average
\item [] Source: radiowaves from outer space 1999
\end{tablenotes}

\end{threeparttable}
\end{subtable}


\begin{subtable}{.5\linewidth}
\centering
\begin{threeparttable}
\caption{Sub_caption B 2013}

\begin{tabulary}{\textwidth}{@{}*{1}{l}*{2}{S[table-format=3.2]}@{}}
\toprule
& {incl.\ Ingredients A\tnote{3}} & {excl.\ Ingredients A} \\
\midrule
DDDD & 36.1 & 22.0\\
EEEE & 30.9 & 20.0\\
\bottomrule
\end{tabulary}

\begin{tablenotes}
\item [2] Unweighted Average
\item [] Source: radiowaves from outer space 1999
\end{tablenotes}

\end{threeparttable}
\end{subtable}

\caption{Some long boring caption don't fall asleep 2013}


\end{table}

\end{document}

和这个

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabulary}
\usepackage{threeparttable}
\usepackage{array}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{caption}
\usepackage[list=true]{subcaption}
%\usepackage[list=true]{subcaption}

\renewcommand{\arraystretch}{1.2}
\sisetup{round-mode=places,round-precision=1, add-decimal-zero=true, add-integer-zero=true, round-integer-to-decimal}

\begin{document}

\begin{table}

\begin{minipage}{.5\linewidth}
\centering
\begin{threeparttable}
\subcaption{Sub_caption A 2013}

\begin{tabulary}{\textwidth}{@{}*{1}{l}*{2}{S[table-format=3.2]}@{}}
\toprule
& {incl.\ Ingredients A\tnote{3}} & {excl.\ Ingredients A} \\
\midrule
DDDD & 36.1 & 22.0\\
EEEE & 30.9 & 20.0\\
\bottomrule
\end{tabulary}

\begin{tablenotes}
\item [2] Unweighted Average
\item [] Source: radiowaves from outer space 1999
\end{tablenotes}

\end{threeparttable}
\end{minipage}


\begin{minipage}{.5\linewidth}
\centering
\begin{threeparttable}
\subcaption{Sub_caption B 2013}

\begin{tabulary}{\textwidth}{@{}*{1}{l}*{2}{S[table-format=3.2]}@{}}
\toprule
& {incl.\ Ingredients A\tnote{3}} & {excl.\ Ingredients A} \\
\midrule
DDDD & 36.1 & 22.0\\
EEEE & 30.9 & 20.0\\
\bottomrule
\end{tabulary}

\begin{tablenotes}
\item [2] Unweighted Average
\item [] Source: radiowaves from outer space 1999
\end{tablenotes}

\end{threeparttable}
\end{minipage}

\caption{Some long boring caption don't fall asleep 2013}


\end{table}

\end{document}

两者都返回了Package tabulary Warning: No suitable columns! on input line 31.错误消息。我可以发布更多失败的尝试,但我认为这没什么用,不是吗?

是否存在同样的错误,或者存在某种不兼容的情况?

请注意,我希望至少能够将带有脚注的三部分表应用于所有三个表:两个子表以及“母表”(最终我是否合并脚注(或使用任何脚注)是另一回事...)。

此外,还可以像本例subcaption一样,对子表进行整齐排列subfig这里这里

答案1

tabularyL通过更改、C或列的宽度来实现所要求的总宽度。您没有提供任何此类列RJ因此它除了抱怨之外什么也做不了:

Package tabulary Warning: No suitable columns! 

这与使用该构造的任何表/子表环境无关。

然后您就会收到$错误,因为标题中有一个_,并且表格彼此叠在一起,因为它们位于单独的段落中。

在此处输入图片描述

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabulary}
\usepackage{threeparttable}
\usepackage{array}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{caption}
\usepackage[list=true]{subcaption}
%\usepackage[list=true]{subcaption}

\renewcommand{\arraystretch}{1.2}
\sisetup{round-mode=places,round-precision=1, add-decimal-zero=true, add-integer-zero=true, round-integer-to-decimal}

\begin{document}

\begin{table}

\begin{subtable}{.5\linewidth}
\centering
\begin{threeparttable}
\caption{Sub\_caption A 2013}

\begin{tabulary}{\textwidth}{@{}*{1}{L}*{2}{c}@{}}
\toprule
%& {incl.\ Ingredients A\tnote{3}} & {excl.\ Ingredients A} \\
\midrule
DDDD & 36.1 & 22.0\\
EEEE & 30.9 & 20.0\\
\bottomrule
\end{tabulary}

\begin{tablenotes}
\item [2] Unweighted Average
\item [] Source: radiowaves from outer space 1999
\end{tablenotes}

\end{threeparttable}
\end{subtable}%
\begin{subtable}{.5\linewidth}
\centering
\begin{threeparttable}
\caption{Sub\_caption B 2013}


\begin{tabulary}{\textwidth}{@{}*{1}{L}*{2}{S[table-format=3.2]}@{}}
\toprule
& {incl.\ Ingredients A\tnote{3}} & {excl.\ Ingredients A} \\
\midrule
DDDD & 36.1 & 22.0\\
EEEE & 30.9 & 20.0\\
\bottomrule
\end{tabulary}

\begin{tablenotes}
\item [2] Unweighted Average
\item [] Source: radiowaves from outer space 1999
\end{tablenotes}

\end{threeparttable}
\end{subtable}

\caption{Some long boring caption don't fall asleep 2013}


\end{table}

\end{document}

答案2

好的,我终于用subfig而不是让它工作了subcaption

显然,我需要安装最先进的 LaTeX 内核(感谢 David Carlisle、Joseph Wright 和 Axel Sommerfeldt 的关注和研究!)

booktabs但经过这一切,我记起了手册(和其他常见的表格样式指南)中表达的想法,并找到了一个解决方案避免subfigs 和 subtables 总而言之:我“认为”最终我会得到比文本更多的行(可以这么说),并且存在构造表格的不同方法,这会将行数减少到推荐的三加 x (和\toprule \middlerule \bottomrule\cmidrule,这看起来好多了。

底线:在 TeX 中肯定会有一种方法可以制作出一些非常复杂(并且可能很丑陋)的东西:但简单往往会产生美感。

相关内容