2

While working on my first ever Latex document I have been looking for a way to add notes to tables. An answer to another question suggesting using threeparttable. Regardless of whether I add the tablenotes section, I get an error:

Error in thesis.tex (line 96): Extra }, or forgotten \endgroup.
\endtabular ->\TPTsav@endtabular \TPT@endtabhook l.96 \end{tabu} I've deleted a group-  
closing symbol because it seems to be spurious, as in `$x}$'. But perhaps the } is 
legitimate and you forgot something else, as in `\hbox{$x}'. In such cases the way to 
recover is to insert both the forgotten and the deleted material, e.g., by typing 
`I$}'. 

My MWE looks like this:

Preamble:

\documentclass[man, natbib, a4paper, draftfirst, twoside, 12pt, floatsintext]{apa6}

%---------TABLES---------
\usepackage{booktabs}
\usepackage{tabu}
\usepackage{threeparttable}
%indents in tables (custom command)
\newcommand*{\TableIndent}{\hspace*{0.5cm}}%
%-------END TABLES--------

In the document:

\begin{threeparttable}[!h]
\centering
\caption{Number of sample deletions by reason}
\label{tab1}
\begin{tabu}{X[.3,r]X}
\toprule
Number of respondents & \multicolumn{1}{c}{Reason for deletion}       \\ 
\midrule
77,934                & Number of respondents in original SOEP sample    \\
-23,690               & \TableIndent 1. Not in sample starting 2004\\ 
\cmidrule(r){1-1}
54,244                 &                                                \\ 
\addlinespace
-52,673                & \TableIndent 2. Started first job before 2004   \\ 
\cmidrule(r){1-1}
1,571                 &                                                   \\
\addlinespace 
-16                & \TableIndent 3. Risk data is not available     \\ 
\cmidrule(r){1-1}
1,555                 & Sample used for analysis                          \\ 
\addlinespace
\bottomrule
\end{tabu}
\end{threeparttable}

I thought that I had my environments nested wrong, but all answers so far have tabu inside of threeparttable.

Arik
  • 33
  • 1
  • 4

0 Answers0