感谢这篇文章带三部分桌子的长桌(但我无法评论,因为我真的是新手)我发现,如果我使用 threeparttable 包,我可以使用带有 longtable 的脚注。
但是,我想在笔记上方加一条线。有人知道怎么做吗?(我想要这样的东西)
这是我的代码示例。表 1(longtable)是带有 ThreePartTable 包的脚注的表。注释上方没有行。表 2(带有 minipage 环境)注释上方有行。我希望表 1 中也有类似的行。
\documentclass[a4paper]{article}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{lipsum}
\usepackage{booktabs,threeparttablex}
\usepackage{etoolbox}
\appto\TPTnoteSettings{\footnotesize}
\usepackage{caption}
\usepackage[labelfont=bf,labelsep=period]{caption}
\begin{document}
\lipsum[2-3]
\begin{ThreePartTable}
\renewcommand\TPTminimum{\textwidth}
\setlength\LTleft{0pt}
\begin{TableNotes}
\item[*] A note adsfasdf
\item[] Another note asdfasfasd
\end{TableNotes}
\begin{longtable}{|l|l|l|l|l|l|}
\caption{\textit{AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA}} \\
\hline
\textbf{Col1} & \textbf{Col2} & \textbf{Col3\tnote{*}} & \textbf{Col4} & \textbf{Col5} & \textbf{Col6\tnote{}} \\
\hline
\endfirsthead
\multicolumn{6}{l}{\tablename\ \thetable:
\textit{AAAAAAAAAAAAAAA}(Cont\ldots)}\\
\hline
\textbf{Col1} & \textbf{Col2} & \textbf{Col3} & \textbf{Col4} & \textbf{Col5} & \textbf{Col6} \\
\hline
\endhead
\hline \multicolumn{6}{l}{}\\
\endfoot
\insertTableNotes
\endlastfoot
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\multirow{3}{*}{23412} & AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
& AAAA & A & AAAAAAA & AAAAAAA & A \\
\hline
\end{longtable}
\end{ThreePartTable}
\begin{table}[!ht]
\centering
\caption{AAAAAAAAAAAAAAAAAAAA}
\begin{minipage}{\textwidth}
\renewcommand*{\thempfootnote}{\fnsymbol{mpfootnote}}
\begin{tabular}{|l|l|l|l|l|l|}
\hline
\textbf{Col1} & \textbf{Col2} & \textbf{Col3\footnote[1]{A note adsfasdf}} & \textbf{Col4} & \textbf{Col5} & \textbf{Col6\footnote[0]{Another note asdfasfasd}} \\
\hline
AAAAAA & AAAAAA & A & AAAAAA & AAAAAA & A \\
\hline
AAAAAA & AAAAAA & A & AAAAAA & AAAAAA & A \\
\hline
AAAAAA & AAAAAA & A & AAAAAA & AAAAAA & A \\
\hline
AAAAAA & AAAAAA & A & AAAAAA & AAAAAA & A \\
\hline
\end{tabular}
\end{minipage}
\end{table}
\end{document}
提前致谢!
答案1
感谢 Bernard,问题解决了!
使用 ThreePartTable 在脚注上方放置水平线的方法是(与 minipage 环境的脚注类似):
\noalign {\rule [-1.4ex]{6.7cm}{0.4pt}}