> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/latex/zh-cn/ge-shi-hua/14-footnotes.md).

# 脚注

## LaTeX 主要脚注命令简介

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

### \footnote 命令

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

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

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

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

* `\footnote{自动生成的脚注标记效果很好！}` 会自动排版脚注标记的数字（上标）值 1，而
* `\footnote[42]{...is that the answer to everything?}` 则使用 42 作为脚注标记的值，并且如你所见，它不会递增用于自动创建标记的整数：第三个脚注的标记值为 2。

```latex
我在这里编写内容，是为了演示自动生成的脚注标记\footnote{自动生成的脚注标记效果很好！}以及使用命令提供的标记值的脚注\footnote[42]{...is that the answer to everything?}。

现在，我将使用另一个自动生成的脚注标记\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{*文本*}` 版本的该命令时，相应的计数器变量都会加 1。对于 `\footnote[*编号*]{*文本*}` 版本，相应的计数器变量会 *不* 递增。

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

### \footnotemark 和 \footnotetext 命令

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

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

这两个命令都带有一个 *可选的* 方括号中的参数（`[...]`):

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

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)

### 更改编号样式

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

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

* `\arabic{*counter variable*}`：排版 `*计数器变量*` 为阿拉伯数字。
* `\Roman{*counter variable*}`：排版 `*计数器变量*` 为大写罗马数字。
* `\alph{*counter variable*}`：排版 `*计数器变量*` 为小写字母。
* `\Alph{*counter variable*}`：排版 `*计数器变量*` 为大写字母。
* `\fnsymbol{*计数器变量*}`：排版 `*计数器变量*` 使用一组 [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` 用于排版各种 TeX 引擎名称的 LaTeX 宏包。

```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{女性}             &\textsc{关系} \\ \hline
       Mona                       &有伴侣\footnotemark  \\
       Diana Villiers             &后来成为妻子  \\
       Christine Hatherleigh Wood &未婚妻\footnotemark
     \end{tabular}
  \end{minipage}%  百分号使脚注文本紧贴 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}
% 使用 geometry 宏包与较小的
% 页面尺寸来创建文章图形
\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}
```

[在 Overleaf 中打开此 `\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}
```

[在 Overleaf 中打开此 `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)

此示例生成以下输出

![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://overleaf-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.
