> 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-cuo-wu/30-there-were-undefined-references.md).

# 存在未定义的引用

当出现以下情况时，此错误会出现 **`\ref{...}`** 被使用，而 LaTeX 无法找到对应的标签。造成这种情况有三种方式。

* 在……中有拼写错误 **`\label{...}`**
* 在……中有拼写错误 **`\ref{...}`**
* 有一个标签被遗漏了。

下面给出一个示例

```latex
\section{introduction}\label{introduction}
引用引言部分时的拼写错误会是 \ref{intorduction}。

另一种错误是引用一个从未定义过的标签，例如 \ref{section1}
```

以上每种情况都会生成如下所示的错误

main.tex，第 6 行

第 1 页上的引用 \`intorduction' 在输入第 6 行未定义。

main.tex，第 6 行

第 1 页上的引用 \`section1' 在输入第 8 行未定义。

main.tex，第 6 行

存在未定义的引用。

为避免这种情况，当我们使用 **`\ref{...}`**&#x65F6;，必须有相应的 **`\label{...}`**，并且 **`\ref{...}`** 和 **`\label{...}`** 的参数相同。


---

# 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-cuo-wu/30-there-were-undefined-references.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.
