duas ou mais notas de rodapé em uma tabela

duas ou mais notas de rodapé em uma tabela

Minha pergunta é diferente da perguntaNota de rodapé em ambiente tabularporque já sei definir notas de rodapé em ambientes tabulares. Mas não sei como usar corretamente duas ou mais notas de rodapé que aparecem juntas em uma tabela. A outra questão não é lidar com esta questão especial.


Eu tenho este documento de látex:

\documentclass{scrbook}
\usepackage{scrlayer-scrpage}
\begin{document}
Text before the table\footnote{This is the 1st footnote}

\begin{tabular}{cl}
$k_B$ & Boltzmann constant\footnotemark $k_B = 1,380649 \cdot 10^{23} J/K$\\ 
$f$ & degrees of freedom\footnotemark \\ 
\end{tabular}
\footnotetext{named after Boltzmann}
\footnotetext{Another word for possibilities}

Text after the table\footnote{This is the last footnote}
\end{document}

Eu recebo este corpo, o que está ok:

Corpo com números corretos para notas de rodapé

São quatro pontos com notas de rodapé, cada um deles com seu número distinto, como deveria ser. Está tudo bem aqui.

Mas recebo estas notas de rodapé:

Notas de rodapé com um número errado

Como você pode ver, a segunda nota de rodapé (que é a primeira das duas dentro da tabela) tem um número errado. Os números devem ser 1-2-3-4, mas eles são 1-3-3-4.

Como posso obter os números corretos?


=== Reação a uma resposta ===

Fran postouuma respostamas sua solução é apenas uma solução alternativa fraca que não funciona corretamente em documentos maiores com dezenas de notas de rodapé.

Suponha que você esteja escrevendo um livro e a tabela com as duas notas de rodapé esteja na página 580. Você cria as notas de rodapé como na solução alternativa de Fran e, 3 meses depois, adiciona outro texto com outra nota de rodapé na página 215. Quero que todas as notas de rodapé estejam corretas mesmo depois de adicionar ou remover notas de rodapé anteriores.

Um exemplo:

\documentclass{scrbook}
\usepackage{scrlayer-scrpage}
\usepackage{lipsum}
\begin{document}
\chapter*{Issue with footnotes in tables}
\lipsum[1]

% ===========================================================
% Toggle the next line
% Subsequently added text with a new footnote \footnote{additional footnote}
% ===========================================================

\lipsum[66]

Old text with a footnote\footnote{an old footnote} before the table.

\section*{Table}

\begin{tabular}{cl}
$k_B$ & Boltzmann constant\footnotemark[2]\  $k_B = 1,380649 \cdot 10^{23} J/K$\\ 
$f$ & degrees of freedom\footnotemark[3] \\ 
\end{tabular}

\addtocounter{footnote}{2}
\footnotetext[2]{named after Boltzmann}
\footnotetext[3]{Another word for possibilities}

Text immediately after the table\footnote{immediately after the table}

\lipsum[75]

Text with a footnote\footnote{This is the last footnote}
\end{document}

Este código produz esta saída:

saída correta

Mas então adiciono um texto com outra nota de rodapé antes da tabela:

% ===========================================================
% Toggle the next line
Subsequently added text with a new footnote \footnote{additional footnote}
% ===========================================================

e eu entendo isso:

saída com erros

Agora, não apenas os números nas notas de rodapé no final da página estão errados, mas também os números da própria tabela.

Responder1

\documentclass{scrbook}
\usepackage{scrlayer-scrpage}
\begin{document}
Text before the table\footnote{This is the 1st footnote}

\begin{tabular}{cl}
$k_B$ & Boltzmann constant\footnotemark[2]\  $k_B = 1,380649 \cdot 10^{23} J/K$\\ 
$f$ & degrees of freedom\footnotemark[3] \\ 
\end{tabular}

\addtocounter{footnote}{2}
\footnotetext[2]{named after Boltzmann}
\footnotetext[3]{Another word for possibilities}

