1

In the past I have been using tabularx, caption and parnotes packages to design my tables. Now the user John Kormylo has mentioned the package threeparttable:

What advantages does threeparttable provide over the other packages mentioned?


My classic approach looked like that so far:

\documentclass{article}
\usepackage{tabularx}
\usepackage{caption}
\usepackage{parnotes}

\begin{document}
\begin{table}[htbp]
    \caption{This is the caption}
    \begin{tabularx}{\textwidth}{|l|l|}
        \parnoteclear
        Bla\parnote{First parnote} & Blub\parnote{Second parnote} \\
        \end{tabularx}
        \parnotes
\end{table}
\end{document}
  • When does it make sense to go ahead with threeparttable?
  • While common parnotes refer to their item identifiers automatically by themselves, in threeparttable I would manually have to type 42\tnote{1} within the table and

    \begin{tablenotes} \item [1] the first note ... \end{tablenotes}

    below the table where I want to put my notes. This seems to be way more time consuming than just using \parnote{This is a parnote} and get everything done by itself?

Dave
  • 3,758
  • 3
    Another advantage of threeparttable is that the caption width is set to the real width of the table, which maybe useful in some cases. – Bernard Mar 31 '19 at 21:41
  • @Bernard: Hmm yes, but in the upper MWE this is just one more line of code \captionsetup{width=0.8\textwidth} and it's done, isn't it? – Dave Mar 31 '19 at 21:43
  • 2
    How do you know the table width is exactly 0.8\textwidth? And if you decide to change the table font size, what do you do? – Bernard Mar 31 '19 at 21:44
  • @Bernard: Thanks for your help! You said: "How do you know the table width is exactly 0.8\textwidth?" - I've expected it will be exactly 0.8 when writing \begin{tabularx}{0.8\textwidth}..., or could there be some issues? – Dave Mar 31 '19 at 21:47
  • @egreg: I think the parnotes always keep attached to the table while common footnotes appear in the document footer, or am I wrong? At least, that is what the upper MWE does. – Dave Mar 31 '19 at 21:48
  • @egreg: You said: "By the way, don't abuse tabularx" - oh, did I do that in the upper MWE? I thought this is common usage of tabularx? – Dave Mar 31 '19 at 21:51
  • 2
    If you use tabularx the problem is different. Anyway, other packages measure the width of tables or figures, such as floatrow. – Bernard Mar 31 '19 at 21:54
  • 2
    @Dave Don't make tables artificially wider than they are. The more white space in them, the less readable they are. Exception: tables that are almost equal to the column width may be made to fit it (with tabular*, usually). – egreg Mar 31 '19 at 21:55
  • the tabularx usage here is wrong, you have two l columns and no X but as egreg hints, it is better not to use tabularx here. Only use tabularx if you have tables with paragraphs in the cells and tabularx can control the line breaking – David Carlisle Mar 31 '19 at 22:11

0 Answers0