diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index e5ed4d79b..f65bb170f 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -19,6 +19,9 @@ \RequirePackage{color} \RequirePackage{fancyvrb} \RequirePackage{threeparttable} +% Handle footnotes in tables. +\RequirePackage{footnote} +\makesavenoteenv{tabulary} % Redefine these colors to your liking in the preamble. \definecolor{TitleColor}{rgb}{0.126,0.263,0.361} diff --git a/sphinx/texinputs/tabulary.sty b/sphinx/texinputs/tabulary.sty index 2a96de971..ba83c0afb 100644 --- a/sphinx/texinputs/tabulary.sty +++ b/sphinx/texinputs/tabulary.sty @@ -109,6 +109,8 @@ Z \string\tymax: \the\tymax^^J}% \global\advance\TY@linewidth-#1\relax} \def\endtabulary{% \gdef\@halignto{}% + \let\TY@footnote\footnote% + \def\footnote{}% prevent footnotes from doing anything \expandafter\TY@tab\the\toks@ \crcr\omit {\xdef\TY@save@row{}% @@ -172,6 +174,7 @@ Z \message{> tymin}% \TY@checkmin \TY@count\z@ \let\TY@box\TY@box@v + \let\footnote\TY@footnote % restore footnotes {\expandafter\TY@final\the\toks@\endTY@final}% \count@\z@ \@tempswatrue