![在表格下方添加几个脚注](https://linux22.com/image/301503/%E5%9C%A8%E8%A1%A8%E6%A0%BC%E4%B8%8B%E6%96%B9%E6%B7%BB%E5%8A%A0%E5%87%A0%E4%B8%AA%E8%84%9A%E6%B3%A8.png)
我无法将注释放在表格下方 - 我想将几条注释放在表格下方,但脚注似乎被拉长了,导致表格比必要的更长。有办法解决这个问题吗?
\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}