这就是我想做的事情:
\documentclass[11pt,oneside]{article}
\usepackage{tablefootnote}
\begin{document}
\begin{tabular}{l}
Hello\footnote{World!} \\
Hello\tablefootnote{World!} \\
\end{tabular}
\end{document}
我看见了脚注标记,但没有看见脚注文本。这是怎么回事?
答案1
我将假设在您的实际文档中,与表格材料相关的脚注比“World”稍微简单一些。如果确实如此,您可能需要熟悉这个功能强大的threeparttable
包、它的\tnote
宏和它的tablenotes
环境。的参数\tnote
可以是任何符号,如果需要,可以重复参数。
\documentclass[11pt]{article}
\usepackage{threeparttable,array}
\begin{document}
\begin{center}
\setlength\extrarowheight{2pt} % for a more open look
\begin{threeparttable}
\begin{tabular}{l}
\hline
Hello\tnote{a} \\
Goodbye\tnote{*} \\
\hline
\end{tabular}
\footnotesize
\begin{tablenotes}
\item[a] World!
\item[*] World.
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{document}
答案2
使用时表脚注,在表格的第一行中,它应该是\tablefootnote
而不是\footnote
。然后这两个\tablefootnote
命令在 中tabular
,但不在table
环境中。添加一个table
环境:
\begin{table}
\begin{tabular}{l}
Hello\footnote{World!} \\
Hello\tablefootnote{World!} \\
\end{tabular}
\end{table}
(有可能\centering
,\caption[...]{...}
,\label{...}
, ...),
或者\spewnotes
在表格后面,以便 tablefootnote 包知道您已经完成了表格:
\begin{tabular}{l}
Hello\footnote{World!} \\
Hello\tablefootnote{World!} \\
\end{tabular}
\spewnotes
该命令\spewnotes
尚未在当前版本 2014/01/27 1.1c 的 tablefootnote 软件包中定义,因此
\usepackage{tablefootnote}
有必要写:
\makeatletter
\@ifpackagelater{tablefootnote}{2014/01/27}
{\relax% should include \spewnotes
}%
{\newcommand{\spewnotes}{%
\ltx@ifpackageloaded{footnotebackref}{%
\LetLtxMacro{\tfncurrentmft}{\@makefntext}%
\LetLtxMacro{\@makefntext}{\tablemakefntext}%
\tfn@tablefootnoteprintout%
\LetLtxMacro{\@makefntext}{\tfncurrentmft}%
}{% footnotebackref not loaded
\tfn@tablefootnoteprintout%
}%
\gdef\tfn@fnt{0}%
\global\let\tfn@tablefootnoteprintout\relax% just to be sure and safe
}%
}
\makeatother
因此,完整文件内容如下:
\documentclass[11pt,oneside]{article}
\usepackage{tablefootnote}
\makeatletter
\@ifpackagelater{tablefootnote}{2014/01/27}
{% should include \spewnotes
}%
{\newcommand{\spewnotes}{%
\ltx@ifpackageloaded{footnotebackref}{%
\LetLtxMacro{\tfncurrentmft}{\@makefntext}%
\LetLtxMacro{\@makefntext}{\tablemakefntext}%
\tfn@tablefootnoteprintout%
\LetLtxMacro{\@makefntext}{\tfncurrentmft}%
}{% footnotebackref not loaded
\tfn@tablefootnoteprintout%
}%
\gdef\tfn@fnt{0}%
\global\let\tfn@tablefootnoteprintout\relax% just to be sure and safe
}%
}
\makeatother
\begin{document}
\begin{tabular}{l}
Hello\tablefootnote{World!} \\
Hello\tablefootnote{World!} \\
\end{tabular}
\spewnotes
\end{document}