2

I would like to get a list of the really bad hbox errors (say 20pt + too wide) in my document. Is there a way to suppress the smaller errors? I have a really large file and looking through the log file otherwise is slightly painful.

I tried \hfuzz=50.002pt but this doesn't seem to work --- it still gives plently of smaller errors e.g.:

Overfull \hbox (5.77747pt too wide)...

Clarification: the file is 20,000 lines long but following the suggestion I started chopping it up to find a minimal counter-example. By doing this I realized that \hfuzz=50pt was called before \documentclass{amsart} and that caused the problem.

David Carlisle
  • 757,742
  • Welcome to TeX.SE! – Mensch Oct 29 '21 at 22:32
  • 20pt isn't a small error though, even .2pt is double the amount that latex normally allows. It would be better to not have the overfull boxes. – David Carlisle Oct 29 '21 at 22:38
  • at the point that you get the warning \hfuzz must be less than 5pt. probably you have executed \fussy (which sets it to .1pt) or \sloppy (which sets it to .5pt) – David Carlisle Oct 29 '21 at 22:39
  • 1
    Questions should almost always have a complete small document that shows the problem, then we wouldn't have to try to guess how to debug unseen code. – David Carlisle Oct 29 '21 at 22:41
  • The point of a document class is to set the defaults for that class of documents so you should expect most settings to be over-ridden if you set them before \documentclass – David Carlisle Oct 30 '21 at 09:41
  • If you do not care about of smaller hboxes, do not worry about the warnings in the log. Just compile in draft mode (e.g.: \documentclass[draft]{article} ) that mark the overfull boxes with a black box in the margin, so you instantly will check where they are and how bad they are. – Fran Oct 30 '21 at 10:43
  • @Fran if you run with hfuzz=50pt then you already have 50pt of overflowing text poking you in the eye, not sure an extra .5pt of overfullboxrule will do much to make them more obvious:-) – David Carlisle Oct 30 '21 at 12:31
  • @DavidCarlisle I suggest the draft mode to check what smaller margin peaks are really noticeable for human beings and not only for the compiler. Obviously, a cut-off off 50pt is not cross the line, but stop the bus four villages too late. – Fran Oct 30 '21 at 19:01
  • The point (in part) is that the paper is 400 pages; so while the offending parts are "obvious" when you look, that algorithm does involve looking at every page. – user255678 Oct 30 '21 at 20:15

1 Answers1

2

You say you want to be warned over 20pt, \hfuzz=50pt would silence everything up to 50pt, so you need

\hfuzz=20pt

Note that the default is .1pt if you allow 20pt without warning it would be better to set the text raggedright rather than just allow unusably bad justification.

However this produces no warnings despite most lines being over 10pt overfull

enter image description here

\documentclass{article}

\hfuzz=20pt \begin{document}

\noindent X\dotfill X

\noindent X\dotfill X

\mbox{This line is wide} \mbox{This line is too wide} \mbox{This line is too wide} \mbox{This line is too wide} \mbox{This line is too wide} \mbox{This line is too wide} \mbox{This line is too wide} \mbox{This line is too wide} \mbox{This line is too wide} \mbox{This line is too wide} \mbox{also wide} \mbox{also wide} \mbox{This line is too wide} \mbox{also wide} \mbox{also wide} \mbox{This line is too wide} \mbox{also wide} \mbox{also wide}

\noindent X\dotfill X

\end{document}

David Carlisle
  • 757,742
  • Sorry, I wasn't so clear: I am still getting notifications of smaller hbox errors and so since there are several hundred of them I can't find the actual monster ones which I want to edit. – user255678 Oct 29 '21 at 22:39
  • 1
    @user255678 then you are re-setting \hfuzz locally, put \showthe\hfuzz in teh source at that point and tex will stop and show you the current value. – David Carlisle Oct 29 '21 at 22:41
  • Thanks that last comment was useful --- I tried to do it and got some errors, but then found that when I moved \hfuzz to a different point in the document (just after the \begin{document} as it happens) it actually worked. – user255678 Oct 30 '21 at 02:08
  • @user255678 then you are using a class that sets this at that point. But I do worry that you would set hfuzz to more than say 1pt, I can't think of any cases where that would lead to a usable outcome. – David Carlisle Oct 30 '21 at 09:36
  • The paper is going to be typeset by a publisher who will also be using their house style file which I don't have access to. But there are a number of really quite bad formula that I wanted to "fix" first because they are complicated enough that someone fixing them might mess things up, whereas the 5pt errors in text elsewhere may disappear in the new stylefile and are more easily fixed by a copyeditor – user255678 Oct 30 '21 at 20:13
  • @user255678 I'll let you off then (perhaps:-) – David Carlisle Oct 30 '21 at 20:36
  • I mean, if you think that 5pt errors are bad, I should admit I still have an "Overfull \hbox (111.84375pt too wide) in alignment at lines 10088--10092" which you probably wouldn't approve of and I'm not sure how to fix it. – user255678 Oct 31 '21 at 19:57
  • 111pt overfull is quite likely off the page or overprinting the next column depending on the layout. But of course you have given no example or indication of your layout or document markup. But if it is something like a latex package manual I'd let the odd overfull line go through but in a published paper or a thesis or any document where you actually care about the typesetting I wouldn't allow any overfull box. there is no point in specifying justified text with straight left and right margins, then allowing text to stick out by 10pt and certainly not 111pt @user255678 – David Carlisle Oct 31 '21 at 23:28
  • Thanks! I asked another question with one of the most offensive examples which I'm trying to fix (https://tex.stackexchange.com/questions/620858/suggestions-for-fitting-commutative-diagram-onto-page) – user255678 Nov 01 '21 at 03:25