> 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/28-no-positions-in-optional-float-specifier.md).

# 可选浮动体参数中没有位置

这是一个标准的 LaTeX 错误，当你没有包含一个 [浮动体选项](/latex/zh-cn/tu-biao-he-biao-ge/02-positioning-images-and-tables.md) 在浮动体选项中，即 **`ht`** 在 **`\begin{figure}[ht]`**。浮动体位置参数是一个选项，它使我们能够更好地控制图形放置的位置。我们可用的不同放置选项如下：

| 选项 | 允许                                                                          |
| -- | --------------------------------------------------------------------------- |
| h  | 放置浮动体 *这里*，即， *大约* 在其在源文本中出现的同一位置（不过，不是 *完全* 在该处）                           |
| t  | 位置于 *顶部* 的页面上。                                                              |
| b  | 位置于 *底部* 的页面上。                                                              |
| p  | 放在一个特殊的 *page* 仅供浮动体使用。                                                     |
| !  | 覆盖 LaTeX 用于确定“良好”浮动体位置的内部参数。                                                |
| H  | 将浮动体精确放在 LaTeX 代码中的该位置。需要 *float* 宏包（*\usepackage{float}*）。这在某种程度上等同于 *h!*. |

这些 *浮动体位置参数* 在创建浮动体时，可以放在方括号内，例如 **`\begin{figure}[h]`**。它们甚至可以组合使用，例如 **`\begin{figure}[!htb]`**，这会告诉 LaTeX 将图形放置在 *这里*，或 *顶部*，或 *底部*。如果你像这样把方括号留空 **`\begin{table}[]`**，就会出现如下所示的错误消息。

main.tex

可选浮动体位置参数中没有位置。

## 如何解决该错误

**移除方括号：**

消除此错误的最简单方法是在不使用浮动体位置参数时去掉方括号，即不要写 **`\begin{figure}[]`**，你只需写 **`\begin{figure}`**.

**插入浮动体位置参数：**

解决此错误的另一种方法是插入一个 [浮动体选项](/latex/zh-cn/tu-biao-he-biao-ge/02-positioning-images-and-tables.md) ，用来告诉 LaTeX 你希望浮动体出现的位置。这应写在方括号中，例如 **`\begin{figure}[h]`** 或 **`\begin{table}[!htb]`**.


---

# 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/28-no-positions-in-optional-float-specifier.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.
