在使用时上threeparttable
标\tnote
超出表格边框:@{}
\documentclass{book}
\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}
\begin{document}
\begin{threeparttable}
\begin{tabular}{@{}ll@{}}
\toprule
First column header & Second column header\tnote{a}\\
\midrule
a & b \\
c & d \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[a] A note.
\end{tablenotes}
\end{threeparttable}
\end{document}
如何避免?
答案1
由于 Ulrike 的解决方案仅增加了表格中一列的宽度,事后看来似乎不成比例,因此我尝试了另一种解决方案\phantom
:
\documentclass{book}
\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}
\usepackage{float}
\usepackage{caption}
\usepackage[margin=10pt,labelfont=bf,labelsep=period,format=hang,
indention=0cm]{caption}
\captionsetup[table]{position=above, aboveskip=2pt}
\begin{document}
\begin{table}
\centering
\caption{Original table}
\begin{threeparttable}
\begin{tabular}{@{}ll@{}}
\toprule
First column header & Second column header\tnote{a}\\
\midrule
a & b \\
c & d \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[a] A note.
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{table}
\centering
\caption{Table with Ulrike's command}
\begin{threeparttable}
\let\TPTrlap\relax
\begin{tabular}{@{}ll@{}}
\toprule
First column header & Second column header\tnote{a}\\
\midrule
a & b \\
c & d \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[a] A note.
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{table}
\centering
\caption{Table with one \textbackslash\texttt{panthom}}
\begin{threeparttable}
\begin{tabular}{@{}ll@{}}
\toprule
First column header & Second column header\tnote{a}\phantom{\textsuperscript{a}}\\
\midrule
a & b \\
c & d \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[a] This looks the same as Ulrike's table.
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{table}
\centering
\caption{Table with two \textbackslash\texttt{panthom}s}
\begin{threeparttable}
\begin{tabular}{@{}ll@{}}
\toprule
First column header\phantom{\textsuperscript{a}} & Second column header\tnote{a}\phantom{\textsuperscript{a}}\\
\midrule
a & b \\
c & d \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[a] This is the solution I prefer.
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{table}
\centering
\caption{Table without @\{\}}
\begin{threeparttable}
\begin{tabular}{ll}
\toprule
First column header & Second column header\tnote{a}\\
\midrule
a & b \\
c & d \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[a] This is the solution egreg and cfr prefer.
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}