Generalunderfull hbox on new line?

LaTeX specific issues not fitting into one of the other forums of this category.
NSutcliffe
Posts: 9
Joined: Wed Dec 17, 2008 3:16 am

underfull hbox on new line?

Post by NSutcliffe »

Hi all,

Whenever I create a new line (using \\) I get an underfull hbox error.. what's going on there?

Nick

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Re: underfull hbox on new line?

Post by phi »

please post a minimum working example
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

underfull hbox on new line?

Post by Juanjo »

NSutcliffe wrote:Hi all,

Whenever I create a new line (using \\) I get an underfull hbox error.. what's going on there?

Nick
It is not an error, but a warning. Errors stops compilation, warnings don't.

Many warnings of this kind come from a misunderstanding of the \\ command. It means "new line", certainly. But, let's precise, newline inside the same paragraph. Look at this:

Code: Select all

This is the first paragraph. It contains \\ two lines.

This is the second paragraph. \\

This is the third paragraph.
The first use of \\ is correct. This command introduces a line break. The same paragraph continues in a new line. The second use of \\ is incorrect. LaTeX expects more text to write a new line of the second paragraph. Since there is not more text, the second line of the paragraph remains empty and LaTeX complains issuing a warning. Never use \\ at the end of a paragraph. Paragraphs are ended by a blank line or the \par command.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
NSutcliffe
Posts: 9
Joined: Wed Dec 17, 2008 3:16 am

Re: underfull hbox on new line?

Post by NSutcliffe »

Ah I see. What if I want there to be additional line spaces between paragraphs?
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Re: underfull hbox on new line?

Post by phi »

If you want extra space at exactly one place, use \vspace{12pt} or similar.
If you want space after every paragraph, set \parskip to a postive value, like \setlength{\parskip}{12pt}
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

underfull hbox on new line?

Post by Juanjo »

Completing phi's answer, you can also load the parskip package (just \usepackage{parskip}), which sets \parskip as half the baseline skip (plus some glue for stretching or shrinking the paragraph separation as needed). This package also tweaks some related parameters. See pp 5-6 in the l2tabuen document. Likewise, instead of \vspace{length}, you can occasionally use \smallskip, \medskip and \bigskip. The latter, for example, is a shorthand for \vspace{\bigskipamount}, where \bigskipamount is an already fixed length.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
voula
Posts: 6
Joined: Thu Sep 03, 2009 11:08 am

Re: underfull hbox on new line?

Post by voula »

Hi!

I encountered the same problem. I get the following message, despite several changes I tried in the phrasing of my sentence. Can you please help?

Underfull \hbox (badness 10000) in paragraph at lines 17--18


\hbox(0.0+0.0)x360.0
.\glue(\rightskip) 0.0


Underfull \hbox (badness 10000) in paragraph at lines 19--20


\hbox(0.0+0.0)x360.0
.\glue(\rightskip) 0.0


Completed box being shipped out [3]
\vbox(629.40024+0.0)x414.0
.\glue 21.0
.\vbox(608.40024+0.0)x360.0, shifted 54.0
..\vbox(12.0+0.0)x360.0, glue set 12.0fil
...\glue 0.0 plus 1.0fil
...\hbox(0.0+0.0)x360.0
..\glue 25.0
..\glue(\lineskip) 0.0
..\vbox(541.40024+0.0)x360.0, glue set 133.8566fil
...\glue(\topskip) 3.39584
...\hbox(7.60416+2.12917)x360.0, glue set 0.4994
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: underfull hbox on new line?

Post by Juanjo »

Please, post a minimum working example, that is, a piece of code which can be compiled by itself an which reproduces the same error. Without seeing some code, it is not possible to determine the cause of the problem,
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
voula
Posts: 6
Joined: Thu Sep 03, 2009 11:08 am

Re: underfull hbox on new line?

Post by voula »

I've already posted the code.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

underfull hbox on new line?

Post by Juanjo »

voula wrote:I've already posted the code.
Sorry, but... where is it?
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Post Reply