> 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-tw/ge-shi-hua/14-footnotes.md).

# 註腳

## LaTeX 主要腳註命令簡介

根據維基百科，腳註是由一位名叫 [理查德·朱格](https://en.wikipedia.org/wiki/Note_\(typography\)#History) （約 1514–1577）。這個歷史悠久的文學手法受到 LaTeX 支援；在這篇說明文章中，我們會解釋主要的腳註相關命令，並提供一系列範例來展示其用法。

### The \footnote command

該 `\footnote` 命令是 LaTeX 用於建立腳註的核心命令，有兩種形式：

* `\footnote{*text for footnote*}`：這會插入一個（自動產生的）上標數字，稱為腳註 *標記*，並將其插入文件正文，同時在頁面底部建立對應的腳註，其中包含相對應的腳註 *標記* 和 `*text for footnote*`.
* `\footnote[*number*]{*text for footnote*}`：這種形式的命令會使用可選值 `*number*` 來建立上標腳註 *標記*；它也會在頁面底部插入對應的腳註，其中包含識別用的腳註標記（`*number*`）與 `*text for footnote*`.

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

以下是一個範例，示範 \footnote 的兩種變體 `\footnote`:

* `\footnote{自動產生的腳註標記運作良好！}` 會自動排版腳註標記的數字（上標）值（1），而
* `\footnote[42]{……就是萬物的答案嗎？}` 將 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/b1c7c568ad87d2d1aafa74122d511c8aa04c84ca)

### 儲存目前腳註標記值：LaTeX 計數器

LaTeX 使用所謂的 [*計數器變數*](/latex/zh-tw/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-tw/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{這裡是腳註。}|。 \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/1854ec6bf9a10d72e5103ad170d1dd341c4bc1ae)

### 其他 LaTeX 腳註命令

除了我們已經探討過的命令之外：

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

LaTeX 還提供了數個額外的腳註相關命令，我們僅列出而不詳細探討。以下說明取自 LaTeX2e 原始碼文件：

* `\footnotesize`：用於腳註的改變字級命令。
* `\footins`：正文與腳註之間的空間。分隔腳註與正文的橫線會出現在這個空間中。這個空間位於高度為 `\footnotesep` 的支架之上，而該支架位於第一則腳註的開頭。
* `\footnoterule`：用來繪製分隔腳註與正文橫線的巨集。它會在一個 `\vspace` 的 token 值 `\skip\footins`之後立即執行。它應該不佔用垂直空間——也就是說，它應使用負的間距來抵銷其所佔用的任何正向空間。
* `\footnotesep`：放置於每則腳註開頭的支架高度。

## 腳註的範例與應用

### 具有多個參照的腳註

以下範例示範一種對同一則腳註建立多個參照的方法。透過使用 `\footnotemark[\value{footnote}]` ，你可以插入一個對應於 *目前* 的值的上標 `footnote` [計數器](/latex/zh-tw/ge-shi-hua/10-counters.md) ，但不會遞增 `footnote` 計數器值（有關計數器的更多資訊，請參見 [這篇 Overleaf 說明文章](/latex/zh-tw/ge-shi-hua/10-counters.md)).

```latex
我寫這段是為了測試\footnote{腳註運作良好！}的幾項腳註功能。
你可以使用 \verb|\footnotemark|
命令插入腳註標記，之後再使用 \verb|\footnotetext| 命令來排版腳註
文字，方法是撰寫 \verb|\footnotetext{第二則腳註的文字。}|
\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/a455fead53a882091be74b365b7c0ddfed390edb)

### 變更編號樣式

腳註編號的目前值儲存在一個稱為 `footnote` [*計數器*](/latex/zh-tw/ge-shi-hua/10-counters.md) 的 LaTeX 變數中，並可透過命令 `\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-tw/ge-shi-hua/10-counters.md#accessing-and-printing-counter-values).

