> 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/tex-latex-primitives/07-overfullrule.md).

# \overfullrule

`\overfullrule[=]` *dimension*

Where:

* “`[=]`” means that the equals sign is optional.
* *dimension* is an amount specified in units that TEX can understand—e.g., pt, bp, mm etc.

When TEX detects that an hbox is overfull—such as a line in a typeset paragraph or some text in an `\hbox{..}`—it will write that information to the log file. In addition, TEX engines also provide the `\overfullrule` command which can be used to instruct TEX to add a short rule to the end of the offending box, acting as a visual warning to the user.

**Usage example**

Because the “=” sign is optional you can write `\overfullrule=10pt` or `\overfullrule 10pt`.

Note that LATEXsets `\overfullrule` to 0pt, Plain TEX sets it to 5pt.

#### An example

We’ll use an `\hbox{}` that will be overfull: `\hbox to 10pt{This box will be overfull}` and set `\overfullrule` to a non-zero value, say 10mm:

```
\overfullrule=10mm\hbox to 10pt{This box will be overfull}\par
```

The following graphic shows the output:

![](/files/eXIN40lByc9HHLWi2L9C)

As you can see, a 10mm-long rule has been added to the end of the overfull `\hbox`. Now set `\overfullrule=0mm` to prevent an overfull box rule being displayed:

```
\overfullrule=0mm\hbox to 10pt{This box will be overfull}
```

The following graphic shows the output:

![](/files/B2PKDlvPmg9GPcsYD34q)

The resulting `\hbox` is still overfull but this time it is displayed without an overfull rule to highlight that fact.

#### Another example: lines in a paragraph

When TEX breaks a pararaph into lines of typeset text, each line in the paragraph is stored in an `\hbox`. TEX can be told to display overfull lines by setting `\overfullrule` to a non-zero value. The following example shows overfull rules being displayed at the end of overfull lines in a paragraph.

To create a paragraph, we’ll put some text in a narrow `\vbox`, set `\overfullrule=10pt`, and draw the box with a border. Note that because we used the `\verb` command we first need to save the `\vbox` in a box register (100) and then use the LATEX command (macro) `\fbox` to draw a tight border around it, making it easier to see the overfull lines.

```
\overfullrule=10pt
\setlength{\fboxsep}{0pt}% To ensure a tight border with no gap
\setbox100=\vbox{\hsize=30mm Inside this vbox we’ll set the
linewidth to 30mm using \verb|\hsize=30mm|.
We are typesetting some text inside a \verb|\vbox|
because it will cause \TeX{} to perform linebreaking
and build the paragraph as a stack of horizontal boxes.
For some lines \TeX{} might be unable to find a good
linebreak which can result in lines too wide to fit
within a width of 30mm. Because \verb|\overfullrule| is
non-zero (10pt), those overfull lines are
indicated by an overfull rule of width 10pt. Note that to \TeX{},
this box is still considered to be 30mm wide even though
some lines do not fit and an \verb|\overfullrule|
of width 10pt is added on to the end of some lines.}
\fbox{\copy100}
```

The following graphic shows the output:

![](/files/TRbClsY2X2V7srgCO1JA)


---

# 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/tex-latex-primitives/07-overfullrule.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.
