Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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} 
share|improve this answer
1  
I guess the question is how to remove the additional space and use a normal interword space (instead of 6em use 0em, of course). I'd notice also that \centering is to be used instead of center and that the \label should be nearer to the caption (just in case some \refstepcounter comes along). –  egreg Jun 11 '13 at 23:00
    
It works with David code and @egreg advice. –  alchemist_ bg Jun 11 '13 at 23:13
    
@David Carlisle, could you please explain your code because I noticed different output in some cases, e.g. when putting \textit in \item. What are all this penalties for? –  alchemist_ bg Jun 12 '13 at 6:38
1  
@alchemist_bg it's not my code the definition is just copied from three part table I just changed 1em to 6em I'm not sure why Donald had quite such a complicated collection, but he knows what he's doing:-) basically the idea is to allow extra flexibility between the notes and to encourage line breaking there rather than inside the note if possible. –  David Carlisle Jun 12 '13 at 7:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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