有關建立、使用與修改計數器的背景資訊，請參見 [這篇關於計數器的 Overleaf 文章](/latex/zh-tw/ge-shi-hua/10-counters.md#accessing-and-printing-counter-values).

以下是使用 `\renewcommand{\thefootnote}{\roman{footnote}}`:

```latex
我寫這段是為了測試\footnote{腳註運作良好！}的幾項腳註功能。
你可以使用 \verb|\footnotemark|
命令插入腳註標記，之後再使用 \verb|\footnotetext| 命令來排版腳註
文字，方法是撰寫 \verb|\footnotetext{第二則腳註的文字。}|
\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/4fe22e289f699969c89d9d6c0fc0c3be339fbc81)

### 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/3c14aab37c5d9c78ae044026b0ce7ec5a7ddcf23)

### 變更 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/892fb1ed55c90f58e78de463d31b7609567f7747)

## 表格中的腳註

以下各節將探討與在表格中使用腳註相關的若干主題。

### 你應該在表格中使用腳註嗎？

該 [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{部分 UTF-8 支援可透過 \LaTeX{} 核心命令取得。} & 否\\
       \Hologo{XeTeX} & 是 & 是\\
       \Hologo{LuaTeX} & 是 & 是\\
       \midrule
     \end{tabular}
    \caption[\TeX{} engine features]{%
      \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/20144698e0ade9141077767ece3d32c0d1f7fe16)

一個部分解決方案是將 `tabular` 放在一個 `minipage` 環境：

```latex
\begin{minipage}{\textwidth}
  \centering
    \begin{tabular}{lcc}
     \midrule
     \TeX{} engine & Native UTF-8 support & Unicode math support\\
     \midrule
       \hologo{pdfTeX} & 否\footnote{部分 UTF-8 支援可透過 \LaTeX{} 核心命令取得。} & 否\\
       \Hologo{XeTeX} & 是 & 是\\
       \Hologo{LuaTeX} & 是 & 是\\
       \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)

此範例會產生以下輸出：

![置於 minipage 中的 LaTeX tabular 以修正腳註](/files/39fb2e9d4591de0561b01341682385f18a65a2df)

請注意，你也可以寫 `\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/fea7653a907b358d21c2bf3ae6416c3b04b25d8d)

### 範例：透過 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} % 用於 TeX 引擎標誌
\usepackage{booktabs} % 用於漂亮的表格
\usepackage{tablefootnote} % 用於表格腳註
\begin{document}
\begin{table}
  \centering
    \begin{tabular}{lcc}
     \midrule
     \TeX{} engine & Native UTF-8 support & Unicode math support\\
     \midrule
       \hologo{pdfTeX} & 否\tablefootnote{部分 UTF-8 支援可透過 \LaTeX{} 核心命令取得。} & 否\\
       \Hologo{XeTeX} & 是 & 是\\
       \Hologo{LuaTeX} & 是 & 是\\
       \midrule
     \end{tabular}
    \caption[\TeX{} engine features]{%
      \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/d9698b4f49a2d3dfb91d43eefb8560371ca7f99a)

## 表格註解：腳註的替代方案

該 [`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{} engine features]{\TeX{} 引擎功能比較\tnote{1}}
   \centering
   \begin{tabular}{lcc}
     \midrule
     \TeX{} engine & Native UTF-8 support & Unicode math support\\
     \midrule
       \hologo{pdfTeX} & 否\tnote{2}& 否\\
       \Hologo{XeTeX} & 是 & 是\\
       \Hologo{LuaTeX} & 是 & 是\\
       \midrule
     \end{tabular}
     \begin{tablenotes}
       \item [1] 這是一份早期草稿。
       \item [2] 部分 UTF-8 支援可透過 \LaTeX{} 核心命令取得。
     \end{tablenotes}
  \end{threeparttable}
\end{table}
```

[在 Overleaf 中開啟這個 `threeparttable` 範例](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/303526abe6d43682620e5e0cdebd82d1c72867de)

### 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-tw/ge-shi-hua/15-margin-notes.md)
* [頁面大小與邊界](/latex/zh-tw/ge-shi-hua/07-page-size-and-margins.md)
* [頁首與頁尾](/latex/zh-tw/ge-shi-hua/02-headers-and-footers.md)
* [超連結](/latex/zh-tw/wen-jian-jie-gou/09-hyperlinks.md)
* [計數器](/latex/zh-tw/ge-shi-hua/10-counters.md)
* [清單](/latex/zh-tw/latex-ji-chu/04-lists.md)
* [字型大小、字族與樣式](/latex/zh-tw/zi-xing/01-font-sizes-families-and-styles.md)
* [粗體、斜體與底線](/latex/zh-tw/latex-ji-chu/03-bold-italics-and-underlining.md)
* [字型字體](/latex/zh-tw/zi-xing/02-font-typefaces.md)
* [換行與空白](/latex/zh-tw/ge-shi-hua/05-line-breaks-and-blank-spaces.md)
* [大型專案中的管理](/latex/zh-tw/wen-jian-jie-gou/07-management-in-a-large-project.md)
* [多檔案 LaTeX 專案](/latex/zh-tw/wen-jian-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-tw/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.
