I'm trying to take this MWE table and put it into a subcaption
's subtable
environment, or, alternatively, use subcaption
's subcaption
command – see subcaption
's manual – to achieve the same end: to have that table twice next to each other.
\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}
Inter alia I've tried this:
\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}
and this
\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}
which both return the Package tabulary Warning: No suitable columns! on input line 31.
error message. I could post additional failed attempts, but don't think that'd be helpful, would it?
Is there same mistake, or some incompatibility?
Note that I'd like to at least be able to apply the threeparttable with footnotes to all three tables: both the two subtables individually, as well as the "mother table" (whether in the end I'd combine the footnotes (or use any footnotes at all) is another matter…).
Futher, is subcaption
capable of doing the list list-of-tables thing also of the subtables layed out neatly as in this subfig
example here from here?
Best Answer
tabulary
works by changing the width ofL
,C
,R
orJ
columns to achieve the requested total width. You have not supplied any such columns so it can do nothing except complain:This is unrelated to any table/subtable environment in which the construct is used.
Then you get
$
errors because there is a_
in the caption and the tables come one above the other as they are in separate paragraphs.