Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I read all the questions regarding the error message Underfull \hbox (badness 10000) in paragraph at lines but I am still not sure if my code is correct. The problem is with the tabular of a table.

When I see the pdf, what I notice is that the first raw (the header) occupies more than one line and some words are cut, which is the behavior I do expect. So, my question is, should I ignore those warnings or should I fix something?

To reproduce the code:

\documentclass{article}

% Tables  
\usepackage{pdfpages}
\usepackage{longtable}
\usepackage{array} % for extrarowheight
\usepackage[table]{xcolor}
\usepackage{tabularx}
\usepackage{ifthen}
\usepackage{xspace}
%\setlength{\extrarowheight}{1pt}
%\setlength{\tabcolsep}{1em}
\rowcolors{1}{black!10}{}

\newboolean{nextRetrait}
%\setboolean{french}{false}
\setboolean{nextRetrait}{false}

\newcommand{\retrait}
    {\ifthenelse{\boolean{nextRetrait}}%
       {\hspace{-3cm}}%
       {}}%


\begin{document}

\begin{center}
\begin{table*}[!ht]
{\small
\hfill{}
\centering
\scalebox{0.8}{
\retrait\begin{tabular}{|p{1.8cm}|p{1.2cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.4cm}|p{1.4cm}|p{1.4cm}|p{1.4cm}|p{0.6cm}|}
 \hline     
      \textbf{Application (swap unit)}
       &\textbf{Size (MB) before swapping}
      &\textbf{Objects before swapping}
       &\textbf{Size (MB) after swapping}
      &\textbf{Objects after swapping}
       &\textbf{Size (MB) after experiments}
      &\textbf{Objects after experiments}
      &\textbf{Average objects per graph}
      &\textbf{Average \% of shared objects per graph}
      &\textbf{Gain}
\\
\hline
XXX (class) & 22.7 &  469882 & 10.6 & 254696 & 13.8 & 317107 & 170 &17\% & 40\% \\
\hline
\end{tabular}}}
\hfill{}
\caption{XXX}
\label{tb:XXX}
\end{table*}
\end{center}

\end{document}

And the warnings:

Overfull \hbox (2.82243pt too wide) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Application

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 (swap

Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Size

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 (MB)

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 be-fore

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 swap-

Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Objects

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 be-fore

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 swap-

Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Size

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 (MB)

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 af-ter

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 swap-

Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Objects

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 af-ter

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 swap-

Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Size

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 (MB)

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 af-ter

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 ex-per-i-

Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Objects

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 af-ter

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 ex-per-i-

Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Average

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 ob-jects

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 per

Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Average

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 % of

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 shared

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 ob-jects

Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 per

Overfull \hbox (5.3494pt too wide) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Gain| 

Overfull \hbox (57.22829pt too wide) in paragraph at lines 30--51
[]  []

Underfull \hbox (badness 10000) in paragraph at lines 30--51
share|improve this question
2  
To answer the first part of your question: You can often ignore one such underfull warning. But if you get a lot of similar warnings this normally indicates that something is wrong in your code design, like here where you tried to put justified text in small columns. You should try to correct such warnings even if they seem to have no evil optical effects - if only because they clutter your log-file and hide the important warnings. –  Ulrike Fischer Jun 21 '12 at 10:49
add comment

1 Answer

up vote 7 down vote accepted

You may want to set the headers ragged right: say

\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}

in your preamble and use

\begin{tabular}{|P{1.8cm}|P{1.2cm}|P{1.3cm}|P{1.3cm}|P{1.3cm}|P{1.4cm}|P{1.4cm}|P{1.4cm}|P{1.4cm}|P{0.6cm}|}

You'll have to fine tune the width, as "Application" and "Gain" don't really fit.

share|improve this answer
    
Thanks @egreg!!! I didn't notice the problem was that the text was justified. I changed \raggedright to \centering because it was better for my case. Now it is much better. Thanks! –  Mariano Martinez Peck Jun 21 '12 at 12:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.