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

参考:

猜你喜欢

转载自blog.csdn.net/weixin_43301333/article/details/130456310