Use Footnotes in LaTeX Tables
LaTeX hyperref
package1 provides the footnote
command to create a footnote, but the footnote can’t be displayed normally when we use it in the tables2. For example,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\documentclass{article}
\usepackage[margin=1in]{geometry}
\geometry{a4paper}
\usepackage[x11names]{xcolor}
\pagecolor{AntiqueWhite1}
\usepackage[colorlinks=true]{hyperref}
\begin{document}
\begin{table}
\centering
\caption[\TeX{} engine features]{This is the table caption.}
\vspace{0.5em}
\begin{tabular}{|l|l|}
\hline
Footnote & Footnote\footnote{This is footnote.}\\
\hline
Footnote & Footnote\footnote{This is footnote.}\\
\hline
Footnote & Footnote\footnote{This is footnote.}\\
\hline
Footnote & Footnote\footnote{This is footnote.}\\
\hline
Footnote & Footnote\footnote{This is footnote.}\\
\hline
\end{tabular}
\end{table}
\vspace{7em}
Footnote\footnote{This is FOOTNOTE.}.
\end{document}
this is because it is more commonly to use table notes rather than table footnotes3:
…using footnotes in tables is not considered to be typographic best practice: ideally, table notes should be used instead of table footnotes. The use of table notes or table footnotes may be defined by document class/style files you are required to use, or the choice may be yours: either way, LaTeX provides a range of solutions you can use.”
We can wrap tabular
in the minipage
environment to display table notes:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\documentclass{article}
\usepackage[margin=1in]{geometry}
\geometry{a4paper}
\usepackage[x11names]{xcolor}
\pagecolor{AntiqueWhite1}
\usepackage[colorlinks=true]{hyperref}
\usepackage{caption}
\begin{document}
\begin{minipage}[c]{\textwidth}
\centering
\captionof{table}{This is the table caption.}
\begin{tabular}{|l|l|}
\hline
Footnote & Footnote\footnote{This is footnote.}\\
\hline
Footnote & Footnote\footnote{This is footnote.}\\
\hline
Footnote & Footnote\footnote{This is footnote.}\\
\hline
Footnote & Footnote\footnote{This is footnote.}\\
\hline
Footnote & Footnote\footnote{This is footnote.}\\
\hline
\end{tabular}
\end{minipage}
\vspace{7em}
Footnote\footnote{This is FOOTNOTE.}.
\end{document}
and we can use \renewcommand{\thempfootnote}{\arabic{mpfootnote}}
in the preamble to change footnote markers to Arabic digits:
1
2
3
4
5
6
7
8
\documentclass{article}
% ...
\renewcommand{\thempfootnote}{\arabic{mpfootnote}}
\begin{document}
% ...
\end{document}
On the other hand, to realize the effect of “table footnotes”, reference3 also provides two methods: the first one is a manual approach:
… Normally, table footnotes within a minipage
are placed at the bottom of the minipage
, as the examples above have shown. The following example, from the LaTeX2e unofficial reference manual4 uses the \footnotemark
and \footnotetext
commands, together with a new counter (mpFootnoteValueSaver
) to ensure the table footnotes appear at the bottom of the document page, to be included as part of the document’s standard footnotes.
When the table is typeset, the LaTeX code \setcounter{mpFootnoteValueSaver}{\value{footnote}}
sets the value of mpFootnoteValueSaver
to be the current footnote
counter value; this ensures footnotes produced within the table use marker values that are synchronized with the main document footnote sequence (numbering). After the table is typeset, note how the mpFootnoteValueSaver
is incremented by 1
through the code \stepcounter{mpFootnoteValueSaver}
.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
\documentclass{article}
\usepackage[margin=1in]{geometry}
\geometry{a4paper}
\usepackage[x11names]{xcolor}
\pagecolor{AntiqueWhite1}
\usepackage[colorlinks=true]{hyperref}
\usepackage{caption}
\begin{document}
Footnote\footnote{This is FOOTNOTE.}.
\vspace{7em}
\newcounter{mpFootnoteValueSaver}
\begin{minipage}[c]{\textwidth}
\setcounter{mpFootnoteValueSaver}{\value{footnote}}
\centering
\captionof{table}{This is the table caption.}
\begin{tabular}{|l|l|}
\hline
Footnote & Footnote\footnotemark\\
\hline
Footnote & Footnote\footnotemark\\
\hline
Footnote & Footnote\footnotemark\\
\hline
Footnote & Footnote\footnotemark\\
\hline
Footnote & Footnote\footnotemark\\
\hline
\end{tabular}
\end{minipage}
\stepcounter{mpFootnoteValueSaver}%
\footnotetext[\value{mpFootnoteValueSaver}]{%
This is footnote.}%
\stepcounter{mpFootnoteValueSaver}%
\footnotetext[\value{mpFootnoteValueSaver}]{%
This is footnote.}
\stepcounter{mpFootnoteValueSaver}%
\footnotetext[\value{mpFootnoteValueSaver}]{%
This is footnote.}
\stepcounter{mpFootnoteValueSaver}%
\footnotetext[\value{mpFootnoteValueSaver}]{%
This is footnote.}
\stepcounter{mpFootnoteValueSaver}%
\footnotetext[\value{mpFootnoteValueSaver}]{%
This is footnote.}
\vspace{7em}
Footnote\footnote{This is FOOTNOTE.}.
\end{document}
and another one is by \tablefootnote
command of tablefootnote
package:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
\documentclass{article}
\usepackage[margin=1in]{geometry}
\geometry{a4paper}
\usepackage[x11names]{xcolor}
\pagecolor{AntiqueWhite1}
\usepackage[colorlinks=true]{hyperref}
\usepackage{tablefootnote}
\begin{document}
Footnote\footnote{This is FOOTNOTE.}.
\vspace{7em}
\begin{table}[h]
\centering
\caption[\TeX{} engine features]{This is the table caption.}
\vspace{0.5em}
\begin{tabular}{|l|l|}
\hline
Footnote & Footnote\tablefootnote{This is footnote.}\\
\hline
Footnote & Footnote\tablefootnote{This is footnote.}\\
\hline
Footnote & Footnote\tablefootnote{This is footnote.}\\
\hline
Footnote & Footnote\tablefootnote{This is footnote.}\\
\hline
Footnote & Footnote\tablefootnote{This is footnote.}\\
\hline
\end{tabular}
\end{table}
\vspace{7em}
Footnote\footnote{This is FOOTNOTE.}.
\end{document}
References