Як виправити LaTeX missing footnotes у tabular environment

Проблема:

Ви маєте LaTeX code з \footnote всередині \tabular на кшталт:

latex_tabular_footnote_example.tex
\documentclass{scrartcl}

\begin{document}
\begin{tabular}{p{2cm}|p{2cm}|}
\textbf{Column A\footnote{This is a footnote!}} & \textbf{Column B}\\
1 & 2\\
3 & 4\\
\end{tabular}
\end{document}

але LaTeX/PDFLaTeX не showing any з footnotes, що ви declared всередині \tabular environment.

Рішення

Use цей code just after вашого \documentclass declaration:

footnote_tabular_fix.tex
\usepackage{footnote}
\makesavenoteenv{tabular}

Потім recompile ваш LaTeX code. Footnotes всередині вашого tabular повинні тепер appear як expected.

Зверніть увагу, що якщо ви using other environments, ніж \begin{tabular}, вам може знадобитися add more \makesavenoteenv declarations для correct environments. tabularx environment з tabularx package works з footnotes out-of-the box без any additional packages!


Дивіться схожі статті за категоріями: LaTeX