> 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/19-latex-error-unknown-float-option-h.md).

# LaTeX 错误：未知的浮动体选项 \`H'

当你忘记加载 **`float`** 宏包时，就会出现此错误。每当我们使用一个 *float* 例如图或表，也就是 **`H`** 中插入一个 **`\begin{figure}[H]`**。 **`H`** 浮动体位置参数是 **`float`** 宏包。它告诉编译器将图放在页面上的确切位置，而不是移动到别处。每当我们想使用此选项时，必须包含 **`\usepackage{float}`** 在导言区中。要了解更多关于如何使用选项来指定浮动体位置的信息，请查看我们的 [文档](/latex/zh-cn/tu-biao-he-biao-ge/02-positioning-images-and-tables.md).

## 常见原因

**忘记加载 `float` 宏包的示例代码：**

该 [float 宏包](https://www.ctan.org/pkg/float?lang=en) 为我们提供了 `H` 选项。这是 `h`，并告诉 LaTeX 我们希望该图出现 *完全* 在这里。如果我们使用 `H` 选项，但忘记包含 `\usepackage{float}` 在导言区中，我们将得到如下所示的错误

main.tex，第 12 行

LaTeX 错误：未知的浮动体选项 \`H'。

请参阅 LaTeX 手册或《LaTeX Companion》以获取说明。输入 H 可立即获得帮助。... l.10 \begin{figure}\[H] 选项 \`H' 被忽略，并使用了 \`p'。

要解决此错误，我们只需包含 **`\usepackage{float}`** 在文档的导言区中，即在 **`\begin{document}`**


---

# 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/19-latex-error-unknown-float-option-h.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.
