效果图: 代码如下: 选自:http://tex.stackexchange.com/questions/51793/caption-and-footnote-width-with-ctable\documentclass{article}
\usepackage{booktabs}
\makeatletter
\newsavebox{\@tabnotebox}
\providecommand\tmark{} % so having ctable or not is irrelevant
\providecommand\tnote{}
\newenvironment{tabularwithnotes}[3][c]
{\long\def\@tabnotes{#3}%
\renewcommand\tmark[1][a]{\makebox[0pt][l]{\textsuperscript{\itshape##1}}}%
\renewcommand\tnote[2][a]{\textsuperscript{\itshape##1}\,##2\par}
\begin{lrbox}{\@tabnotebox}
\begin{tabular}{#2}}
{\end{tabular}\end{lrbox}%
\parbox{\wd\@tabnotebox}{
\usebox{\@tabnotebox}\par
\smallskip\@tabnotes
}%
}
\makeatother
\begin{document}
\begin{table}
\centering
\caption{Somewhat long long long caption which is long}
\medskip
\begin{tabularwithnotes}{lr}
{
\tnote[a]{Short footnote}
\tnote[b]{Short footnote}
}
\toprule
Header 1 & Header 2 \\
\midrule
foo\tmark[a] & 1\tmark[b] \\
\bottomrule
\end{tabularwithnotes}
\end{table}
\end{document}
发表评论 取消回复