I'm trying to use the threeparttable construction offered by the threeparttablex package, that allows one to add a note to the bottom of a longtable. However, I'd like it to be backward compatible with my earlier usage, which used a plain longtable.
Therefore, I'd like to have the option to have a threeparttable with an empty note, which then reduces to the usual longtable. However, this does not seem possible, since leaving the TableNotes section empty gives an error message. It accepts just a \item, but that adds an extra line, or at any rate, some extra space at the bottom of the table, as one can verify by comparing a threeparttable with just an \item as note (\emptythreeparttable), vs a regular longtable (\emptylongtable). I'd like to be able to have a threeparttable which looks exactly like a longtable.
So, is it possible to achieve this?
I'd also be interested in pointers to packages or constructions with similar functionality.
\documentclass[12pt]{scrartcl}
\usepackage{longtable}
\usepackage{threeparttablex}
\usepackage{booktabs}
\begin{document}
\newcommand{\emptythreeparttable}
{
\begin{ThreePartTable}
\begin{TableNotes}
\item
\end{TableNotes}
\begin{longtable}{l l}
\toprule
Column 1 & Column 2 \
\midrule
\endhead
\cmidrule{2-2}
\multicolumn{2}{r}{\textit{continued}}
\endfoot
\bottomrule
\insertTableNotes
\endlastfoot
% the contents of the table
A& B\
C& D\
\end{longtable}
\end{ThreePartTable}
}
\newcommand{\emptylongtable}
{
\begin{longtable}{l l}
\toprule
Column 1 & Column 2 \
\midrule
\endhead
\cmidrule{2-2}
\multicolumn{2}{r}{\textit{continued}}
\endfoot
\bottomrule
%\insertTableNotes
\endlastfoot
% the contents of the table
A& B\
C& D\
\end{longtable}
}
%\emptythreeparttable
\emptylongtable
Some text.
\end{document}
