[Tex/LaTex] How best to change the font size (etc) of threeparttable’s table notes

fontsizetablesthreeparttable

How best to change the font size (etc) of the threeparttable table notes ?

Google returned these (duplicate) unanswered stubs (in English and German, but with pictures ๐Ÿ˜‰

I tried \renewcommand{\TPTnoteSettings}{\small\linespread{1}}, and surely enough: the result looks like in the screenshots of the above links.

Elsewhere I spotted \renewcommand{\TPTnoteSettings}{\small\linespread{1}\selectfont}, though I'm not sure what the \selectfont part does: what does it do?

Edit

To add another link (which I had already opened but overlooked):

Re: threeparttable: multicolumn table notes

Postby Bil Kleb ยป Sat, 10 Apr 2004 16:37:35 GMT

Arseneau assisted me offline. The conclusion: the whole idea of the
\tablenotes list environment is set to be 'tablewidth' wide.
Therefore, merely make your own list that inherits the existing
\linewidth set by the multicols environment. A lame example:

   \setlength{\columnsep}{0pt}
   \setlength{\columnseprule}{1pt}
   \setlength{\multicolsep}{0pt}
   \newcommand{\mcmakelabel}[1]{\textsuperscript#1}
   \newenvironment{mctablenotes}%
    {\begin{footnotesize}\begin{list}{}{\topsep 0pt \partopsep  0pt
     \setlength\itemsep{4pt plus 1pt minus 1pt} \leftmargin 0pt
     \parsep 0pt \itemindent 0pt \labelsep 0pt \raggedright}%
     \settowidth{\labelwidth}{\textsuperscript 1}%
     \renewcommand{\makelabel}{\mcmakelabel}}%
    {\end{list}\end{footnotesize}}%

   \begin{multicols}{2}
    \begin{mctablenotes}
     \item[1] Also known as code-n-fix.
     \item[2] For teams of ``code monkeys''
    \end{mctablenotes}
   \end{multicols}

— enter code hereBil Kleb, Hampton, {filter}ia

As a beginner, I still don't understand it all: does this already contain "the" answer? Help appreciated!

Best Answer

The right command to act on is indeed \TPTnoteSettings, but its standard definition must be preserved, because it contains essential information for typesetting the notes. The best is to add to it and etoolbox provides a simple way.

\documentclass{article}
\usepackage{threeparttable,booktabs}
\usepackage{etoolbox}
\appto\TPTnoteSettings{\footnotesize}

\begin{document}
\begin{table}
\begin{threeparttable}[b]
\caption{A caption}
\begin{tabular}{llll}
\toprule
42\tnote{1} & some & text & to have room\\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item [1] the first note
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}

enter image description here