
Quiero tener más de una nota al pie en una tabla. Pero luego, el contador de notas al pie se ha incrementado demasiadas veces cuando llegué a la primera \footnotetext
. ¿Cuál es la mejor manera de hacer que esto funcione correctamente?
\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}
Respuesta1
Aumenta \footnotemark
el valor del footnote
contador, pero se desincronizará cuando \footnotetext
se utilice.
Hay que resetear el footnote
contador.despuésel tabular
medio ambiente al estadoantes. Esto se puede hacer manualmente, pero puede resultar tedioso si los valores cambian o se hace con un contador ficticio, que contiene el footnote
contador antes tabular
y luego se restaura al número original después tabular
(Hecho aquí con los comandos \AtBeginEnvironment
y \AfterEndEnvironment
del etoolbox
paquete.
Sin embargo, \footnotetext
no incrementa el footnote
. Utilice un pretocmd
enfoque -- o utilice una macro contenedora \myfootnotetext
que realice estos pasos automáticamente. (O hágalo 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}
Respuesta2
Si desea considerar el uso de un table
entorno, el tablefootnote
paquete resuelve su 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}