# Will subcaption and threeparttable live happily ever after? Trouble combining the two

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}

\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}

\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}

\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?

-

tabulary works by changing the width of L, C, R or J columns to achieve the requested total width. You have not supplied any such columns so it can do nothing except complain:

Package tabulary Warning: No suitable columns!


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.

\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}

\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}

-
Somehow l lingered in my MWE; but that doesn't seem to be causing the error message; replacing it by L doesn't do the trick. Further, the first MWE above (with no sub-tables) just works. So even if the error message of MWE 2 and 3 seems to complain via/about tabulary I don't attribute the problem (directly) to tabulary. –  nutty about natty Apr 18 '13 at 8:41
@nuttyaboutnatty see code in answer which produces no error messages –  David Carlisle Apr 18 '13 at 8:46
You have an older version of expl3, I have Package: expl3 2013/03/14 v4469 L3 Experimental code bundle wrapper (and l3names similarly) which means I would guess you are hitting a weird siunitx incompatibility it's only siunitx that triggers l3 code in your MWE I think. –  David Carlisle Apr 18 '13 at 9:14
It seems that threeparttable is incrementing main the table counter, even in subtable environments. Therefore the Table is titled Table 3 and not Table 1 as it should be. Futhermore both sub-tables are titled (a). I will take a look at this within the next days... –  Axel Sommerfeldt Apr 19 '13 at 5:35
OK, so I finally got it working with subfig instead of subcaption.
But after this whole shlep, I remembered the ideas expressed in the booktabs manual (and other common table-style-guides) and found a solution which avoids subfigs & subtables altogether: I "figured" that I'd end up with more lines than text (so-to-speak), and that there's a different way of constructing the table which will reduce the number of lines to the recommended three plus x (\toprule \middlerule \bottomrule and \cmidrule) which just looks SOOO much better.