如何使脚注与 longtable 和 supertabular 配合使用?

如何使脚注与 longtable 和 supertabular 配合使用?

我想在表格中使用脚注。Heiko Oberdiek 建议了一些代码,但它仍然无法正常工作;我只得到了两个脚注中的一个和四个脚注标记中的两个

\documentclass[draft]{amsart}
\usepackage{longtable}
\usepackage{supertabular}

% Suggested by Heiko Oberdiek 
\makeatletter

\newcommand*{\mpfootnotemark}{%
  \@ifnextchar[\@xmpfootnotemark{%
    \stepcounter{mpfootnote}%
    \protected@xdef\@thefnmark{\thempfootnote}%
    \@footnotemark
  }%
}
\def\@xmpfootnotemark[#1]{%
  \begingroup
    \c@mpfootnote #1\relax
    \unrestored@protected@xdef\@thefnmark{\thempfootnote}%
  \endgroup
  \@footnotemark
}
\makeatother

\makeindex
 \begin{document}

\begin{longtable}[t]{| l | l | p{2.8in} |}
  \hline      
  \multicolumn{3}{|c|}{longtable}
  \\
  \hline
\endhead 
  \hline
  \multicolumn{3}{|c|}{example}
  \\
  \hline
\endfoot
long1 & long2 & long3
\footnote{Sample footnote for longtable}
\newcounter{fn:longtable}
\setcounter{fn:longtable} {\value{mpfootnote}}
\\
\hline
long4 & long5 & long6 
\mpfootnotemark[\value{fn:longtable}]
\\
\end{longtable}

\tablehead{%
  \hline   
  \multicolumn{3}{|c|}{supertabular}
  \\
  \hline}
\tabletail{%
  \hline
  \multicolumn{3}{|c|}{example}
  \\
  \hline}

\begin{supertabular}[t]{| l | l | p{2.8in} |}
long1 & long2 & long3
\footnote{Sample footnote for supertabular}
\newcounter{fn:supertabular}
\setcounter{fn:supertabular} {\value{mpfootnote}}
\\
\hline
long4 & long5 & long6 
\mpfootnotemark[\value{fn:supertabular}]
\\
\end{supertabular}

\printindex

\end{document}

相关内容