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

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;均以失败告终。所以这里也就不建议了。

参考:

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值