LaTeX技巧646:表格注脚与表格内容自动对齐

标签:
latextextabletabnotetablenote |
分类: 表格制作 |
QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载

选自: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]
\makeatother
\begin{document}
\begin{table}
\centering
\caption{Somewhat long long long caption which is long}
\medskip
\begin{tabularwithnotes}{lr}
\toprule
Header 1 & Header 2 \\
\midrule
foo\tmark[a] & 1\tmark[b] \\
\bottomrule
\end{tabularwithnotes}
\end{table}
\end{document}