Underfull \hbox (badness <n>) in paragraph at lines <a>--<b>

A line had to be stretched more than TeX likes, leaving wide gaps between words. Usually caused by \\ or \linebreak in running text.

Help centre › LaTeX errors › Floats and layout · Warning: the document still compiles

What the log says

Underfull \hbox (badness 10000) in paragraph at lines 4--6

 []

What it means

TeX justifies each line by stretching the spaces between words. Badness measures how much: 10000 is the maximum, meaning a line that is almost empty or stretched as far as it can go. The PDF still comes out; the line simply looks loose or the paragraph ends oddly. Unlike an overfull box, nothing crosses the margin.

Causes and fixes

Most common first. Each example is a complete document; the first fails with this message, the second is the same document fixed.

1. \\ used to end a paragraph or to add vertical space

\\ ends a line inside a paragraph; at the end of a paragraph it leaves an empty, infinitely stretched line. End paragraphs with a blank line, and add space with \medskip or \vspace{…}.

Fails
\documentclass{article}
\begin{document}
The first observation was made in March.\\

The second observation followed in May.
\end{document}
Fixed
\documentclass{article}
\begin{document}
The first observation was made in March.

\medskip
The second observation followed in May.
\end{document}

2. \linebreak or \newline forcing a break in a justified line

A forced break in mid-line leaves too few words to fill the line, so the spaces stretch. Remove the forced break and let TeX choose; if a break is needed for layout, fix it only in the final version.

Fails
\documentclass{article}
\begin{document}
We measured the temperature \linebreak at three sites over two years and found a steady rise in the mean.
\end{document}
Fixed
\documentclass{article}
\begin{document}
We measured the temperature at three sites over two years and found a steady rise in the mean.
\end{document}

3. Long words in a narrow column or table cell

In a narrow p{…} column there are too few spaces to stretch. Set the column ragged right with >{\raggedright\arraybackslash}p{3cm} (needs the array package), or widen it.

4. \sloppy or long URLs that left a line with few break points

A line that ends just before an unbreakable URL may be stretched to fill the width. \usepackage{xurl} lets the URL break and fills the line instead.

In Manulyx

The editor lists the warning with the compile's others; it never stops the PDF.

Write in Manulyx for free · Journal templates

More in floats and layout

Every example on this page was compiled with pdfLaTeX to check that it fails and is fixed as described. All LaTeX errors