# threeparttable: How to change font size of threeparttable's table notes when also using flushleft?

I want to modify the font size of tnotes in threeparttables based on this approach of user egreg.

Minimum Working Example (MWE) of functional approach:

\documentclass{article}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{etoolbox}

\appto\TPTnoteSettings{\footnotesize}% <-- decreases font size of tnote

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


This solution works completely fine as long as I do NOT add flushleft into the preamble config of threeparttable. As soon as I add this additional config, the upper solution does not work anymore.

Minimum Working Example (MWE) of non-functional approach:

\documentclass{article}
\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}% <-- added para and flushleft
\usepackage{etoolbox}

\appto\TPTnoteSettings{\footnotesize}% <-- decreases font size of tnote

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


Any ideas on how to solve this?

• Why not just write \footnotesize right before \begin{tablenotes}?
– Mico
Sep 22 '20 at 13:05
• Then how about executing \AtBeginEnvironment{tablenotes}{\footnotesize} in the preamble?
– Mico
Sep 22 '20 at 13:11
• The problem is how the flushleft option is defined, it has a setup macro which when executed overwrites what ever is in \TPTnoteSettings instead of adding to it. Sep 22 '20 at 13:24
• @Mico: Awesome, thank you! Why not posting this as an answer? :-)
– Dave
Sep 22 '20 at 13:26
• Micos solution is much simpler, as otherwise you'll need to patch like this: \makeatletter \patchcmd{\TPT@opt@flushleft}{\def\TPTnoteSettings{\labelsep.2em \leftmargin\z@ \labelwidth\z@}}{\def\TPTnoteSettings{\labelsep.2em \leftmargin\z@ \labelwidth\z@\tiny}}{}{\NOPE} \makeatother which is horrible. Sep 22 '20 at 13:34

You can add \footnotesize to another macro:

\documentclass{article}
\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}
\usepackage{etoolbox}

\appto\TPTdoTablenotes{\footnotesize}

\begin{document}

\begin{table}

\begin{threeparttable}[b]
\caption{A caption}

\begin{tabular}{llll}
\toprule
Test\tnote{1} & some & text & to have room\\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item [1] the first tnote long enough to see at least a line break
\end{tablenotes}
\end{threeparttable}

\end{table}

\end{document}


• Just out of curiosity: Other than demonstrating advanced knowledge about the inner workings of the threeparttable package, are there practical advantages to running \appto\TPTdoTablenotes{\footnotesize} instead of \AtBeginEnvironment{tablenotes}{\footnotesize}?
– Mico
Sep 22 '20 at 14:21
• @Mico I happen to not like \AtBeginEnvironment… ;-) Sep 22 '20 at 14:37

Your formatting objective may be achieved robustly by running

\usepackage{etoolbox}
\AtBeginEnvironment{tablenotes}{\footnotesize}


in the preamble.

A full MWE -- note that it runs both \smallskip and \footnotesize at the start of each tablenotes environment:

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

\usepackage{etoolbox}
\AtBeginEnvironment{tablenotes}{\smallskip\footnotesize}

\begin{document}
\begin{table}
\centering
\begin{threeparttable}
\caption{A caption}
\begin{tabular}{llll}
\toprule
Test\tnote{1} & some & text & to have room\\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[1] The first tnote
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}