0

I am inserting line breaks as follows.

Lorem ipsum dolor sit amet \\

New paragraph \

Another new paragraph

For every new paragraph, Overleaf gives a warning. This is either of the two, sometimes both:

  • Overfull \hbox (6.36636pt too wide)
  • Underfull \hbox (badness 10,000)

What is causing this warning, and what is the appropriate method for new paragraphs?

  • 2
    Welcome to tex.sx. Never use a double backslash to end a paragraph. The canonical defined paragraph ending is a blank line or \par. A double backslash will indeed break the current line, but it will cause other problems that may or may not result in error messages. – barbara beeton Feb 26 '22 at 16:11
  • 2
    you should almost never use \\ outside of tables or math alignments, certainly never use it at the end of a paragraph as that is always an error, unfotunately only reported as a warning Underfull \hbox (badness 10,000) see https://tex.stackexchange.com/questions/334246/what-does-the-phrase-underfull-hbox-badness-10000-in-paragraph-actually-mea/334249#334249 – David Carlisle Feb 26 '22 at 16:35

2 Answers2

1

When a paragraph ends by \\ in LaTeX then LaTeX defines \\ as \hfil\break and TeX adds final \unskip\nobreak\hskip\prafilskip\break from following \par command. So, we have at the end of the paragraph:

...last word.\hfil\break\nobreak\hskip\parfillskip\break

and the line is broken at the first \break. The following \hskip\parfillskip is a discardable element, it is removed. We have the last \break immediatelly after previous \break. The line between those two breaks must be set to the width \hsize but there is no material in it. This is the reason of Underfull \hbox and this is very common mistake of LaTeX beginners if they don't know nothing about TeX.

wipet
  • 74,238
1

There is no reason to use \\ to end normal lines of text. It is actually wrong.

Paragraphs are separated from each other with a blank line and no LaTeX guide can possibly recommend using \\, even less with a following blank line.

Just forget it. The command \\ can be used for ending lines in some situations: inside center and the alignment environments such as tabular, array, align, gather` and similar ones. The difference is that in these cases ending a line must be explicitly marked, but note that this is ending lines, not paragraphs ending.

If your aim is to leave vertical spaces between paragraphs, load the parskip package (but your readers will be grateful if you don't).

Overfull boxes are a different matter: they mean that TeX couldn't find a suitable sequence of break points to fully justify a paragraph. The usual advice is to worry about them only in the very final phase of document production. Rewriting and fixing the grammar most often cures the problem.

egreg
  • 1,121,712