10

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!

1
  • You've added lots of links but you haven't supplied a working example nor said what change you want to make. Make a small document using this environment and if \renewcommand{\TPTnoteSettings}{\small} doesn't do what you want then describe in what way you want it to do something different. Apr 13, 2013 at 21:43

2 Answers 2

8

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

4
  • "Elsewhere I spotted \renewcommand{\TPTnoteSettings}{\small\linespread{1}\selectfont}, though I'm not sure what the \selectfont part does: what does it do?" Apr 14, 2013 at 5:25
  • using \appto\TPTnoteSettings{\footnotesize} would allow me to drop \small from the previous comment's code; but what about \linespread{1} - where should that be included best? Should that (still) be included, or are there better ways (of making those linespacings narrower)? Apr 14, 2013 at 6:12
  • 1
    @nuttyaboutnatty Add \linespread{1} before \footnotesize.
    – egreg
    Apr 14, 2013 at 8:15
  • @egreg: Unfortunately this does not work in case of using para and flushleft in threeparttable's preamble config. See here: tex.stackexchange.com/questions/563750/…
    – Dave
    Sep 22, 2020 at 13:04
4

I used a simpler approach which was adequate for my needs

...
\begin{tablenotes}
\footnotesize
\item [1] See \url{https://texblog.org/2012/08/29/changing-the-font-size-in-latex/}
\end{tablenotes}
...

Which was inspired by https://texblog.org/2012/08/29/changing-the-font-size-in-latex/

FYI: I added the URL in the item note as my table has a series of long URLs I needed to fit within the column width.

You must log in to answer this question.

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