1

I'd like to add a footnote in an array, but the numbering is bad. Any idea what's wrong?

enter image description here

MWE

\documentclass[a4paper,12pt]{memoir}
% https://ctan.crest.fr/tex-archive/macros/latex/contrib/subfiles/subfiles.pdf
\usepackage{lmodern} % vector font
\usepackage[english]{babel}%
%% Input encoding
\usepackage[utf8]{inputenc}
%% Output encoding https://tex.stackexchange.com/a/677. Important to copy accents
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{lipsum} % For tests, use like \lipsum[1-5] to write 5 paragraphs
%%% ========== Usual packages ==========

\usepackage{amsmath} \usepackage{amssymb} \usepackage{ninecolors} \usepackage{tabularray} % Nice tabular (like booktabs, but with colors and more). Only in recent CTAN. \UseTblrLibrary{booktabs} \usepackage{hyperref}

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

\begin{table}[h] \centering \begin{tblr}{ colspec={c}, }%, \toprule Related Works\ \hline[.6pt,white] Blabla\protect\footnotemark{}\ \bottomrule \end{tblr} \caption{My caption} \label{tab:comparisonRelatedWorks} \end{table} \addtocounter{footnote}{-1} \footnotetext{Footnote in table.}

Blabla \footnote{Last note}

\end{document}

tobiasBora
  • 8,684
  • 2
    tblr evaluates the content many times to get the best layout so your counter is being increased. use optional argument to \footnotemark to force the number – David Carlisle Mar 13 '22 at 16:50

1 Answers1

2

Copunters issues is handled by Tblr Library counter:

\documentclass[a4paper,12pt]{memoir}
\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{}\ \bottomrule \end{tblr} \caption{My caption} \label{tab:comparisonRelatedWorks} \end{table} \footnotetext{Footnote in table.}

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

enter image description here

Zarko
  • 296,517