[Tex/LaTex] threeparttable notes layout

notesthreeparttable

I am using threeparttable for adding notes to my table. Here is a minimal working example:

\documentclass[12pt]{memoir}

\usepackage[para,online,flushleft]{threeparttable}

\begin{document}
\par
Lets test the threeparttable package.
\begin{table}[h]
\caption{Some very informative caption}
\begin{center}
\begin{threeparttable}
\begin{tabular}{c c c c}
    \toprule
    \textbf{1st Column} & \textbf{2nd Colimn} & \textbf{3rd Colimn} & \textbf{4th Colimn} \\ \midrule
      QWERTY\tnote{1}   &                     &                     &  \\
      ASDFGH\tnote{2}   &                     &                     &  \\ \bottomrule
\end{tabular}
\begin{tablenotes}
\item[1] qwerty; \item[2] asdfgh
\end{tablenotes}
\end{threeparttable}
\end{center}
\label{table:simDisimCoefNewDef}
\end{table}
\end{document} 

which produce the following:

threeparttable

So what I need is to set minimum distance between notes on same line like in normal text. Is that possible?

Best Answer

enter image description here

The para setting in threeparttable uses an interesting collection of penalties and glue but I think you just want to change the length indicated (the default is 1em I changed it to 6em here) Unrelated but I also changed [h] to [htp] as using h on its own is asking the float to go to the end of the document.

\documentclass[12pt]{memoir}

\usepackage[para,online,flushleft]{threeparttable}

\makeatletter
\def\TPT@doparanotes{\par
   \prevdepth\z@ \TPT@hsize
   \TPTnoteSettings
   \parindent\z@ \pretolerance 8
   \linepenalty 200
   \renewcommand\item[1][]{\relax\ifhmode \begingroup
       \unskip
       \advance\hsize 10em % \hsize is scratch register, based on real hsize
       \penalty -45 \hskip\z@\@plus\hsize \penalty-19
       \hskip .15\hsize \penalty 9999 \hskip-.15\hsize
       \hskip .01\hsize\@plus-\hsize\@minus.01\hsize 
       \hskip 6em\@plus .3em
              %%%%%
      \endgroup\fi
      \tnote{##1}\,\ignorespaces}%
   \let\TPToverlap\relax
   \def\endtablenotes{\par}%
}

\makeatother
\begin{document}
\par
Lets test the threeparttable package.
\begin{table}[htp]
\caption{Some very informative caption}
\begin{center}
\begin{threeparttable}
\begin{tabular}{c c c c}
    \toprule
    \textbf{1st Column} & \textbf{2nd Colimn} & \textbf{3rd Colimn} & \textbf{4th Colimn} \\ \midrule
      QWERTY\tnote{1}   &                     &                     &  \\
      ASDFGH\tnote{2}   &                     &                     &  \\ \bottomrule
\end{tabular}
\begin{tablenotes}
\item[1] qwerty; \item[2] asdfgh
\end{tablenotes}
\end{threeparttable}
\end{center}
\label{table:simDisimCoefNewDef}
\end{table}
\end{document}