1

Given the threeparttable

\documentclass{scrartcl}

\usepackage{booktabs,threeparttable}

\begin{document}

\begin{table}[htb]
    \centering
    \begin{threeparttable}
        \caption{caption}
        \begin{tabular}{lll}
            \toprule
            abc &   def &   ghi     \\ \midrule
            abc1    &   def1    &   ghi1    \\ \bottomrule
        \end{tabular}
        \begin{tablenotes}
            \item Source: xyz
        \end{tablenotes}
    \end{threeparttable}    
\end{table}

\end{document}

how can I center the tablenotes (or a single item, if this should be easier), so that the tablenote is horizontally aligned with the caption of the table?

1 Answer 1

2

If you don't use \tnote directives and have a single line in the tablenotes environment, you are basically misusing (abusing, really) a key part of the threeparttable machinery. Don't do it. In such cases, just issue a \centering directive immediately before the line that follows the tabular environment in order to achieve your formatting objective.

If you do have one or more \tnote directives, I suggest you load the threeparttable package with the option flushleft.

Both possibilities are explored in the following screenshot and associated LaTeX code.

enter image description here

\documentclass{scrartcl}

\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}
\renewcommand{\TPTtagStyle}{\itshape}

\begin{document}

\begin{table}[htb] 
    \centering
    \begin{threeparttable} % Case 1: no '\tnote' directives
        \caption{Caption}
        \begin{tabular}{@{}lll@{}}
            \toprule
            abc     &   def     &   ghi     \\ \midrule
            abcde1  &   defgh1  &   ghijk1  \\ \bottomrule
        \end{tabular}

        \smallskip\footnotesize\centering % <-- note the '\centering' directive
        Source: xyz
    \end{threeparttable}    

    \bigskip\bigskip

    \begin{threeparttable} % Case 2: with '\tnote' directives
        \caption{Caption}
        \begin{tabular}{@{}lll@{}}
            \toprule
            abc     &   def     &   ghi\tnote{a} \\ \midrule
            abcde1  &   defgh1  &   ghijk1       \\ \bottomrule
        \end{tabular}

        \smallskip
        \begin{tablenotes}
        \footnotesize
        \item[a] Source: xyz
        \end{tablenotes}
    \end{threeparttable}    
\end{table}

\end{document}
4
  • Thanks for your help, this did work. As you mentioned I tried to (ab)use the threeparttable only for the source below the table itself. I found a workaround where I put "Source: xyz" in a starred caption below the table and therefore can omit threeparttable entirely.
    – Lukas
    Jan 3, 2022 at 13:27
  • 1
    @Lukas - You're welcome. Don't give up too quickly on the threeparttable machinery, though. It's very handy (essential, really) if you need to limit the width of the caption and other explanatory material (such as "Source: xyz") to the width of the tabular environment.
    – Mico
    Jan 3, 2022 at 13:37
  • @Miko thanks for the information, I will keep it in my mind for future tasks. Regarding my workaround with the starred caption: Is there a possibility to change the space before and after the caption* without affecting the unstarred command? Or should I open a new question for this?
    – Lukas
    Jan 3, 2022 at 13:40
  • @Lukas - Please post a new query.
    – Mico
    Jan 3, 2022 at 13:48

You must log in to answer this question.

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