【Latex】如何在表格中使用footnote

文章介绍了在LaTeX的table环境中,由于tablecell不支持footnote,导致使用脚注时会出现问题。作者提供了一种解决方案,即通过结合footnotemark和footnotetext来模拟脚注效果,并给出了示例代码,包括单个脚注和多个脚注的处理方法。此外,提到尝试过tablefootnote等第三方包但未成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Latex table cell中是不支持\footnote的。

如果你在table中用\footnote,那么要么这个脚注根本不显示出来,要么就会出现计数出错等问题。总之非常麻烦。

解决策略

笔者在搜集大量资料后,也并没有找到一种“完美的”解决方案。我们只能用一些很简单的方法“模拟出”\footnote的效果。

以使用tabularray为例,我们能做的,也只有自己加\footnotemark\footnotetext

下面是只加一个footnote,比较简单:

\usepackage{xcolor}
\usepackage[vmargin=99mm]{geometry}

\usepackage{tabularray}
\UseTblrLibrary{amsmath, booktabs, counter}
\usepackage{hyperref}

\begin{document}
Blabla \footnote{First note}
Blabla \footnote{Second note}


\begin{table}[ht]
  \centering
  \begin{tblr}{
      colspec={c},
    }%,
    \toprule
    Related Works\\
    \hline[.6pt,white]
    Blabla\footnotemark{}\\ % 自己加上\footnotemark
    \bottomrule
  \end{tblr}
  \caption{My caption}
  \label{tab:comparisonRelatedWorks}
\end{table}
\footnotetext{Footnote in table.} % 在table环境之外,补上内容

Blabla \footnote{Last note}
\end{document}

如果想要在同一个table里,用多个footnote,还得自己计数

\documentclass{scrartcl}
\begin{document}    
before

\begin{tabular}{l}
Content\footnotemark\\
Content continued\footnotemark\\
Content continued further\footnotemark
\end{tabular}
\addtocounter{footnote}{-2} % 需要自己计数,-x需要根据自己的上下文确定
\footnotetext[1]{Footnote} % 也可以在\footnotetext中自己传入参数(如左,1),指定序号,但是不推荐
\addtocounter{footnote}{1} % 自己计数+1
\footnotetext{Second footnote}
\addtocounter{footnote}{1}
\footnotetext{Third footnote}

after
\end{document}

笔者也尝试过其他第三方package,例如tablefootnote;和其他table环境,例如threeparttabletalltblr;均以失败告终。所以这里也就不建议了。

参考:

### 如何在LaTeX IEEEtran文档类的表格中插入脚注 为了在`IEEEtran`文档类中的表格内添加脚注,可以使用`\footnotemark[]` 和 `\footnotetext[]`命令来实现。下面是一个具体的例子展示如何操作: ```tex \documentclass[journal]{IEEEtran} \usepackage{tabularx} \begin{document} \title{Sample Document for Footnotes in Tables with IEEEtran Class} \maketitle \section*{Introduction} This document demonstrates how to add footnotes within tables using the IEEEtran class. \begin{table}[!htb] \centering \caption{Example Table With Footnote}\label{tab:example_table_footnote} \renewcommand{\arraystretch}{1.3}% Adjust row height slightly. \begin{tabular}{|c|c|} \hline Column 1 & Column 2 \\ \hline Item A & Value B\footnotemark \\ \hline Item C & Value D \\ \hline \end{tabular} \footnotetext[1]{Footnote text associated with 'Value B'. This is an example of adding a footnote inside a table when using the IEEEtran document class.} \end{table} \end{document} ``` 上述代码展示了在一个简单的两列表里给特定单元格加脚注的方式[^1]。 在这个实例中,通过定义一个新的表格环境并利用`\footnotemark`放置标记,在紧接其后的`\footnotetext`指令中给出实际的文字解释部分。注意这里使用了可选参数 `[1]` 来确保编号的一致性和唯一性。如果在同一张表中有多个地方需要用到脚注,则应依次增加该数值以区分不同条目之间的关系[^2]。 此外,还可以调整表格内部行间距大小以便更好地适应带有下划线或其他特殊字符的情况下的视觉效果。此案例采用的是 `journal` 类型的文章布局模式;如果是其他类型的出版物(比如会议论文),只需要更改首行声明处对应的选项即可[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值