LaTeX 中表格的脚注

160

当我在表格中使用\footnote{}命令时,脚注并不会显示出来。如何让它显示出来?而且,是否可能使脚注显示在表格底部而非页面底部?


6
http://tex.stackexchange.com/a/35669/13747 - Handsome Nerd
12个回答

116

不费吹灰之力的最佳方法是使用\tablefootnote命令,来自tablefootnote软件包。将以下内容添加到您的导言部分:

\usepackage{tablefootnote}

它只需正常运作,无需额外的技巧。


42
我使用\tablefootnote命令后,注脚显示出来了,但很遗憾它出现在了表格前一页。 - Nu-hin
3
你有没有一个示例来展示这个行为? - Francesquini
3
有没有办法让脚注和表格出现在同一页上? - Anusha
6
这在嵌套表格中对我不起作用(脚注会重复出现与嵌套表格的次数相同)。 - fffred
5
我会使用float宏包和[H]选项对表格进行排版,以使脚注出现在表格的同一页上。 - mao95
显示剩余3条评论

97

这是LaTeX中经典的困难问题。

问题在于如何处理浮动体(如图表等对象)和脚注的布局。特别是,很难确定一个浮动体放置的位置,并保证为相应的脚注留出空间不会引起问题。因此,标准的tabularfigure环境甚至都没有尝试。

