Configuring \emergencystretch as a hard overfull-box limit in TeX
0 reputation · 01 Aug 2025, 17:53 UTC
The goal is to configure TeX so that a positive \emergencystretch behaves as a binding upper bound on paragraph badness, preventing any overfull \hbox from being shipped out.
In TeX82, \emergencystretch is consulted only after the first and second line-breaking passes fail, and it does not guarantee the elimination of overfull boxes; TeX still accepts a breakpoint when no candidate satisfies the active badness limit. \hbadness controls whether overfull boxes are recorded in the log, not whether emergency stretching is applied. pdfTeX, LuaTeX, and XeTeX may alter results through font protrusion, expansion, or microtype extensions, so behavior may diverge from frozen TeX82 behavior.
Does any TeX engine provide a mode or primitive that makes \emergencystretch a hard constraint rather than a final fallback pass? If not, which combination of \pretolerance, \tolerance, and \hbadness reliably exposes every paragraph exceeding the configured stretch without hiding overfull warnings? Do font protrusion and expansion features participate in the \emergencystretch decision, or do they operate independently of it?