TeX Overfull Boxes: Raise Tolerance or Reword Text?
TeX flags overfull boxes when text cannot fit the line width. Raising tolerance can remove black rules, but looser spacing has typographic costs.
02 Aug 2026, 21:11 UTC

A narrow column with a long technical term can leave a black bar in your TeX output. That bar is an overfull rule, and the usual fix--rewriting every problem line--does not scale. A more practical engineering decision is to adjust TeX's justification tolerance so the line-break optimizer accepts looser spacing instead of failing.
What an Overfull hbox Means
When TeX cannot fit material within the current line width, stored in \hsize, it writes Overfull \hbox to the log and draws a black rule whose width is set by \overfullrule (default 5 pt). The rule marks where content protrudes past the margin; it is a diagnostic, not decoration.
% Run: pdftex filename.tex (or tex filename.tex)
% Required: read/write access to filename.tex; no special privileges
\hsize=3cm
\overfullrule=5pt
ThisIsAVeryLongTechnicalTermThatCannotFitWithinTheNarrowColumn
\bye
Expected check: the log typically contains a line resembling Overfull \hbox (12.5pt too wide) detected at line 4. The PDF may show a black bar extending into the margin. Risk: the text can still collide with margin notes or other boxed material even if you suppress the rule.
Diagnosing With Log Lines and Box Controls
TeX decides whether to complain using several primitives:
| Primitive | Typical default | Effect |
|---|---|---|
\tolerance | 200 | Maximum badness TeX accepts before forcing a break; higher values allow looser spaces. |
\pretolerance | 100 | Badness limit applied before hyphenation is attempted. |
\hfuzz | 0.1 pt | Overfull boxes smaller than this amount are not reported. |
\overfullrule | 5 pt | Width of the black rule printed at the overflow point. |
Set \tracingonline=1 to send diagnostics to the terminal as well as the log. If the log message is ambiguous, \showboxbreadth=\maxdimen and \showboxdepth=\maxdimen followed by \showbox255 dump the current box structure.
Engineering Decision: Raise Tolerance or Reword
TeX optimizes line breaks across the whole paragraph, so a local discretionary hyphen (\-) can push the overflow to a neighboring line instead of removing it. Raising \tolerance lets TeX accept wider interword spacing, which often eliminates overfull boxes without manual rewording.
% Example configuration; place before the problem paragraph
\tolerance=2000
\pretolerance=1000
\hyphenpenalty=50
\hsize=3cm
ThisIsAVeryLongTechnicalTermThatCannotFitWithinTheNarrowColumn
\bye
With \tolerance=2000, TeX may accept spacing noticeably wider than normal. Setting \tolerance=9999 effectively removes the spacing constraint, but that is a last resort. \hfuzz=1pt can reduce log noise during development, yet it does not change the geometry of the output.
Trade-Offs and Limitations
Looser spacing creates rivers of white space and uneven visual texture. Suppressing the rule with \overfullrule=0pt hides the symptom while the text may still protrude into the margin. Format layers such as LaTeX can override these primitives, so verify in the actual format you use rather than assuming plain-TeX behavior carries over unchanged.
Practical check: compile the file, open the log, and search for Overfull \hbox. Then inspect the PDF at the reported line number to confirm no text crosses the margin boundary. If the log is clean but spacing looks uneven, lower \tolerance and reword instead.
Actionable Checklist
- Inspect the log for
Overfull \hbox; do not rely on visual inspection alone. - Try rewording or allowing natural hyphenation before changing parameters.
- Set
\tolerance=2000and\pretolerance=1000as a balanced starting point. - Enable hyphenation with
\hyphenpenalty=50or lower. - Compile and verify that overfull messages disappear and text stays within the margin.
Use tolerance adjustment as a targeted fix, not a global silence switch. The goal is bounded, readable text, not a log without warnings.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.