你可以做以下几种选择:

  1. 伪造。只需在标题底部放置硬编码的垂直跳过,然后自己编写脚注(使用\footnotesize来设置字体大小)。你还需要使用\footnotemark自行管理符号或编号。简单,但不太有效,而且脚注不会出现在页面底部。
  2. 使用tabularxlongtablethreeparttable[x](感谢Joseph)或ctable等支持此行为的工具包。
  3. 手动管理。使用[h!](或带有float包的[H])来控制浮动体的位置,并在同一页上使用\footnotetext将脚注放置在想要的位置。同样,使用\footnotemark安装符号。这种方法容易出错,需要手工调整每个实例。
  • footnote包提供了savenote环境,可用于此操作。
  • 使用minipage(代码直接复制,但在这种情况下请阅读有关长标题文本的免责声明):
  •     \begin{figure}
          \begin{minipage}{\textwidth}
            ...
            \caption[LOF中的标题]%
              {真正的标题\footnote{blah}}
          
    

    其他参考资料:TeX FAQ条目表格中的脚注


    http://texblog.org/2012/02/03/using-footnote-in-a-table/ 对我来说是一个不错的替代方案。 - Pio
    1
    @dmckee,在xtable中是否可以获得threeparttable:类似于print.xtable(df,tabular.environment =“threeparttable”)的东西? - Anusha
    @Pio链接是一个很好的参考。使用脚注包解决了我的问题。 - JOHN

    29

    一种或许不太优雅的方法,我认为它只是其他人所说的一种变体,就是硬编码。许多期刊都有一些模板可以以某种方式允许表格脚注,因此我尽量保持基本。虽然已经有一些令人难以置信的软件包存在,我认为这个帖子很好地指出了这一点。

    \documentclass{article}
    \begin{document}
    \begin{table}[!th]
    \renewcommand{\arraystretch}{1.3} % adds row cushion
    \caption{Data, level$^a$, and sources$^b$}
    \vspace{4mm}
    \centering
    \begin{tabular}{|l|l|c|c|}
      \hline      
      \textbf{Data}  & \textbf{Description}   & \textbf{Level} & \textbf{Source} \\
      \hline      
      \hline
      Data1  &  Description. . . . . . . . . . . . . . . . . .   &  cnty & USGS \\
      \hline
      Data2  &  Description. . . . . . . . . . . . . . . . . .   &  MSA & USGS \\
      \hline
      Data3  &  Description. . . . . . . . . . . . . . . . . .   &  cnty & Census  \\
      \hline  
    \end{tabular}
    \end{table}
    \footnotesize{$^a$ The smallest spatial unit is county, $^b$ more details in appendix A}\\
    \end{document}
    

    上述代码的输出结果


    16
    如果你的表格已经使用了tabular并且想要更改为longtable,最简单的方法就是记得添加相应的代码。
    \usepackage{longtable}
    
    例如:
    \begin{longtable}{ll}
      2014--2015 & Something cool\footnote{first footnote} \\
      2016-- & Something cooler\footnote{second footnote}
    \end{longtable}
    

    2
    那对我没用。它仍然没有显示出来。除了添加那一行之外,还有其他我必须改变的吗? - Emanuel Berg
    2
    啊哈,表格的起始/结束命令也必须更改。明白了。 - Emanuel Berg
    2
    你能提供一个完整的例子吗?我无法让它工作。 - user2808117

    15

    enter image description here

    您可以在末尾添加一个\multirow。这是一个示例:
    \begin{table}[]
        \centering
        \caption{Caption}
        \label{tab:my_label}
        \begin{tabular}{l c c}  
        \toprule
    \multirow{2}{*}{Propriedades}                 & \multicolumn{2}{c}{Resultados do modelo} & Dados \\
                                                  & MN S    & MN F      &  experimentais \\ \midrule
    Resistência de entrada ($R_{in}$), M$\Omega$  & 2,2     & 0,9       & \\
    Constante de tempo ($\tau$), ms               & 10,3    & 5,6       & \\
    Reobase ($I_{rheo}$), nA                      & 4,5     & 17        & \\
    Duração da AHP, ms                            & 137,2   & 66,2      & \\ \bottomrule
    \multicolumn{4}{l}{\small *THIS IS A NICE FOOTNOTE.} \\
        \end{tabular}
    
    \end{table}
    

    9
    使用minipage环境。以下是一个示例:
    \begin{minipage}{6cm}
    \begin{tabular}{|l|c|c|}
        \hline
        A & 1 & 2 \footnote{This is a footnote.} \\
        \hline
        B & 2 & 1 \\
        \hline
        C & 3 & 3 \\
        \hline
    \end{tabular}
    \end{minipage}
    

    1
    在我的情况下,它会打印两次脚注,并且不是坐在页面底部,而是坐在页面中间的表格下面。 - kakyo
    我必须使用 {10cm} 的宽度才能正确格式化我的表格,但这非常有效!您甚至可以通过将整个示例包装在 \begin{center} ... \end{center} 中来保持表格和脚注居中。 - thehale

    4
    \begin{figure}[H]
    \centering
    {\includegraphics[width=1.0\textwidth]{image}}
    \caption{captiontext\protect\footnotemark}
    \label{fig:}
    \end{figure}
    \footnotetext{Footnotetext} 
    

    这是唯一对我有效的解决方案。您需要调整 footnotetext 标签的位置,因为它可能会出现在页面之前。 - Minions

    4

    最好的解决方案可能是查看threeparttable/threeparttablex包。


    1
    以下是关于如何使用threeparttable的一些信息。对我很有用!http://dound.com/2009/06/latex-adding-footnotes-in-tables-or-other-floats/ - Veridian
    链接已经失效,但可以通过网络档案馆访问:https://web.archive.org/web/20160104234240/http://dound.com/2009/06/latex-adding-footnotes-in-tables-or-other-floats/ - s_baldur

    1

    在表格中,我使用了 \footnotetext。


    1
    我曾经遇到过与tabularx脚注不显示在页面底部的同样问题。最后,我找到了以下结构,可以在PDF文件的同一页上正确显示表格的脚注计数器。
    \begin{table}
    \begin{tabularx}{\textwidth }{SCCC}
    \toprule
    \shortstack{A} & B & C & D\\
    \midrule
    item 1 \footnotemark{} & item 2\footnotemark{} & item 3 & item 4\\ \hline
    ...
     \bottomrule
    \end{tabularx}
    \end{table}
    \addtocounter{footnote}{-2} %n=2
    \stepcounter{footnote}\footnotetext{text foot 1}
    \stepcounter{footnote}\footnotetext{text foot 2}
    

    网页内容由stack overflow 提供, 点击上面的
    可以查看英文原文,
    原文链接