三部分表格笔记布局

三部分表格笔记布局

我正在使用 threeparttable 向我的表添加注释。这是一个最小的工作示例:

\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} 

生成以下内容:

三部分表

因此我需要像在普通文本中一样设置同一行注释之间的最小距离。这可能吗?

答案1

在此处输入图片描述

设置parathreeparttable使用了一组有趣的惩罚和粘合,但我认为您只是想改变指示的长度(默认值是1em我在这里更改的6em)无关,但我也改为[h]因为[htp]h自己使用是要求浮点数转到文档的末尾。

\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} 

答案2

环境{NiceTabular}nicematrix一个内置命令,\tabularnote用于在表格后编写注释。此注释列表由包的工具编写enumitem。可以使用提供的所有键进行自定义enumitem。例如,para可以使用键设置在两个注释之间插入的标记(在模式下)itemjoin

\documentclass[12pt]{memoir}
\usepackage{nicematrix,enumitem}

\begin{document}

\begin{table}[h]
\caption{Some very informative caption}
\centering
\NiceMatrixOptions{notes/para}
\begin{NiceTabular}{c c c c}
    \toprule
    \RowStyle{\bfseries}
    1st Column & 2nd Column & 3rd Column & 4th Column \\ \midrule
    QWERTY\tabularnote{qwerty}  & & &  \\
    ASDFGH\tabularnote{asdefgh} & & &  \\ \bottomrule
\end{NiceTabular}
\label{table:simDisimCoefNewDef}
\end{table}


\begin{table}[h]
\caption{Some very informative caption}
\centering
\NiceMatrixOptions{notes/para,notes/enumitem-keys-para={itemjoin = ;\;}}
\begin{NiceTabular}{c c c c}
    \toprule
    \RowStyle{\bfseries}
    1st Column & 2nd Column & 3rd Column & 4th Column \\ \midrule
    QWERTY\tabularnote{qwerty}  & & &  \\
    ASDFGH\tabularnote{asdefgh} & & &  \\ \bottomrule
\end{NiceTabular}
\label{table:simDisimCoefNewDef}
\end{table}

\end{document} 

上述代码的输出

相关内容