[Tex/LaTex] Increase width of the caption in threeparttable

captionstablesthreeparttable

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.

Best Answer

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