# Set width of tablenotes

I have a document that is tangled up beyond belief in different stylesheets, tables, settings and whatnot. Right now, my tablenotes (used as part of threeparttable) are too narrow for some of my tables and I need a final duct tape solution to just patch things up.

Is there an option that I can change/invoke to just make the tablenotes wider (that is, just set the width myself)? I've looked through the readme for threeparttable but I can't find any variable or option listed to do this.

(And unfortunately: No, I can't post a minimal working example. It wouldn't be minimal at all. As often is the case when using LaTeX, I've had to use different emergency solutions here, there and everywhere to make the whole thing float. The whole document is just a big mess by this point in time.)

• unfortunately your question without mwe is not answerable :( Aug 29 '17 at 12:07
• @Zarko Of course it is! The answer might be "no, there isn't", but it can clearly be answered. My reasoning is that tablenotes have to get it's width from some kind of hidden variable that has some value that potentially can be accessed and changed. Aug 29 '17 at 12:30

You can insert your tabular as the central column of a \tabularx{some width}{XcX} with first and last columns empty. Here is an example, adapted from a recent answer of mine:

\documentclass{article}

\usepackage{booktabs, tabularx}
\usepackage{threeparttable}
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\TPT@doparanotes}{%
\hskip 1em\@plus .3em}{%
\hskip 0.75em\@plus .25em}
\makeatother

%% Define a few struts
%% (from code by Claudio Beccari in TeX and TUG News, Vol. 2, 1993)
\newcommand\Tstrut{\rule{0pt}{2.7ex}} % "top" strut

\begin{document}

\begin{table}[!htb]
\centering
\begin{threeparttable}
\caption{Name}
\begin{tabularx}{10cm}{XcX}
& \begin{tabular}{c|*{7}{c}}
\toprule
& B & C & D & E & F & G & H\\
\hline
A & 1 & 2 & 3 & 4 & 5 & 6 & 7\Tstrut\\
B & & 9 & 0 & 1 & 2 & 3 & 4\\
C & & & 5 & 6 & 7 & 8 & 9\\
D & & & & 0 & 1 & 2 & 3\\
E & & & & & 4 & 5 & 6\\
F & & & & & & 7 & 8\\
G & & & & & & & 9\\
\bottomrule
\end{tabular} &
\end{tabularx}
\begin{tablenotes}[para, online]\footnotesize\smallskip%
\def\tnote#1{\protect\TPToverlap{\TPTtagStyle{#1}}}%
\item[A]--- Apple,
\item[B]--- Banana,
\item[C]--- Cherry,
\item[D]--- Date,
\item[E]--- Elderberry,
\item[F]--- Fig,
\item[G]--- Grape,
\item[H]--- Honeydew melon.
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document}