> 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/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/1aa1c0db057e0622102179f3c88d388d25f636c6)

**选项**

你可以向 showlabels 提供一个选项，告诉它应将标签放置在何处：

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

可用选项有（摘自 [文档](https://ctan.org/pkg/showlabels?lang=en)):

* `外侧` \[默认]——所有注释都放在文本的外边距中
* `内侧`——内边距
* `左侧`——左边距
* `右侧`——右边距
* `页边注` \[默认]——将注释放在页边中
* `行内`——尽可能将注释放在行内，并忽略上面的任何页边放置选项
* `nolabel`——不要为……插入页边注 `\label` 命令
* `草稿` \[默认]——不执行任何操作，……的配套项
* `定稿`——关闭该宏包的所有功能

请注意 `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://ayakaleaf-pro.ayaka.space/latex/zh-cn/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.
