0

I want to use footnotes from within a table. Heiko Oberdiek suggested some code, but it's still not working right; I'm getting only one out of two footnotes and two out of four footnote marks

\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}
  • You coud try \protect\footnotemark(should be placed instead of \footnote) and \footnotetext{Yout text. Sample footnote for supertabular}(should be placed outside the table/\end{supertabular}. – Bobyandbob Nov 20 '17 at 21:22
  • I thought longtable supported foornotes, although it has a problem with the last page (see tex.stackexchange.com/questions/359903/…) – John Kormylo Nov 20 '17 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.