
Quero ter mais de uma nota de rodapé em uma tabela. Mas o contador de notas de rodapé aumentou muitas vezes quando cheguei ao primeiro arquivo \footnotetext
. Qual é a melhor maneira de fazer isso funcionar corretamente?
\documentclass{article}
\begin{document}
\ \vfill\
\begin{tabular}{|r|l|}
\hline
First & footnote.\footnotemark \\
Second & footnote.\footnotemark \\
Third & footnote.\footnotemark \\
\hline
\end{tabular}
\footnotetext{First} \footnotetext{Second} \footnotetext{Third}
Fourth footnote.\footnote{Four}
\
\end{document}
Responder1
Aumenta \footnotemark
o valor do footnote
contador, mas ficará fora de sincronia quando \footnotetext
for usado.
É preciso zerar o footnote
contadordepoiso tabular
meio ambiente para o estadoantes. Isso pode ser feito manualmente, mas pode se tornar tedioso se os valores mudarem ou se for feito com um contador fictício, que contém o footnote
contador antes tabular
e depois é restaurado para o número original tabular
(feito aqui com os comandos \AtBeginEnvironment
e \AfterEndEnvironment
do etoolbox
pacote.
No entanto, \footnotetext
não incrementa o footnote
. Use uma pretocmd
abordagem -- ou use uma macro wrapper \myfootnotetext
que faz essa etapa automaticamente. (Ou faça isso manualmente.)
\documentclass{article}
\newcommand{\myfootnotetext}[1]{%
\stepcounter{footnote}\footnotetext{#1}%
}
\newcounter{dummycounter}
\usepackage{etoolbox}
\AtBeginEnvironment{tabular}{%
\setcounter{dummycounter}{\value{footnote}}%
}
\AfterEndEnvironment{tabular}{%
\setcounter{footnote}{\value{dummycounter}}%
}
\begin{document}
\begin{tabular}{|r|l|}
\hline
First & footnote.\footnotemark \\
Second & footnote.\footnotemark \\
Third & footnote.\footnotemark \\
\hline
\end{tabular}
\myfootnotetext{First}
\myfootnotetext{Second} \myfootnotetext{Third}
Fourth footnote.\footnote{Four}
%\
\end{document}
Responder2
Se você quiser considerar o uso de um table
ambiente, o tablefootnote
pacote resolve seu problema:
\documentclass[colorlinks]{article}%
\usepackage{footnotebackref}
\usepackage{tablefootnote}
\begin{document}
\mbox{}\vfill
A first footnote\footnote{First}
\begin{table}[htbp]
\renewcommand\arraystretch{1.5}
\begin{tabular}{|r|l|}
\hline
First & footnote.\tablefootnote{Second} \\
Second & footnote.\tablefootnote{Third} \\
Third & footnote.\tablefootnote{Fourth} \\
\hline
\end{tabular}
\end{table}
Fifth footnote.\footnote{Fifth}
\end{document}