1

I wonder how to restore width of the caption in threeparttable environment to regular table environment. It is important that caption is inside threeparttable environment. In other words I want to increase caption width (Figure 1).

enter image description here

The minimal working example goes as follows:

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

\begin{document}

\begin{table}
\centering
\begin{threeparttable}
\caption{This is example table with width equal to default width in table environment}
\begin{tabular}{cccc}
\toprule
Col 1& Col 2 & Col 3 & Col 4 \\
\midrule
1 &  2 &  3 &  4 \\
5 &  6 &  7 &  8 \\
9 & 10 & 11 & 12 \\
\bottomrule
\end{tabular}
\begin{tablenotes}[flushleft]\footnotesize
\item[1] Long, long, long, long, long, long, note
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document}

When I insert \renewcommand\TPTminimum{\linewidth} before \caption{...} the width extends, but the table in left aligned (Figure 2 below).

Figure2

Any suggestion or pointer is greatly appreciated.

  • 1
    Why is it important that the caption is inside threeparttable? – egreg Nov 5 '17 at 12:03
  • @egreg Because I need to put footnote also in the caption. – Andrej Nov 5 '17 at 12:18
  • The environment basically typesets a \vbox where the \hsize is the maximum between the table width and \TPTminimum. – egreg Nov 5 '17 at 12:27
  • You can move the caption outside threeparttable, but still inside table. – Michael Palmer Nov 5 '17 at 12:49
  • @MichaelPalmer Now I use \caption{This is example table with width equal \ldots\tnote{a}} outside the threeparttable. However, the notes are printed below the table but the footnote mark in caption is omitted. – Andrej Nov 5 '17 at 12:54
2

The macro \tnote is defined in such a way that it will not function outside the threeparttable environment. This is mostly to prevent it from showing up in the \listoftables.

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

\begin{document}

\listoftables

\begin{table}
\let\TPToverlap=\TPTrlap
\centering
\caption{This is example table with width equal to default width in table 
  environment\tnote{1}}
\begin{threeparttable}
\begin{tabular}{cccc}
\toprule
Col 1& Col 2 & Col 3 & Col 4 \\
\midrule
1 &  2 &  3 &  4 \\
5 &  6 &  7 &  8 \\
9 & 10 & 11 & 12 \\
\bottomrule
\end{tabular}
\begin{tablenotes}[flushleft]\footnotesize
\item[1] Long, long, long, long, long, long, note
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document}

demo 1


If you also want the notes wider, you can put the tabular inside another tabular.

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

\newlength{\mymargin}

\begin{document}

\begin{table}
\begin{threeparttable}
\caption{This is example table with width equal to default width in table 
  environment\tnote{1}}
\begin{tabular}{@{}p{\textwidth}@{}}
\centering
\begin{tabular}{cccc}
\toprule
Col 1& Col 2 & Col 3 & Col 4 \\
\midrule
1 &  2 &  3 &  4 \\
5 &  6 &  7 &  8 \\
9 & 10 & 11 & 12 \\
\bottomrule
\end{tabular}
\end{tabular}
\begin{tablenotes}[flushleft]\footnotesize
\item[1] Long, long, long, long, long, long, note
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document}

demo 2

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.