> 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-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{...}`**&#x6642;，都有對應的 **`\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-tw/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.
