Underfull \hbox (badness 10000) in paragraph at lines... in Sphinx 1.1.2

3,322 views
Skip to first unread message

Kristina Hoeppner

unread,
Jan 1, 2012, 2:07:59 AM1/1/12
to sphinx-dev
Hello,

I get a number of "Underfull \hbox (badness 10000) in paragraph at
lines..." warning when I generate a LaTeX PDF in Sphinx 1.1.2.

As far as I can narrow it down / see, it is the following:

1. .. warning:: directive - the error occurs on the last line and the
empty line below, e.g.

rST:

.. warning::
When you delete a group, all its content and contributions from
users are gone and cannot be retrieved again.

Underfull \hbox (badness 10000) in paragraph at lines 2013-2014

LaTeX:
2011 \begin{notice}{warning}{Warning:}
2012 When you delete a group, all its content and contributions from
users are gone and cannot be retrieved again.
2013 \end{notice}
2014

The error does not occur for .. note::

2. in a list table on the last line (ignoring that the table is too
wide). In HTML output it is the first table at
http://manual.mahara.org/en/latest/blocks/context.html

rST:
.. list-table::
:header-rows: 1

* - Block
- User
- Group
- Institution
- Site
- Dashboard
- Profile
- Group homepage
* - | |externalfeed|
| :ref:`external_feed_block`
- |check|
- |check|
- |check|
- |check|
- |check|
- |check|
- |check|
* - | |externalvideo|
| :ref:`external_video_block`
- |check|
- |check|
- |check|
- |check|
- |check|
- |check|
- |check|
* - | |googleapps|
| :ref:`googleapps_block`
- |check|
- |check|
- |check|
- |check|
- |check|
- |check|
- |check|

LaTeX:
\begin{tabular}{|p{0.119\linewidth}|p{0.119\linewidth}|
p{0.119\linewidth}|p{0.119\linewidth}|p{0.119\linewidth}|
p{0.119\linewidth}|p{0.119\linewidth}|p{0.119\linewidth}|}
\hline
\textbf{
Block
} & \textbf{
User
} & \textbf{
Group
} & \textbf{
Institution
} & \textbf{
Site
} & \textbf{
Dashboard
} & \textbf{
Profile
} & \textbf{
Group homepage
}\\\hline <<= This is the problematic line that
yields the underfull error

Would anyone know what I am doing wrong here?

Thanks and Happy New Year.
Kristina

Guenter Milde

unread,
Jan 1, 2012, 4:21:09 PM1/1/12
to sphin...@googlegroups.com
On 2012-01-01, Kristina Hoeppner wrote:

> I get a number of "Underfull \hbox (badness 10000) in paragraph at
> lines..." warning when I generate a LaTeX PDF in Sphinx 1.1.2.

This is just a warning. Have a look at the PDF output on the relevant
line(s) and see if you can just ignore it.

Günter

Kristina D.C. Hoeppner

unread,
Jan 1, 2012, 6:20:23 PM1/1/12
to sphin...@googlegroups.com
Thanks, Günter. It looks like the PDF is generated correctly. I was
just wondering how I can avoid the warning because it seems like there
is something wrong. Otherwise, the warning wouldn't occur, would it?

Cheers
Kristina

Marius Gedminas

unread,
Jan 1, 2012, 9:27:33 PM1/1/12
to sphin...@googlegroups.com
On Mon, Jan 02, 2012 at 12:20:23PM +1300, Kristina D.C. Hoeppner wrote:
> Thanks, Günter. It looks like the PDF is generated correctly. I was
> just wondering how I can avoid the warning because it seems like there
> is something wrong. Otherwise, the warning wouldn't occur, would it?

TeX produces warnings for various aesthetic concerns. IIRC, "underfull
\hbox" means the paragraph had to be wrapped at a point that leaves too
much white space on a line.

You can rewrite it using different words, or you can add hyphenation
hints for the particular long word if TeX was unable to hyphenate it by
itself (no idea how to do that in Sphinx, though, but I'm sure the
excellent docs cover it).

Or you can look at the PDF, decide it is fine, and ignore the warning.

Marius Gedminas
--
There is an almost obvious extension of interfaces that would allow formal
specification of arguments and return values. We suspect it leads to the dark
side.
-- Jim Fulton

signature.asc

Kristina D.C. Hoeppner

unread,
Jan 2, 2012, 1:59:00 AM1/2/12
to sphin...@googlegroups.com
Hello Marius,

Thank you very much for your explanation. It is interesting though
that one of the underfull warnings is only given for "warning" but not
"note". However, as it is just a warning, I'll review them and see if
I can ignore them.

Cheers
Kristina

Stefano David

unread,
Jan 2, 2012, 10:42:09 AM1/2/12
to sphinx-dev
Hi,

On Jan 1, 8:07 am, Kristina Hoeppner <kris.hoepp...@googlemail.com>
wrote:
> Would anyone know what I am doing wrong here?
As Marius said, this is due to "aesthetic reasons". I do not compile a
latex source since a while (basically since I'm using sphinx), but if
you compile the latex by hand and produce a .dvi, try to add a "draft"
option to the \documentclass: In the compiled .dvi, you will see some
small black square near the line/table/figure where an under/overfull
hbox/vbox takes place and see whether if the text causing the warning
should be modified.

Hope this helps!
Cheers, and have a successful 2012!
Stefano

Guenter Milde

unread,
Jan 2, 2012, 4:21:24 PM1/2/12
to sphin...@googlegroups.com
On 2012-01-02, Kristina D.C. Hoeppner wrote:

> Thank you very much for your explanation. It is interesting though
> that one of the underfull warnings is only given for "warning" but not
> "note". However, as it is just a warning, I'll review them and see if
> I can ignore them.

The "underful \hbox warning means that a line is too short
(i.e. not reaching the right margin). This means it very much depends on the
content of the admonition (warning, note, ...) whether this warning occurs.

I suppose you will see this warning with a note too, if you change the notes
content - just play with it (most simply by changing the generated LaTeX
source and re-running latex...).

Of course, a clean solution would be to avoid needless warnings (as they
tend to mask the places where the warnings are sensible). Maybe the
Sphinx-generated LaTeX source is not "clean" and could be improved.

BTW: overfull \hbox warnings might be far more serious: they signify a line
that goes into the margin. Sometimes this is not visible (1 pt or so) but
sometimes (especially with teletype/monospace/literal text) it requires
action.


Günter

Kristina D.C. Hoeppner

unread,
Jan 2, 2012, 4:36:00 PM1/2/12
to sphin...@googlegroups.com
Hello Günter and Stefano,

Thank you very much for your further explanations. I'll try to
remember / read up on how to compile LaTeX by hand (have only done so
once or twice years ago and very much enjoy the ease of use of Sphinx
taking care of everything) to follow your instructions.

I imagined the overfull to be more problematic as I ran into that with
a table an an image (hence the question about the table/cell widths in
another thread) as I saw that the table runs all the way to the
margin.

I prefer the HTML output much better as it seems that I can control it
more easily (probably due to my lack of LaTeX knowledge), but wanted
to tackle and learn more about the background of some of the warning
trying to get rid of them so that real error messages stand out
better.

The Sphinx output when compiling the documentation is very helpful to
spot the more obvious errors or mishaps which have saved me a few
times. :-)

Thank you very much for your help.

Cheers
Kristina

Reply all
Reply to author
Forward
0 new messages