LaTeX forum ⇒ 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?

Postby NSutcliffe » Thu Dec 18, 2008 6:17 pm

Hi all,

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

Nick

Link:
BBcode:
HTML:
Hide post links
Show post links

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Postby phi » Thu Dec 18, 2008 6:44 pm

please post a minimum working example

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Juanjo
Posts: 656
Joined: Sat Jan 27, 2007 12:46 am

Postby Juanjo » Thu Dec 18, 2008 7:35 pm

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:
  1. This is the first paragraph. It contains \\ two lines.
  2.  
  3. This is the second paragraph. \\
  4.  
  5. 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.

Link:
BBcode:
HTML:
Hide post links
Show post links

NSutcliffe
Posts: 9
Joined: Wed Dec 17, 2008 3:16 am

Postby NSutcliffe » Fri Dec 19, 2008 3:50 am

Ah I see. What if I want there to be additional line spaces between paragraphs?

Link:
BBcode:
HTML:
Hide post links
Show post links

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Postby phi » Fri Dec 19, 2008 6:25 am

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}

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Juanjo
Posts: 656
Joined: Sat Jan 27, 2007 12:46 am

Postby Juanjo » Fri Dec 19, 2008 10:36 am

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.

Link:
BBcode:
HTML:
Hide post links
Show post links

voula
Posts: 6
Joined: Thu Sep 03, 2009 11:08 am

Postby voula » Thu Sep 03, 2009 11:11 am

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

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Juanjo
Posts: 656
Joined: Sat Jan 27, 2007 12:46 am

Postby Juanjo » Thu Sep 03, 2009 1:47 pm

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.

Link:
BBcode:
HTML:
Hide post links
Show post links

voula
Posts: 6
Joined: Thu Sep 03, 2009 11:08 am

Postby voula » Thu Sep 03, 2009 3:41 pm

I've already posted the code.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Juanjo
Posts: 656
Joined: Sat Jan 27, 2007 12:46 am

Postby Juanjo » Thu Sep 03, 2009 3:50 pm

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.

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “General”

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 5 guests