> 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/tex-latex-yuan-yu/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-yuan-yu/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-yuan-yu/07-overfullrule.md) 规则，因为 `\hfuzz` （0.5pt）刚好足以阻止这一点。

……的行为 `\vfuzz` 与 `\hfuzz`类似——只是 TEX 不会为 vbox 显示过满规则。

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

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

#### 相关命令

另见：

* [`\overfullrule`](/latex/zh-cn/tex-latex-yuan-yu/07-overfullrule.md)
* [`\hbadness`](/latex/zh-cn/tex-latex-yuan-yu/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://ayakaleaf-pro.ayaka.space/latex/zh-cn/tex-latex-yuan-yu/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.
