> 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/latex-wen-ti/02-keep-track-of-your-labels-with-showlabels.md).

# 使用 showlabels 追蹤你的標籤

**作者：James Allen（2012 年 1 月）**

每當我在撰寫冗長的 LaTeX 文件時，我總是發現自己在程式碼中來回跳來跳去，只為了記住我把某個東西命名為 `\label`。為了避免在程式碼中迷失位置，我會使用 [`showlabels`](https://ctan.org/pkg/showlabels?lang=en) 這個套件會在對應方程式旁顯示標籤名稱。接著我就可以在 PDF 中查看，因為那裡更容易找到我正在尋找的方程式，而且我不需要在程式碼中到處跳來跳去。它幾乎適用於你能為其指定一個 `\label` 。真棒！

**用法**

在導言區中加入：

```latex
\usepackage{showlabels}
```

**範例輸出**

![ShowlabelsExample.png](/files/778c9c32af10a984006196cb419a49d050e00d2d)

**選項**

你可以為 showlabels 提供選項，告訴它要將標籤放在哪裡：

```latex
\usepackage[inline]{showlabels}
```

可用選項如下（取自 [說明文件](https://ctan.org/pkg/showlabels?lang=en)):

* `outer` \[預設]——所有註記都會放在文字的外邊距中
* `inner`——內邊距
* `left`——左邊距
* `right`——右邊距
* `marginal` \[預設]——將註記放在邊距中
* `行內`——盡可能將註記置於行內，並忽略上方任何邊距放置選項
* `nolabel`——不要為其插入邊註 `\label` 命令
* `draft` \[預設]——不執行任何動作，與... 的搭檔
* `final`——關閉套件的所有功能

請注意 `showlabels` 應在這些套件之後加入 `amsmath` 和 `hyperref` 才能與它們正常運作。請參閱 [官方文件（PDF）](http://mirrors.ctan.org/macros/latex/contrib/showlabels/showlabels.pdf) 以了解更多細節。


---

# 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/latex-wen-ti/02-keep-track-of-your-labels-with-showlabels.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.
