10

I can't figure out how to get rid of the "underfull" and "overfull" warnings using the silence package (I am able to use it to hide some other warnings, but not these). What should be the correct syntax? Currently, this is what I have in my prologue:

\usepackage{silence}
\WarningFilter{latex}{Underfull}
\WarningFilter{latex}{Overfull}
\WarningFilter{latex}{Text page}
\WarningFilter{pdfcolmk}{Nothing to fix}

But I still get warnings like the following:

Underfull \hbox (badness 4940) in paragraph at lines 150--170
Overfull \hbox (3.50006pt too wide) in paragraph at lines 196--197
Underfull \vbox (badness 3690) has occurred while \output is active []
Underfull \vbox (badness 10000) has occurred while \output is active []
Underfull \vbox (badness 3039) has occurred while \output is active []
Underfull \hbox (badness 5490) in paragraph at lines 222--2
Underfull \vbox (badness 3039) has occurred while \output is active []
Underfull \vbox (badness 10000) has occurred while \output is active []

thanks, Jorge.

8
  • 2
    Patient, you are ill. Nah, i don't care. You shoud never ignore warnings or errors.
    – Johannes_B
    Jun 4, 2018 at 4:49
  • 4
    you can put \hbadness=10000 \vbadness=10000 but then of course only use the docuemnt for checking the log file for syntax errors, don't bother looking at the pdf as it's likely to be horrible those warnings mean that something is very wrong with the page breaking in that document. Jun 4, 2018 at 6:44
  • 2
    @DavidCarlisle Sometimes, though, you know that the output is OK and you can't get rid of the warning (or you don't know how to get rid of the warning). For you, getting rid of them is always easy, but that's often not true for mere mortals. I regularly compile documents in which I mentally ignore such warnings. If I knew how to get rid of them without changing the output, I would, but I don't, so I can't.
    – cfr
    Jun 5, 2018 at 1:04
  • What I do is learn for that document that I should be getting, say, 3 bad boxes. If I get 4, I know to look. Otherwise, I assume it's OK. Converted documents are worst; Beamer is probably second; then the rest.
    – cfr
    Jun 5, 2018 at 1:05
  • 1
    @cfr for the finite warnings, perhaps, but badness 10000 is infinitely bad, Tex just gave up at that point and dumped whatever it had to hand as a page with no attempt to adjust the space reasonably. Either the output is really bad, or it is Ok and you intended space there but the markup is wrong, either way I would never ignore such a warning. Jun 5, 2018 at 6:35

4 Answers 4

8

The over/underfull box warnings are from TeX - not LaTeX. As silence's manual notes,

TeX’s messages are left untouched. (p. 1)

You can tell they aren't LaTeX warnings because LaTeX tells you when it is the source of the warning.

LaTeX Warning: Float too large for page by 1056.17519pt on input line 28.

[The effect of putting 10 paragraphs of Kant's first critique (in translation) into a float.]

In contrast, TeX warnings don't say this.

Overfull \hbox (0.79013pt too wide) in paragraph at lines 25--25
5
  • Oh, I see! So these warnings cannot be "silenced" in any other way (other package, method, etc.)?
    – dontpanic
    Jun 4, 2018 at 2:53
  • 2
    @dontpanic I'm sure they could be silenced. The question would be what you'd have to do to silence them. I don't know whether that would be doable or whether it would mean rewriting parts of TeX's output routine, say, which would not really be doable for most of us. But they can't be silenced with the slience package. I've added an explanation for how you can tell it is not a LaTeX warning.
    – cfr
    Jun 4, 2018 at 3:09
  • 3
    @dontpanic Think very carefully about whether you really want to silence these warnings, especially for overfull boxes. These are the same warnings you get when, say, only 0.005% of the included PNG fits on your paper or when that crucial URL spills into empty space off the right edge. Generally, those you don't need can be eliminated and that's a better approach. (Though I find this is never 100% doable in Beamer, I admit.)
    – cfr
    Jun 4, 2018 at 3:12
  • 5
    The reason I want to silence them so badly is because I'd like to focus in fixing any other warnings that appear as I create/edit my document: being able to have zero warnings under normal conditions makes it easy to notice when things break, and where/why. Once I've finished this 1st stage, I'd like to remove the silencing to solve other lesser warnings like underfull/overfull. But I guess I'll need to live with these for the time being!
    – dontpanic
    Jun 4, 2018 at 3:21
  • 1
    @dontpanic Fair enough. Sorry that I don't know how you can do that. You could try asking a new question i.e. given that silence can't do this, how can it be done? Link this question for background.
    – cfr
    Jun 5, 2018 at 1:01
2

The silence package can't do it as others have said. But if what you want to do is focus on other warnings first, the easiest way is to look at the .log file:

grep -v Underfull my-document.log

The .log file is created by TeX when run and contains a copy of all the output that it had printed to the terminal. In fact you can run latex my-document.tex >/dev/null to suppress output to the terminal and just look at the .log file. This may be useful for example if TeX'ing several documents in parallel using make -j (I have a setup that does this when producing several different formats of a large document on a multi-core machine, and if one of the latex processes stops on error while others keep going, it's very difficult to figure out the terminal output, so I just rely on .log files).

2
  • Thanks for your advice, Silas. Unfortunately, I have no choice but to work in a Windows environment. But I have learned to live with these warnings :)
    – dontpanic
    Aug 11, 2018 at 22:40
  • Perhaps you can use Cygwin? Or at least Grep for Windows (with >nul instead of >/dev/null on the TeX command line)? Aug 13, 2018 at 7:23
1

Had the same issue as OP, I do not want to be bothered with underfull/overfull warnings during drafting. What worked for me is to put the following in the preamble:

\hfuzz=1000pt
\tolerance=20000
\hbadness=19999

Source and explanation: https://www.tug.org/TUGboat/tb14-2/tb39taylor-para.pdf

1

You can use the Linebreaker package with LuaLaTeX to fix the overfull and underfull boxes. It tries to re-typeset the bad paragraphs until they are gone. The interword spaces in these paragraphs can be a bit larger. Still, they will stay normal in other paragraphs, as opposed to when you use \sloppy or global increases of \tollerance and other parameters.

The following example shows default line-breaking on the left and paragraph typeset with Linebreaker on the right.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .