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

# 存在未定义的引用

当以下情况发生时，会出现此错误 **`\ref{...}`** 被使用，而 LaTeX 无法找到相应的标签。发生这种情况有三种可能。

* 在……中有拼写错误 **`\label{...}`**
* 在……中有拼写错误 **`\ref{...}`**
* 忘记添加标签。

下面给出一个示例

```latex
\section{introduction}\label{introduction}
引用 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://overleaf-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.
