2

I've tried to put a list under an \item in tablenotes of a threeparttable, but both itemize and enumitem gives me the error:

LaTeX Error: Something's wrong--perhaps a missing \item.

Here is my mwe, see the commented lines:

\documentclass[11pt,openright]{book}

\usepackage{booktabs}
\usepackage[para,flushleft]{threeparttable}

\begin{document}
    \begin{threeparttable}
        \caption{Example of table}\label{tab:mytab1}
        \small
        \begin{tabular}{@{}ccc@{}}
            \toprule 
            \addlinespace
            First column header\tnote{a}\ & Second column header\tnote{b} & Third column header\\
            \addlinespace
            \midrule
            1 & 2 & 3\\
            A & B & C\\
            \bottomrule
        \end{tabular}
        \begin{tablenotes}[para,flushleft]                       
            \footnotesize
            \item[a] I'd like to have a list here:
            %\begin{enumerate}
            %   \item first item
            %   \item second item
            %\end{enumerate}
            \\
            \item[b] Another table note.
        \end{tablenotes}     
    \end{threeparttable}
\end{document}
2
  • @campa Without the option para it works, thank you! If you post an answer I'll accept it.
    – CarLaTeX
    Commented Mar 1, 2017 at 17:37
  • I took the liberty of making your MWE a little more minimal. Hope you don't mind.
    – campa
    Commented Mar 2, 2017 at 8:23

1 Answer 1

1

The standard definition of tablenotes is basically

\def\tablenotes{\TPTdoTablenotes}
\let\endtablenotes\endlist

and \TPTdoTablenotes issues \list, and you can nest a further list there. The package option para does basically

\let\TPTdoTablenotes\TPT@doparanotes
\def\endtablenotes{\par}

and \TPT@doparanotes redefines \item to print the notes one after another; inserting a list there fails.

According to the documentation you can give the option para to the package and restore the normal behaviour with the option normal for a single tablenotes environment. However, I haven't found anything in the code that actually does this, so either I misunderstood something or when the option para is given globally there is no way to reverse it. My suggestion is therefore to call the package without options (well, flushleft is OK), and use the option para for a single tablenotes environment if you really want it.

1
  • The option [para, flushleft] given both globally and locally was a mere typo (I put it locally at first, then I changed my mind and put it globally but I forgot to delete the local option). Thank you for having posted a detailed answer.
    – CarLaTeX
    Commented Mar 2, 2017 at 9:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .