在表格下方添加几个脚注

在表格下方添加几个脚注

我无法将注释放在表格下方 - 我想将几条注释放在表格下方,但脚注似乎被拉长了,导致表格比必要的更长。有办法解决这个问题吗?

\begin{table}[htbp]\centering \caption{Summary Statistics}
\begin{tabular}{l c c c}
\hline\hline
\multicolumn{1}{c}{\textbf{Variable}} & \textbf{Mean} & \textbf{Std. Dev.} & \textbf{N}\\
\hline
a & a & a & a \\
\hline
\label{table2}
\multicolumn{3}{l}{\textsuperscript{*}\footnotesize{blah blah}}
\end{tabular}
\end{table}

例子

答案1

您应该使用threeparttable专为此类事情设计的包。在下面的代码中,我添加了caption包以确保标题和表格之间的适当间距,booktabs以及makecell允许对列标题进行通用格式设置的包。

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs, caption, makecell}
\renewcommand\theadfont{\bfseries}
\usepackage{threeparttable}

\begin{document}

\begin{table}[! htbp]\centering \caption{Summary Statistics}
\begin{threeparttable}
\begin{tabular}{l c c c}
\toprule\midrule
\thead{Variable} & \thead{Mean}
 & \thead{Std. Dev.} & \thead{N}\\ \midrule
a & a & a\tnote{*} & a \\
\bottomrule\addlinespace[1ex]
\end{tabular}
\begin{tablenotes}\footnotesize
\item[*] Blahblah
\end{tablenotes}
\end{threeparttable}
\label{table2}
\end{table}

\end{document} 

在此处输入图片描述

答案2

您还可以使用{NiceTabular}及其nicematrix内置命令\tabularnote

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

\begin{document}

\begin{table}[htbp]
\centering
\begin{NiceTabular}{@{}lp{8cm}@{}}
\toprule
\textbf{Activity} & \textbf{Activity Sequence}\\
\midrule
Getting on a Tram\tabularnote{Note that \textit{Getting On Sequence} will start from steady standing in the station.}& Standing, Walking, Turn Left or right, walk, climb up stairs, turn left or right, walk again till reach seat, turn left or right $90°$ or $180°$, seat down, sitting for long time.  \\
 Getting off a Tram\tabularnote{Note that \textit{Getting Off Sequence} will start from steady sitting state in the
   Tram.}& Sitting, stand up, turn left or right $90°$ or $180°$, walk till reach the door, turn left or right to
 reach stairs, climb down, walk out from the Tram.  \\ 
\bottomrule
\end{NiceTabular}
\caption{Getting on/off passengers' activity states}
\label{tab:GettingOnOffPassengersActivityStates}
\end{table}
\end{document}

上述代码的输出

答案3

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{threeparttable}
\usepackage{booktabs, caption, makecell}
\renewcommand\theadfont{\bfseries}
\begin{document}

\begin{table}[htbp]
    \begin{minipage}{10cm}
\begin{threeparttable}[t]
    \centering
\begin{tabular}{|c|c|} 
 \hline
\textbf{Activity} & \textbf{Activity Sequence}\\\hline
 Getting on a Tram \tnote{1}& \multicolumn{1}{m{6cm}|}{Standing, Walking, Turn Left or right, walk, climb up stairs, turn left or right, walk again till reach seat, turn left or right 90$^{\circ}$ or 180$^{\circ}$, seat down, sitting for long time.}  \\\hline 
 Getting off a Tram\tnote{2}& \multicolumn{1}{m{6cm}|}{Sitting, stand up, turn left or right 90$^{\circ}$ or 180$^{\circ}$, walk till reach the door, turn left or right to reach stairs, climb down, walk out from the Tram.}  \\ 
 \hline
\end{tabular}
\begin{tablenotes}
     \item[1] Note that \textit{Getting On Sequence} will start from steady standing in the station.
     \item[2] Note that \textit{Getting Off Sequence} will start from steady sitting state in the Tram.
   \end{tablenotes}
\end{threeparttable}
\end{minipage}
    \caption{Getting on/off passengers' activity states}
    \label{tab:GettingOnOffPassengersActivityStates}
\end{table}
\end{document}

在此处输入图片描述

相关内容