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

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

当你忘记加载该宏包时，就会出现此错误。 **`float`** 宏包。每当我们使用一个时，浮动体说明符都会写在方括号中 *float* 例如图形或表格，也就是 **`H`** .bib 文件中插入一个 % **`\begin{figure}[H]`**。 **`H`** 浮动体说明符属于 **`float`** 宏包。它会告诉编译器将图形放在页面上的那个精确位置，而不是把它移动到别处。每当我们想使用此选项时，都必须在 **`\usepackage{float}`** 导言区中包含。要了解更多关于如何使用选项来指定浮动位置的信息，请查看我们的 [文档](/latex/zh-cn/tu-xing-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://ayakaleaf-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.
