> 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/tex-latex-ji-yuan/06-hfuzz.md).

# \hfuzz

TEX 提供了一些命令，使你可以影响它的判断，即它是否认为一个盒子溢出过满并因此被报告——例如在 `.log` 文件中。

* `\hfuzz[=]` *长度*: `\hfuzz` 指定在一个……中的内容可以超出的量 `\hbox` 可以超出该……的宽度 `\hbox` 之前会被视为溢出过满。
* `\vfuzz[=]` *长度*: `\vfuzz` 指定在一个……中的内容可以超出的量 `\vbox` 可以超出该……的高度 `\vbox` 之前会被报告为溢出过满。

请注意：

* “`[=]`”表示等号是可选的。
* *长度* 是以 TEX 能理解的单位指定的一个量——例如 pt、bp、mm 等。

**用法示例**

* `\hfuzz=0.5pt` 或 `\hfuzz 0.5pt` （“=”是可选的）
* `\vfuzz=0.75pt` 或 `\vfuzz 0.75pt` （“=”是可选的）

#### 示例

如果我们把单词 “Overleaf” 放入一个 `\hbox` 并测量其宽度（使用默认字体）：

```
\setbox99=\hbox{Overleaf}\the\wd99
```

我们会看到其值为 36.41675pt。若现在将 “Overleaf” 放入一个 `\hbox` 太窄的，例如 36pt 的，并将 [`\overfullrule`](/latex/zh-cn/tex-latex-ji-yuan/07-overfullrule.md) 设为非零值：

```
\overfullrule=5mm
\hbox to 36pt{Overleaf}
```

下图显示了输出结果：

![](/files/b40bb0b61b096e842c0de9ccab20bd7c6143f3f5)

如果我们再设定 `\hfuzz=0.5pt` 并重复上述操作：

```
\overfullrule=5mm
\hfuzz=0.5pt
\hbox to 36pt{Overleaf}
```

下图：

![](/files/a55ddb6c8f69d46c25edf006f1321603db24cc4b)

表明 TEX 不再将 `\hbox to 36pt{Overleaf}` 视为溢出过满，因此不会添加 [`\overfullrule`](/latex/zh-cn/tex-latex-ji-yuan/07-overfullrule.md) 规则，因为 `\hfuzz` 的值（0.5pt）刚好足以阻止这种情况。

的行为 `\vfuzz` 与……类似 `\hfuzz`——不同的是，TEX 不会为竖盒显示溢出规则。

#### 关于 \hfuzz 的更多细节

TEX 实际上 *实际上* 检查的是材料超出宽度与总的（零阶）收缩胶的差值。例如，假设某些内容的总宽度为 100pt，而所需盒子宽度为 95pt：TEX 需要吸收的超出宽度是 5pt——它需要将可用胶缩短 5pt。假设总零阶胶收缩为 4pt，那么 TEX 会将当前的 `\hfuzz` 与 5pt 的值$$-$$4pt$$=$$1pt。

#### 相关命令

另请参见：

* [`\overfullrule`](/latex/zh-cn/tex-latex-ji-yuan/07-overfullrule.md)
* [`\hbadness`](/latex/zh-cn/tex-latex-ji-yuan/05-hbadness.md)


---

# 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/tex-latex-ji-yuan/06-hfuzz.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.
