[Latex] How to use footnote in the table

It is not supported in Latex table cells \footnote.

If you use it in the table \footnote, then either the footnote is not displayed at all, or there will be problems such as counting errors. In short very troublesome.

solution strategy

After collecting a lot of information, the author did not find a "perfect" solution. We can only " simulate " the effect in some very simple ways \footnote.

Taking usage tabularrayas an example, all we can do is add \footnotemarkup by ourselves \footnotetext.

The following is just adding a footnote, which is relatively simple:

\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}

If you want to use multiple footnotes in the same table, you have to count them yourself .

\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}

The author also tried other third-party packages, such as tablefootnote; and other table environments, such as threeparttable, talltblr; all ended in failure. So it is not recommended here.

reference:

Guess you like

Origin blog.csdn.net/weixin_43301333/article/details/130456310