如何在我的表格中添加表格注释?

如何在我的表格中添加表格注释?
\documentclass[preprint,floatfix] {revtex4} 
\usepackage{caption}
\usepackage{booktabs}

\begin{document}

\renewcommand{\thetable}{\arabic{table}}

\begingroup
\squeezetable
\begin{table}
\captionsetup{font=scriptsize}
\caption {\label{tab:table1} SUMMARY STATISTICS FOR CONTRIBUTIONS BY INDIVIDUAL CONTRIBUTORS}
\begin{ruledtabular}
\begin{tabular}{llllll}
  & \multicolumn{2}{c}{Pre-block}  & \multicolumn{2}{c}{Post-block} & Paired \textit{t}-test   \\ 
\cline{2-3} \cline{4-5} \cline{6-6}

        &  Mean   & Standard error                                                  &   Mean          
    & Standard error    & \textit{t}-stats                                                  \\    \hline




\input{table1_panelA} 
\hline
\addlinespace[0.3cm]
\input{table1_panelB}

\end{tabular}

\end{ruledtabular}

\end{table}
\endgroup






\end{document}




答案1

  • 切题问题:使用threeparttable是解决您的问题的有希望的方法(正如@ AboAmmar 评论中所建议的并在@js Bibra 答案中提供了一个示例)
  • 无关问题,我会对你的表格设计做以下更改:
    • 而不是revtex4使用支持包revtex4-2中规则的文档类版本booktabs
    • 对于水平规则,请使用booktabs包中定义的规则
    • 对于带有数字的列,使用包S中定义的列类型siunitx
  • 使用虚拟数字作为表格内容,MWE 可以是:
\documentclass[preprint,floatfix] {revtex4-2}
%\usepackage{caption}
%\captionsetup{font=scriptsize}
\usepackage{booktabs, 
            multirow, threeparttable}   % new
\usepackage{siunitx}                    % new
\usepackage{xparse}                     % new
\NewExpandableDocumentCommand\mcc{O{1}m}
    {\multicolumn{#1}{c}{#2}}

\usepackage{lipsum}                     % for dummy text


\begin{document}
\lipsum[11]
    \begin{table}[ht]
\begin{threeparttable}
\caption {Summary statistics for contributions by individual contributors}
\label{tab:table1}
    \begin{tabular}{l
               *{2}{S[table-format=3.2]S[table-format=3.2]}
                    S[table-format=3.2]}
    \toprule
\multirow{2.4}{*}{Contributor}
    & \mcc[2]{Pre-block}        & \mcc[2]{Post-block}   & {Paired $t$-test}     \\
   \cmidrule(l){2-3} 
   \cmidrule(l){4-5} 
   \cmidrule(l){6-6}
    &  {Mean}   & {SE\tnote{a}} & {Mean}    & {SE}      & {\textit{t}-stats}    \\                                               &  {Mean}   & {SE\tnote{a}} & {Mean}    & {SE}      & {\textit{t}-stats}    \\                                                   \midrule
panel A\tnote{b}
    & 123.45    & 12.3          &  123.45    & 12.3     & 123.45                \\
    \midrule
panel B\tnote{c}
    & 124.82    &  9.1          &  124.82    &  9.1     & 124.8                 \\
    & 124.82    &  9.1          &  124.82    &  9.1     & 124.8                 \\
    \bottomrule
\end{tabular}
    \begin{tablenotes}[flushleft]\footnotesize
\item[a]    SE: Standard error
\item[b]    description of th panel A
\item[c]    description of the panel B
    \end{tablenotes}
\end{threeparttable}
    \end{table}
\end{document}

在此处输入图片描述

答案2

您可以使用{NiceTabular}nicematrix内置命令\tabularnote来排版表格的注释。您可以完全自定义注释(表格下的注释以 的列表类型编写enumitem)。

\documentclass{article}

\usepackage{nicematrix}
\usepackage{enumitem}

\begin{document}
\begin{table*}[ht]
\caption{Revisions}
\centering
\begin{NiceTabular}{p{0.10\linewidth}
                    p{0.15\linewidth}        
                    p{0.45\linewidth}
                    p{0.20\linewidth}}%
\hline
Title 1 & Title 2 & Title 3 & Title 4 \\
\hline
Cell 1  & Cell 1  & Cell 3  & Cell 4\tabularnote{My note} \\
Cell 1  & Cell 1  & Cell 3  & Cell 4\tabularnote{My other note} \\
\hline
\end{NiceTabular}
\end{table*}
\end{document}

上述代码的输出

答案3

从@AboAmmar 的出色建议开始

在此处输入图片描述

平均能量损失

\documentclass{article}
\usepackage[flushleft]{threeparttable}
\begin{document}
    \begin{table*}[ht]
        \caption{Revisions}
        \begin{threeparttable}
            \centering
            \begin{tabular}{p{0.10\linewidth}
                    p{0.15\linewidth}
                    p{0.45\linewidth}
                    p{0.20\linewidth}}
                \hline
                Title 1 & Title 2 & Title 3 & Title 4          \\
                \hline
                Cell 1  & Cell 1  & Cell 3  & Cell 4 \tnote{a} \\
                Cell 1  & Cell 1  & Cell 3  & Cell 4 \tnote{b} \\
                \hline
            \end{tabular}
            \begin{tablenotes}
                \item[a] My Note.
                \item[b] My Other Note.
            \end{tablenotes}
        \end{threeparttable}
    \end{table*}
\end{document}

此解决方案已存在于 -https://tex.stackexchange.com/a/146129/197451

相关内容