> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/latex/zh-cn/ge-shi-hua/14-footnotes.md).

# 脚注

## LaTeX 主要脚注命令简介

据维基百科介绍，脚注是由一位名叫 [理查德·朱格](https://en.wikipedia.org/wiki/Note_\(typography\)#History) （约1514–1577）。这一历史悠久的文学手法得到了 LaTeX 的支持，在这篇帮助文章中，我们将解释主要的脚注相关命令，并提供一系列示例来演示其用法。

### \footnote 命令

该 `\footnote` 命令是用于创建脚注的核心 LaTeX 命令，并有两种形式：

* `\footnote{*text for footnote*}`：这会插入一个（自动生成的）上标数字，称为脚注 *标记*，到文档正文中，并在页面底部创建相应的脚注，其中包含对应的脚注 *标记* 和 `*text for footnote*`.
* `\footnote[*number*]{*text for footnote*}`：此形式的命令使用可选值 `*number*` 来创建上标脚注 *标记*；它还会在页面底部插入相应的脚注，其中包含用于识别的脚注标记（`*number*`）以及 `*text for footnote*`.

#### 示例：使用 \footnote 命令

下面是一个示例，演示了 \footnote 的两种变体 `\footnote`:

* `\footnote{Automatically generated footnote markers work fine!}` 会自动排版脚注标记的数字（上标）值（1），而
* `\footnote[42]{...is that the answer to everything?}` 将 42 用作脚注标记的值，而且如你所见，它不会递增用于自动创建标记的整数：第三个脚注的标记值是 2。

```latex
我写这段话是为了演示自动生成的脚注标记\footnote{自动生成的脚注标记工作正常！}，以及使用命令提供的标记值的脚注\footnote[42]{……这就是万物的答案吗？}。

现在，我将使用另一个自动生成的脚注标记\footnote{现在，脚注标记依次是 1、42，但随后又回到 2？如果自动生成的数字也到了 42，那就会很混乱！}。
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Demonstrating+the+footnote+command\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cbegin%7Bdocument%7D%0AI%27m+writing+to+demonstrate+use+of+automatically-generated+footnote+markers%5Cfootnote%7BAutomatically+generated+footnote+markers+work+fine%21%7D+and+footnotes+which+use+a+marker+value+provided+to+the+command%5Cfootnote%5B42%5D%7B...is+that+the+answer+to+everything%3F%7D.+%0A%0ANow%2C+I+will+use+another+automatically-generated+footnote+marker%5Cfootnote%7BNow%2C+footnote+markers+are+1%2C+42%2C+but+then+back+to+2%3F+That+will+be+confusing+if+the+automatically-generated+number+also+reaches+42%21%7D.%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![脚注基本示例](/files/5f649042c31570782bb9fdb96d0846883de5f944)

### 保存当前脚注标记值：LaTeX 计数器

LaTeX 使用所谓的 [*计数器变量*](/latex/zh-cn/ge-shi-hua/10-counters.md) 来保存脚注标记的当前值。实际上，LaTeX 会根据脚注的使用位置提供并使用两个计数器变量：

* `footnote`：用于主文档正文中脚注的计数器变量
* `mpfootnote`：用于一个环境中的脚注计数器变量 `minipage` 环境

每当 `\footnote{*text*}` 使用该命令的该版本时，相应的计数器变量会加 1。对于 `\footnote[*number*]{*text*}` 版本，相应的计数器变量会 *不* 递增。

你可以创建额外的计数器变量并将其用于生成脚注，如下面的 [下方示例](#example-from-latex2e-unofficial-reference-manual).

### \footnotemark 和 \footnotetext 命令

除了 `\footnote`之外，LaTeX 还提供以下命令：

* `\footnotemark` 它用于排版脚注标记，和
* `\footnotetext` 它用于排版脚注文本

这两个命令都接受一个 *可选的* 用方括号括起来的参数（`[...]`):

* `\footnotemark[*number*]`：在使用该命令的位置排版一个脚注标记，但不会在页面底部创建/排版相应的脚注。
  * `[*number*]` 是 *可选的* 参数，指定该值 `*number*` 应作为脚注标记使用。
  * 如果你使用此命令 *没有* 该可选参数，并将其写作 `\footnotemark`，那么此形式的命令会使用一个名为 [计数器变量](/latex/zh-cn/ge-shi-hua/10-counters.md)的内部 LaTeX 变量来生成脚注标记——当可选 `*number*` 值 *不* 被提供时，该变量会加 1。
* `\footnotetext[*number*]{*text for footnote*}`：用于排版脚注文本（`*text for footnote*`），对应于前一个命令生成的标记 `\footnotemark`.
  * `[*number*]` 是 *可选的* 参数，它为以下内容指定相应的脚注标记： `*text for footnote*`.
  * 如果你使用此命令 *没有* 该可选 `*number*` 参数，即将其写作 `\footnotetext{*text for footnote*}`，此形式的命令会生成一个脚注，其标记对应于最近一次 `\footnotemark`.

#### 示例：使用 \footnotemark 和 \footnotetext

该 `\footnotemark` 和 `\footnotetext` 命令通常一起使用，用于在表格或其他位置构造脚注，而在这些位置，标准的 `\footnote` 命令不起作用，或者不是最佳/最优解决方案——本文展示了一些应用（参见 [此处](#example-from-latex2e-unofficial-reference-manual) 和 [此处](#footnotes-with-multiple-references)).

```latex
我写这段话是为了测试 \verb|\footnotemark| 和 \verb|\footnotetext| 命令。
你可以使用 \verb|\footnotemark|\footnotemark{} 插入脚注标记
命令，然后稍后使用 \verb|\footnotetext| 命令来排版脚注
文本，即编写 \verb|\footnotetext{Here's the footnote.}|。\footnotetext{这里是脚注。}

我们再来一个，看看结果\footnotemark{}，我会在以下内容中对此作评论：
脚注\footnotetext{具体来说，我会在这一条中写评论。}。
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=footnotemark+and+footnotetext+demo\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cbegin%7Bdocument%7D%0AI%27m+writing+to+test+the+%5Cverb%7C%5Cfootnotemark%7C+and+%5Cverb%7C%5Cfootnotetext%7C+commands.+%0AYou+can+insert+a+footnote+marker+using+the+%5Cverb%7C%5Cfootnotemark%7C%5Cfootnotemark%7B%7D%0Acommand+and+later%2C+when+you%27re+ready%2C+typeset+the+footnote+text+by+writing+%0A%5Cverb%7C%5Cfootnotetext%7BHere%27s+the+footnote.%7D%7C.+%5Cfootnotetext%7BHere%27s+the+footnote.%7D%0A%0ALet%27s+do+one+more+to+see+the+result%5Cfootnotemark%7B%7D+which+I%27ll+comment+on+within+the%0Afootnote%5Cfootnotetext%7BSpecifically%2C+I%27d+write+comments+in+this+one.%7D.%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![在 Overleaf 中使用脚注](/files/060d99ca0cd83c348bc2d4a143718028892c9352)

### 其他 LaTeX 脚注命令

除了我们已经探讨的命令外：

* `\footnote[*number*]{*text for footnote*}`
* `\footnotemark[*number*]`
* `\footnotetext[*number*]{*text for footnote*}`

LaTeX 还提供了一些额外的脚注相关命令，我们只列出它们而不作详细探讨。以下说明摘自 LaTeX2e 源代码文档：

* `\footnotesize`：用于脚注的字号调整命令。
* `\footins`：正文与脚注之间的空间。分隔脚注与正文的横线就在这段空间中。此空间位于高度为以下值的支撑线条之上： `\footnotesep` 它位于第一个脚注的开头。
* `\footnoterule`：用于绘制分隔脚注与正文的横线的宏。它会在以下命令之后立即执行： `\vspace` 的记号值 `\skip\footins`。它应占用零垂直空间——也就是说，它应使用一个负的间距来抵消它所占用的任何正空间。
* `\footnotesep`：放置在每个脚注开头的支撑线条的高度。

## 脚注的示例与应用

### 带有多个引用的脚注

下面的示例演示了一种对同一脚注进行多次引用的方法。通过使用 `\footnotemark[\value{footnote}]` 你可以插入一个对应于 *当前* 值的上标 `footnote` [计数器](/latex/zh-cn/ge-shi-hua/10-counters.md) ，但不会递增 `footnote` 计数器值（有关计数器的更多信息，请参见 [这篇 Overleaf 帮助文章](/latex/zh-cn/ge-shi-hua/10-counters.md)).

```latex
我写这段话是为了测试\footnote{脚注工作正常！}几个脚注功能。
你可以使用 \verb|\footnotemark|\footnotemark{} 插入脚注标记
命令，然后稍后使用 \verb|\footnotetext| 命令来排版脚注
文本，即编写 \verb|\footnotetext{Text of second footnote.}|
\footnotetext{第二个脚注的文本。}。

我可以不止一次使用同一个脚注\footnotemark{}
。\footnotemark[\value{footnote}]。

\footnotetext{一个带有两个引用的脚注。}
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Two+references+to+footnotes\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cbegin%7Bdocument%7D%0AI%27m+writing+to+test%5Cfootnote%7BFootnotes+work+fine%21%7D+several+footnote+features.+%0AYou+can+insert+the+footnote+marker%5Cfootnotemark%7B%7D+using+the+%5Cverb%7C%5Cfootnotemark%7C%0Acommand+and+later+use+the+%5Cverb%7C%5Cfootnotetext%7C+command+to+typeset+the+footnote%0Atext+by+writing+%5Cverb%7C%5Cfootnotetext%7BText+of+second+footnote.%7D%7C%0A%5Cfootnotetext%7BText+of+second+footnote.%7D.%0A%0AI+can+use+the+same+footnote%5Cfootnotemark%7B%7D+more+than+%0Aonce%5Cfootnotemark%5B%5Cvalue%7Bfootnote%7D%5D.%0A%0A%5Cfootnotetext%7BA+footnote+with+two+references.%7D%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![使用多个脚注引用](/files/d27196f6ee87e0798c3ca2a9a49eb10d06e3660a)

### 更改编号样式

脚注编号的当前值存储在一个名为以下项的 LaTeX 变量中： `footnote` [*计数器*](/latex/zh-cn/ge-shi-hua/10-counters.md) 并且可以通过命令进行排版 `\thefootnote`。你可以通过修改以下命令来更改脚注标记的排版格式： `\thefootnote` 命令；例如， `\renewcommand{\thefootnote}{\roman{footnote}}` 会将标记排版为小写罗马数字。你可以使用 `\renewcommand{\thefootnote}{...}` 在导言区更改主文档正文中脚注的编号样式。

其他可能的标记样式包括：

* `\arabic{*counter variable*}`：排版为 `*counter variable*` 阿拉伯数字。
* `\Roman{*counter variable*}`：排版为 `*counter variable*` 大写罗马数字。
* `\alph{*counter variable*}`：排版为 `*counter variable*` 小写字母。
* `\Alph{*counter variable*}`：排版为 `*counter variable*` 大写字母。
* `\fnsymbol{*counter variable*}`：排版为 `*counter variable*` 使用一组 [9 个特殊符号](/latex/zh-cn/ge-shi-hua/10-counters.md#accessing-and-printing-counter-values).

有关创建、使用和修改计数器的背景信息，请参见 [这篇关于计数器的 Overleaf 文章](/latex/zh-cn/ge-shi-hua/10-counters.md#accessing-and-printing-counter-values).

下面是一个使用……的示例 `\renewcommand{\thefootnote}{\roman{footnote}}`:

```latex
我写这段话是为了测试\footnote{脚注工作正常！}几个脚注功能。
你可以使用 \verb|\footnotemark|\footnotemark{} 插入脚注标记
命令，然后稍后使用 \verb|\footnotetext| 命令来排版脚注
文本，即编写 \verb|\footnotetext{Text of second footnote.}|
\footnotetext{第二个脚注的文本。}。

我可以不止一次使用同一个脚注\footnotemark{}
。\footnotemark[\value{footnote}]。

\footnotetext{一个带有两个引用的脚注。}

\renewcommand{\thefootnote}{\roman{footnote}}
现在是一个使用小写罗马数字的脚注标记\footnote{这个脚注标记使用小写罗马数字。}。
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Changing+footnote+numbering+style\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cbegin%7Bdocument%7D%0AI%27m+writing+to+test%5Cfootnote%7BFootnotes+work+fine%21%7D+several+footnote+features.+%0AYou+can+insert+the+footnote+marker%5Cfootnotemark%7B%7D+using+the+%5Cverb%7C%5Cfootnotemark%7C%0Acommand+and+later+use+the+%5Cverb%7C%5Cfootnotetext%7C+command+to+typeset+the+footnote%0Atext+by+writing+%5Cverb%7C%5Cfootnotetext%7BText+of+second+footnote.%7D%7C%0A%5Cfootnotetext%7BText+of+second+footnote.%7D.%0A%0AI+can+use+the+same+footnote%5Cfootnotemark%7B%7D+more+than+%0Aonce%5Cfootnotemark%5B%5Cvalue%7Bfootnote%7D%5D.%0A%0A%5Cfootnotetext%7BA+footnote+with+two+references.%7D%0A%0A%5Crenewcommand%7B%5Cthefootnote%7D%7B%5Croman%7Bfootnote%7D%7D%0ANow+a+footnote+marker+using+lowercase+Roman+numerals%5Cfootnote%7BThis+footnote+marker+uses+lowercase+Roman+numerals.%7D.%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![更改脚注编号样式](/files/4ca198d774be8b5f6bb3075ff1c858d0a9fb94ec)

### minipage 环境中的脚注

在一个 `minipage` 环境中的脚注表现不同，因为这些命令 `\footnote` 和 `\footnotetext` 会被临时重新定义，使脚注：

* 放置在 `minipage`的底部，而不是主文档页面
* 使用不同于正文脚注的方案进行标记/编号——在一个 `minipage` 脚注使用一个名为 `mpfootnote`

下面是一个在一个 `minipage`:

```latex
这是一段正文的开头，就在我们切换到 \texttt{minipage} 环境之前。这是一个页内脚注\footnote{minipage 之前的脚注}。

\vspace{10pt}
\begin{minipage}{0.7\textwidth}
这是 \texttt{minipage} 环境中的文本。这里是第一个 \texttt{minipage} 脚注\footnote{第一个 minipage 脚注。}。还有另一个 \texttt{minipage} 脚注\footnote{第二个 minipage 脚注。}。
\end{minipage}
\vspace{10pt}

这是我们刚结束一个 \texttt{minipage} 环境后，标准正文段落的开头。这是一个页内脚注\footnote{minipage 之后的脚注}。
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Footnotes+in+a+minipage\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cbegin%7Bdocument%7D%0AThis+is+the+start+of+a+paragraph+of+text+just+before+we+switch+to+a+%5Ctexttt%7Bminipage%7D+environment.+This+is+an+in-page+footnote%5Cfootnote%7BFootnote+before+a+minipage%7D.%0A%0A%5Cvspace%7B10pt%7D%0A%5Cbegin%7Bminipage%7D%7B0.7%5Ctextwidth%7D%0AThis+is+text+in+a+%5Ctexttt%7Bminipage%7D+environment.+Here+is+the+first+%5Ctexttt%7Bminipage%7D+footnote%5Cfootnote%7BFirst+minipage+footnote.%7D.+And+another+%5Ctexttt%7Bminipage%7D+footnote%5Cfootnote%7BSecond+minipage+footnote.%7D.%0A%5Cend%7Bminipage%7D%0A%5Cvspace%7B10pt%7D%0A%0AThis+is+the+start+of+a+standard+paragraph+of+text+just+after+we+finished+a+%5Ctexttt%7Bminipage%7D+environment.+This+is+an+in-page+footnote%5Cfootnote%7BFootnote+after+a+minipage%7D.%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![在 minipage 中使用脚注](/files/0b3927d7dbced4f30b6ceec14dd98c2010d34e7e)

### 更改 minipage 脚注标记

如上面的示例所示，在一个 `minipage` 中，脚注标记是小写字母；然而， `\renewcommand` 可用于重新定义 `mpfootnote` 计数器值的排版方式。例如，要将 `minipage` 脚注标记排版为阿拉伯数字：

```latex
\renewcommand{\thempfootnote}{\arabic{mpfootnote}}
```

如下例所示：

```latex
\renewcommand{\thempfootnote}{\arabic{mpfootnote}}
\begin{minipage}{0.7\textwidth}
这是 \texttt{minipage} 环境中的文本。这里是第一个 \texttt{minipage} 脚注\footnote{第一个 minipage 脚注。}。还有另一个 \texttt{minipage} 脚注\footnote{第二个 minipage 脚注。}。
\end{minipage}
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Changing+minipage+footnote+marker\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cbegin%7Bdocument%7D%0A%5Crenewcommand%7B%5Cthempfootnote%7D%7B%5Carabic%7Bmpfootnote%7D%7D%0A%5Cbegin%7Bminipage%7D%7B0.7%5Ctextwidth%7D%0AThis+is+text+in+a+%5Ctexttt%7Bminipage%7D+environment.+Here+is+the+first+%5Ctexttt%7Bminipage%7D+footnote%5Cfootnote%7BFirst+minipage+footnote.%7D.+And+another+%5Ctexttt%7Bminipage%7D+footnote%5Cfootnote%7BSecond+minipage+footnote.%7D.%0A%5Cend%7Bminipage%7D%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![更改 minipage 脚注标记](/files/2342cc43d9736b44fe14f7ae08877232af21f96e)

## 表格中的脚注

以下各节将探讨与在表格中使用脚注相关的若干主题。

### 你应该在表格中使用脚注吗？

该 [TeX 常见问题列表](https://texfaq.org/) 中有一条关于 [表格中的脚注](https://texfaq.org/FAQ-footintab) 其中指出，在表格中使用脚注并不被视为排版最佳实践：理想情况下， *表注* 应使用，而不是 *表格脚注*。表注或表格脚注的使用方式可能由你必须使用的文档类/样式文件定义，或者由你自行选择：无论哪种情况，LaTeX 都提供了一系列可供使用的解决方案。

### 示例：\footnote 在 tabular 环境中不起作用

该 `\footnote` 命令在 tabular 环境中不起作用，如下面的示例所示。请注意，此示例使用了 `hologo` LaTeX 宏包来排版各种 TeX 引擎的名称。

```latex
\begin{table}
  \centering
    \begin{tabular}{lcc}
     \midrule
     \TeX{} engine & Native UTF-8 support & Unicode math support\\
     \midrule
       \hologo{pdfTeX} & 否\footnote{通过 \LaTeX{} 内核命令提供的一些 UTF-8 支持。} & 否\\
       \Hologo{XeTeX} & Yes & Yes\\
       \Hologo{LuaTeX} & Yes & Yes\\
       \midrule
     \end{tabular}
    \caption[\TeX{} 引擎功能]{%
      \TeX{} 引擎功能比较\footnote{草稿版本。将添加更多功能比较。}.}
\end{table}
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+of+table+footnotes+not+working\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cusepackage%7Bhologo%7D+%25+for+TeX+engine+logos%0A%5Cusepackage%7Bbooktabs%7D+%25+for+nice+tables%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Btable%7D%0A++%5Ccentering%0A++++%5Cbegin%7Btabular%7D%7Blcc%7D%0A+++++%5Cmidrule+%0A+++++%5CTeX%7B%7D+engine+%26+Native+UTF-8+support+%26+Unicode+math+support%5C%5C%0A+++++%5Cmidrule%0A+++++++%5Chologo%7BpdfTeX%7D+%26+No%5Cfootnote%7BSome+UTF-8+support+via+%5CLaTeX%7B%7D+kernel+commands.%7D+%26+No%5C%5C%0A+++++++%5CHologo%7BXeTeX%7D+%26+Yes+%26+Yes%5C%5C%0A+++++++%5CHologo%7BLuaTeX%7D+%26+Yes+%26+Yes%5C%5C%0A+++++++%5Cmidrule+%0A+++++%5Cend%7Btabular%7D%0A++++%5Ccaption%5B%5CTeX%7B%7D+engine+features%5D%7B%25%0A++++++%5CTeX%7B%7D+engine+feature+comparison%5Cfootnote%7BDraft+version.+Additional+feature+comparisons+will+be+added.%7D.%7D%0A%5Cend%7Btable%7D%0A%5Cend%7Bdocument%7D)

该示例生成如下输出，显示表格单元格和标题中存在脚注标记，但没有对应的脚注文本：

![tabular 环境中缺少脚注文本](/files/6e6e6bddd089f36e6cc20399be6148a147af6d6b)

一种部分解决方案是将 `tabular` 放入一个 `minipage` 环境：

```latex
\begin{minipage}{\textwidth}
  \centering
    \begin{tabular}{lcc}
     \midrule
     \TeX{} engine & Native UTF-8 support & Unicode math support\\
     \midrule
       \hologo{pdfTeX} & 否\footnote{通过 \LaTeX{} 内核命令提供的一些 UTF-8 支持。} & 否\\
       \Hologo{XeTeX} & Yes & Yes\\
       \Hologo{LuaTeX} & Yes & Yes\\
       \midrule
     \end{tabular}
\end{minipage}
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+of+tabular+in+a+minipage\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cusepackage%7Bhologo%7D+%25+for+TeX+engine+logos%0A%5Cusepackage%7Bbooktabs%7D+%25+for+nice+tables%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Bminipage%7D%7B%5Ctextwidth%7D%0A++%5Ccentering%0A++++%5Cbegin%7Btabular%7D%7Blcc%7D%0A+++++%5Cmidrule+%0A+++++%5CTeX%7B%7D+engine+%26+Native+UTF-8+support+%26+Unicode+math+support%5C%5C%0A+++++%5Cmidrule%0A+++++++%5Chologo%7BpdfTeX%7D+%26+No%5Cfootnote%7BSome+UTF-8+support+via+%5CLaTeX%7B%7D+kernel+commands.%7D+%26+No%5C%5C%0A+++++++%5CHologo%7BXeTeX%7D+%26+Yes+%26+Yes%5C%5C%0A+++++++%5CHologo%7BLuaTeX%7D+%26+Yes+%26+Yes%5C%5C%0A+++++++%5Cmidrule+%0A+++++%5Cend%7Btabular%7D%0A%5Cend%7Bminipage%7D%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![将 LaTeX tabular 放入 minipage 中以修复脚注](/files/f2f95c06f8b2430fca86ff612d01f8a84a9bec39)

请注意，你还可以写 `\renewcommand{\thempfootnote}{\arabic{mpfootnote}}` ，以便让 `minipage` 表格脚注标记排版为阿拉伯数字，而不是小写字母。

### 来自 LaTeX2e 非官方参考手册的示例

该 [LaTeX2e 非官方参考手册](https://latexref.xyz/index.html) 在以下章节中有一个有趣的示例： [表格中的脚注](https://latexref.xyz/Footnotes-in-a-table.html)。通常，在一个 `minipage` 中的表格脚注会放在 `minipage`的底部，正如上面的示例所示。下面这个示例来自 [LaTeX2e 非官方参考手册](https://latexref.xyz/Footnotes-in-a-table.html) 使用 `\footnotemark` 和 `\footnotetext` 命令，再加上一个新的计数器（`mpFootnoteValueSaver`），以确保表格脚注出现在文档页面底部，并作为文档标准脚注的一部分。

在排版表格时，LaTeX 代码 `\setcounter{mpFootnoteValueSaver}{\value{footnote}}` 将以下项的值设为 `mpFootnoteValueSaver` 当前的 `footnote` 计数器值；这确保在表格中生成的脚注使用与主文档脚注序列（编号）同步的标记值。在表格排版完成后，请注意 `mpFootnoteValueSaver` 通过以下代码加 1： `\stepcounter{mpFootnoteValueSaver}`.

```latex
\newcounter{mpFootnoteValueSaver}
\begin{center}
  \begin{minipage}{\textwidth}
    \setcounter{mpFootnoteValueSaver}{\value{footnote}} \centering
     \begin{tabular}{l|l}
       \textsc{Woman}             &\textsc{Relationship} \\ \hline
       Mona                       &有伴侣\footnotemark  \\
       Diana Villiers             &最终妻子  \\
       Christine Hatherleigh Wood &未婚妻\footnotemark
     \end{tabular}
  \end{minipage}%  percent sign keeps footnote text close to minipage
  \stepcounter{mpFootnoteValueSaver}%
    \footnotetext[\value{mpFootnoteValueSaver}]{%
      除她的死亡外，所知甚少。}%
  \stepcounter{mpFootnoteValueSaver}%
    \footnotetext[\value{mpFootnoteValueSaver}]{%
      在 XXI 中，关系未定。}
\end{center}
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+of+custom+table+footnotes\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cusepackage%7Bhologo%7D+%25+for+TeX+engine+logos%0A%5Cusepackage%7Bbooktabs%7D+%25+for+nice+tables%0A%5Cbegin%7Bdocument%7D%0A%5Cnewcounter%7BmpFootnoteValueSaver%7D%0A%5Cbegin%7Bcenter%7D%0A++%5Cbegin%7Bminipage%7D%7B%5Ctextwidth%7D%0A++++%5Csetcounter%7BmpFootnoteValueSaver%7D%7B%5Cvalue%7Bfootnote%7D%7D+%5Ccentering%0A+++++%5Cbegin%7Btabular%7D%7Bl%7Cl%7D%0A+++++++%5Ctextsc%7BWoman%7D+++++++++++++%26%5Ctextsc%7BRelationship%7D+%5C%5C+%5Chline+%0A+++++++Mona+++++++++++++++++++++++%26Attached%5Cfootnotemark++%5C%5C+%0A+++++++Diana+Villiers+++++++++++++%26Eventual+wife++%5C%5C++%0A+++++++Christine+Hatherleigh+Wood+%26Fiance%5Cfootnotemark+%0A+++++%5Cend%7Btabular%7D%0A++%5Cend%7Bminipage%7D%25++percent+sign+keeps+footnote+text+close+to+minipage%0A++%5Cstepcounter%7BmpFootnoteValueSaver%7D%25%0A++++%5Cfootnotetext%5B%5Cvalue%7BmpFootnoteValueSaver%7D%5D%7B%25%0A++++++Little+is+known+other+than+her+death.%7D%25%0A++%5Cstepcounter%7BmpFootnoteValueSaver%7D%25%0A++++%5Cfootnotetext%5B%5Cvalue%7BmpFootnoteValueSaver%7D%5D%7B%25%0A++++++Relationship+is+unresolved+in+XXI.%7D%0A%5Cend%7Bcenter%7D%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![在 LaTeX 中创建表格脚注](/files/c2891f3cb13ede33b45ed4f14924252bc27cd205)

### 示例：通过 tablefootnote 宏包实现表格脚注

一种选择是使用 [`tablefootnote` 宏包](https://ctan.org/pkg/tablefootnote?lang=en) ，该文档是 [该方案在 tex.stackexchange 上提到过](https://tex.stackexchange.com/a/35669) 并在 TeX 常见问题列表中被引用 [，对应于“表格中的脚注”条目](https://texfaq.org/FAQ-footintab)。下面的示例演示了 `tablefootnote` 宏包的示例代码：

```latex
\documentclass{article}
% Using the geometry package with a small
% page size to create the article graphic
\usepackage[paperheight=6in,
   paperwidth=5in,
   top=10mm,
   bottom=20mm,
   left=10mm,
   right=10mm]{geometry}
\usepackage{hologo} % for TeX engine logos
\usepackage{booktabs} % for nice tables
\usepackage{tablefootnote} % for table footnotes
\begin{document}
\begin{table}
  \centering
    \begin{tabular}{lcc}
     \midrule
     \TeX{} engine & Native UTF-8 support & Unicode math support\\
     \midrule
       \hologo{pdfTeX} & 否\tablefootnote{通过 \LaTeX{} 内核命令提供的一些 UTF-8 支持。} & 否\\
       \Hologo{XeTeX} & Yes & Yes\\
       \Hologo{LuaTeX} & Yes & Yes\\
       \midrule
     \end{tabular}
    \caption[\TeX{} 引擎功能]{%
      \TeX{} 引擎功能比较\tablefootnote{草稿版本。将添加更多功能比较。}.}
\end{table}
\end{document}
```

[打开此 `\tablefootnote` 在 Overleaf 中的宏包示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+of+tablefootnote+package\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cusepackage%7Bhologo%7D+%25+for+TeX+engine+logos%0A%5Cusepackage%7Bbooktabs%7D+%25+for+nice+tables%0A%5Cusepackage%7Btablefootnote%7D+%25+for+table+footnotes%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Btable%7D%0A++%5Ccentering%0A++++%5Cbegin%7Btabular%7D%7Blcc%7D%0A+++++%5Cmidrule+%0A+++++%5CTeX%7B%7D+engine+%26+Native+UTF-8+support+%26+Unicode+math+support%5C%5C%0A+++++%5Cmidrule%0A+++++++%5Chologo%7BpdfTeX%7D+%26+No%5Ctablefootnote%7BSome+UTF-8+support+via+%5CLaTeX%7B%7D+kernel+commands.%7D+%26+No%5C%5C%0A+++++++%5CHologo%7BXeTeX%7D+%26+Yes+%26+Yes%5C%5C%0A+++++++%5CHologo%7BLuaTeX%7D+%26+Yes+%26+Yes%5C%5C%0A+++++++%5Cmidrule+%0A+++++%5Cend%7Btabular%7D%0A++++%5Ccaption%5B%5CTeX%7B%7D+engine+features%5D%7B%25%0A++++++%5CTeX%7B%7D+engine+feature+comparison%5Ctablefootnote%7BDraft+version.+Additional+feature+comparisons+will+be+added.%7D.%7D%0A%5Cend%7Btable%7D%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![tablefootnote 宏包示例](/files/d33473231d5f49340d0d00d58b167a2640e73e2b)

## 表注：脚注的替代方案

该 [`threeparttable` 宏包](https://ctan.org/pkg/threeparttable) 提供一种创建表注的机制 *指出*——这是在表格中使用脚注的替代方案。该 [`threeparttabl**ex**` 宏包](https://ctan.org/pkg/threeparttablex) 为以下宏包实现了表注功能： [longtable 宏包](https://ctan.org/pkg/longtable).

### 示例：使用 threeparttable 宏包创建表注

该 [threeparttable 宏包文档](http://mirrors.ctan.org/macros/latex/contrib/threeparttable/threeparttable.pdf) 内容非常简短，所以我们这里不重复，而是提供一个使用示例：

```latex
\begin{table}
  \begin{threeparttable}[b]
   \caption[\TeX{} 引擎功能]{\TeX{} 引擎功能比较\tnote{1}}
   \centering
   \begin{tabular}{lcc}
     \midrule
     \TeX{} engine & Native UTF-8 support & Unicode math support\\
     \midrule
       \hologo{pdfTeX} & 否\tnote{2}& 否\\
       \Hologo{XeTeX} & Yes & Yes\\
       \Hologo{LuaTeX} & Yes & Yes\\
       \midrule
     \end{tabular}
     \begin{tablenotes}
       \item [1] 这是早期草稿。
       \item [2] 通过 \LaTeX{} 内核命令提供的一些 UTF-8 支持。
     \end{tablenotes}
  \end{threeparttable}
\end{table}
```

[打开此 `threeparttable` Overleaf 中的示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=threeparttable+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+with+a+small%0A%25+page+size+to+create+the+article+graphic%0A%5Cusepackage%5Bpaperheight%3D6in%2C%0A+++paperwidth%3D5in%2C%0A+++top%3D10mm%2C%0A+++bottom%3D20mm%2C%0A+++left%3D10mm%2C%0A+++right%3D10mm%5D%7Bgeometry%7D%0A%5Cusepackage%7Bhologo%7D+%25+for+TeX+engine+logos%0A%5Cusepackage%7Bbooktabs%7D+%25+for+nice+tables%0A%5Cusepackage%7Bthreeparttable%7D+%25+to+use+table+notes%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Btable%7D%0A++%5Cbegin%7Bthreeparttable%7D%5Bb%5D%0A+++%5Ccaption%5B%5CTeX%7B%7D+engine+features%5D%7B%5CTeX%7B%7D+engine+feature+comparison%5Ctnote%7B1%7D%7D%0A+++%5Ccentering%0A+++%5Cbegin%7Btabular%7D%7Blcc%7D%0A+++++%5Cmidrule+%0A+++++%5CTeX%7B%7D+engine+%26+Native+UTF-8+support+%26+Unicode+math+support%5C%5C%0A+++++%5Cmidrule%0A+++++++%5Chologo%7BpdfTeX%7D+%26+No%5Ctnote%7B2%7D%26+No%5C%5C%0A+++++++%5CHologo%7BXeTeX%7D+%26+Yes+%26+Yes%5C%5C%0A+++++++%5CHologo%7BLuaTeX%7D+%26+Yes+%26+Yes%5C%5C%0A+++++++%5Cmidrule+%0A+++++%5Cend%7Btabular%7D%0A+++++%5Cbegin%7Btablenotes%7D%0A+++++++%5Citem+%5B1%5D+This+is+an+early+draft.%0A+++++++%5Citem+%5B2%5D+Some+UTF-8+support+via+%5CLaTeX%7B%7D+kernel+commands.%0A+++++%5Cend%7Btablenotes%7D%0A++%5Cend%7Bthreeparttable%7D%0A%5Cend%7Btable%7D%0A%5Cend%7Bdocument%7D)

此示例会生成以下输出

![Overleaf 中的 LaTeX 表注示例](/files/b04a663e8f3f953bb9d8d20fbb19745f0b879032)

### tex.stackexchange 上的讨论

表格脚注也在 tex.stackexchange 上被讨论过，并在诸如以下帖子中概述了各种解决方案，读者可自行探索：

* [LaTeX 中用于表格的脚注](https://stackoverflow.com/questions/2888817/footnotes-for-tables-in-latex)，以及
* [表格中的脚注](https://tex.stackexchange.com/questions/35615/footnote-in-table/35669).

## 进一步阅读

更多信息请参见：

* [页边注释](/latex/zh-cn/ge-shi-hua/15-margin-notes.md)
* [页面大小和页边距](/latex/zh-cn/ge-shi-hua/07-page-size-and-margins.md)
* [页眉和页脚](/latex/zh-cn/ge-shi-hua/02-headers-and-footers.md)
* [超链接](/latex/zh-cn/wen-dang-jie-gou/09-hyperlinks.md)
* [计数器](/latex/zh-cn/ge-shi-hua/10-counters.md)
* [列表](/latex/zh-cn/latex-ji-chu/04-lists.md)
* [字体大小、字体族和样式](/latex/zh-cn/zi-ti/01-font-sizes-families-and-styles.md)
* [粗体、斜体和下划线](/latex/zh-cn/latex-ji-chu/03-bold-italics-and-underlining.md)
* [字体类型](/latex/zh-cn/zi-ti/02-font-typefaces.md)
* [换行和空格](/latex/zh-cn/ge-shi-hua/05-line-breaks-and-blank-spaces.md)
* [大型项目中的管理](/latex/zh-cn/wen-dang-jie-gou/07-management-in-a-large-project.md)
* [多文件 LaTeX 项目](/latex/zh-cn/wen-dang-jie-gou/08-multi-file-latex-projects.md)
* [LaTeX2ε 的不算太短的介绍](http://www.ctan.org/tex-archive/info/lshort/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/latex/zh-cn/ge-shi-hua/14-footnotes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