Text after the table\footnote{This is the last footnote}

\end{document}

Editar

Algum tipo de ajuste automático conforme solicitado é possível criando um novo ambiente para as notas da tabela quando (1) você não usa isso em floats, e (2) claro, o número de \tablefootnotemarks é o mesmo de \tablefootnotexts para cada tabela:

eu

\documentclass[a6paper,twocolumn]{scrbook}
\usepackage{scrlayer-scrpage}
\usepackage{lipsum,calc,booktabs,parskip}
\newcounter{tablefootnote}
\newcommand\tablefootnotemark{\footnotemark\addtocounter{tablefootnote}{1}} %
\newenvironment{foo}%
{\edef\ntnotes{\thetablefootnote}\setcounter{footnote}%
{\value{footnote}-\value{tablefootnote}}}%
{\edef\ntnotes{\thefootnote}\setcounter{tablefootnote}{0}}
\newcommand\tablefootnotext[1]{\addtocounter{footnote}{1}   \footnotetext{\texttt{[table]} #1}}

\begin{document}
\raggedright
Bla \footnote{footnote 1} bla \footnote{footnote 2} Bla, \footnote{footnote 3} before the table.

\begin{tabular}{cl}\toprule
$foo$ & bah\tablefootnotemark \\ 
$foo$ & bah\tablefootnotemark \\ 
$foo$ & bah\tablefootnotemark \\ 
$foo$ & bah\tablefootnotemark \\\bottomrule
\end{tabular}
\begin{foo}
\tablefootnotext{footnote 4}
\tablefootnotext{footnote 5}
\tablefootnotext{footnote 6}
\tablefootnotext{footnote 7}
\end{foo}

Bla \footnote{footnote 8} bla \footnote{footnote 9} Bla, \footnote{footnote 10} after the table.

\begin{tabular}{cl}\toprule
$foo$ & bah\tablefootnotemark \\ 
$foo$ & bah\tablefootnotemark \\ 
$foo$ & bah\tablefootnotemark \\\bottomrule
\end{tabular}
\begin{foo}
\tablefootnotext{footnote 11}
\tablefootnotext{footnote 12}
\tablefootnotext{footnote 13}
\end{foo}

Bla \footnote{footnote 14} bla \footnote{footnote 15} Bla, \footnote{footnote 16} after the second table.

\begin{tabular}{cl}\toprule
$foo$ & bah\tablefootnotemark \\ 
$foo$ & bah\tablefootnotemark \\\bottomrule
\end{tabular}
\begin{foo}
\tablefootnotext{footnote 17}
\tablefootnotext{footnote 18}
\end{foo}

Bla \footnote{footnote 19} bla \footnote{footnote 20} Bla, \footnote{footnote 21} after the third table.

\end{document}

Responder2

As notas de rodapé funcionam normalmente com arquivos longtable. VerNotas de rodapé em tabelas:

\documentclass{scrbook}
\usepackage{longtable}
\begin{document}
Text before the table\footnote{This is the 1st footnote}

\begin{longtable}{cl}
$k_B$ & Boltzmann constant\footnote{named after Boltzmann} $k_B = 1,380649 \cdot 10^{23} J/K$\\ 
$f$ & degrees of freedom\footnote{Another word for possibilities} \\ 
\end{longtable}

Text after the table\footnote{This is the last footnote}
\end{document}

Alternativamente, se você quiser manter o tabularambiente, adicione o footnotehyperpacote:

\documentclass{scrbook}
\usepackage{footnotehyper}
\begin{document}
Text before the table\footnote{This is the 1st footnote}

\begin{tabular}{cl}
$k_B$ & Boltzmann constant\footnote{named after Boltzmann} $k_B = 1,380649 \cdot 10^{23} J/K$\\ 
$f$ & degrees of freedom\footnote{Another word for possibilities} \\ 
\end{tabular}

Text after the table\footnote{This is the last footnote}
\end{document}

informação relacionada