r/LaTeX•
ThatBLChap

Is there a way to just remove Underfull and Overfull warnings?

Unanswered

I don't seem to actually get any value from them as the line numbers don't seem to relate to anything at all. Is there a command I can use to just remove these from the output messages because they just seem to obscure the useful error messages?

Posted Oct 1, 2018, 9:39 AM UTC

922
Firebrazer•

Usually they're not critical, but they definitely still affect the layout of the document. They're usually worth fixing, and actually require minimal effort once you get the hang of it. How useful the linenumbers are will usually depend on how "well" your .tex file is structured.

8
michal_h21•

These messages are not obscure at all, they mean that there may be an issue in your output, especially words that overflow from the text area. See this article from Philip Taylor for some advice how to fix these issues.

4
ThatBLChapOP•

Actually, this literally made me laugh out loud. About 90% of my hbox issues are in tables, which is making it exceptionally difficult to trace. In the article, if the problem lies in tables or formulae, then Philip Taylor offers this advice: "The problem lies outside the scope of this paper! Consider setting the offending table in a smaller font, reducing \tabskip, etc. Ask the author if the unsplittable formula could, in fact, be split. Apply your own heuristics to the task, and re-join this procedure from step 7 when you have resolved the difficulty."

3
Frogs_in_space•

If you put draft mode on, It'll show bad boxes with a black bar on the side of your document

3
ThatBLChapOP•

So it only seems to do that in straight text - it highlights tons of hbox issues in tables that I just cannot seem to find (and I have a lot of tables).

3
Frogs_in_space•

Oh yeah, tables, bane of my existence. I personally like the tabu package, I've found making tables to a fraction textwidth helps with the bad boxes most of the time.

Thanks, bot

1

Hey, Frogs_in_space, just a quick heads-up:
existance is actually spelled existence. You can remember it by ends with -ence.
Have a nice day!

^^^^The ^^^^parent ^^^^commenter ^^^^can ^^^^reply ^^^^with ^^^^'delete' ^^^^to ^^^^delete ^^^^this ^^^^comment.

2
[deleted]•

[removed]

1
Frogs_in_space•

delete

1
ThatBLChapOP•

Indeed. I actually just asked my supervisor if it is appropriate to do tables in word, screenshot them, and add them as figures. I am pretty certain it would be substantially faster.

Although tabu may actually be a solution, at 165 pages in, adding or changing packages at this point is... risky.

2
Frogs_in_space•

I remember there being some sort of online table generator for LaTeX, though I can't remember a link. Maybe give that a shot? Bast of luck!

3
Firebrazer•

Using screenshots will likely cause issues in printing/publishing, however. It also means text in tables won't be searchable.

2
MrSrsen•

I'm using:

xelatex -interaction=nonstopmode -output-directory "./build/" "./project.tex"  | grep -A 2 "! "

for just critical errors.

2
MrSrsen•

Or if you want my entire build script:

#!/bin/bash

#conf

	# Name of core tex file
	FILE="project"
	# Output directory
	OUT_DIR="./pdf/"

#endconf


cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"


# 1 - ignoring all errors

	printf "\n---[BUILD 1]--------------------------------------------\n\n"
	printf "Ignoring output...\n"
	xelatex -output-directory "${OUT_DIR}" -interaction=nonstopmode "./${FILE}.tex" 1> /dev/null

# 2 - error => outputing in red color
	
	printf "\n---[BUILD 2]--------------------------------------------\n"
	printf "\nErrors:\n\n"
	printf "\033[1;31m"
	xelatex -interaction=nonstopmode -output-directory "${OUT_DIR}" "./${FILE}.tex"  | grep -A 2 "! "
	printf "\033[0m"

# Deleting trash – logs and tmp files

	printf "\n---[DELETING TRASH]-------------------------------------\n\n"

	function delete_trash_file {
		F_ADDR="${OUT_DIR}${1}.${2}"
		printf "Deleting: ${F_ADDR}\n"
		rm "${F_ADDR}"
	}

	delete_trash_file ${FILE} "aux"
	delete_trash_file ${FILE} "out"
	delete_trash_file ${FILE} "log"
	delete_trash_file ${FILE} "toc"
	delete_trash_file "texput" "log"

printf "\nFINISHED :).\n\n"

2
ThatBLChapOP•

My God,

I thought I was the only one. I cannot believe it is this much work for something so simple. Thank you very much for sharing, I will see if I can get the above to work on my side (I am on Windows using TexMaker).

1
IntermittentSteam•

I mean, the thing that is “so simple” is to ignore that the typesetting engine is failing to typeset your text following the rules you've given it to follow (line lengths, margins, allowable stretch, hyphenation, etc.). That's a pretty critical failure right at the root of the tool.

Instead of doing all this work to hide these messages, it would probably be better to figure why you're getting ones that you don't actually care about.

5
ThatBLChapOP•

Although in principle I hear you, this is basically wrecking my ability to write. I have a ton of tables in the document as I have a lot of data, and at the moment the hbox issues don't seem to actually show up as errors on the pdf, but in order to actually find them I have to go cell by cell through each and every table to try and find where the half a millimeter is that seems to be breaking the hbox rule. I have spent a solid 4 days on my 150 days document, and I have gained nothing in the overall output - just less warnings. I don't see how this contributes in any way shape or form to the concept of writing down things - it is just fighting with the tool.

If the hbox overfull or underfull error actually meant something, then I would absolutely go hunt them down, but for example, in one chapter I have this:

Underfull \hbox (badness 1221) in paragraph at lines 524--527 Underfull \hbox (badness 1072) in paragraph at lines 352--356 Underfull \hbox (badness 1087) in paragraph at lines 165--168

The first two end up in tables with 7 columns and 6 columns respectively, and the third ends up on a figure. When I remove the offending figure from the code completely, then the error stays on the same line number, meaning it is from somewhere else. on the first two, the range of line numbers it gives me means I need to check 30 cells, but I need to do them one by one, removing things, and then re-adding them to see where exactly in the line it breaks - all of this without the actual output document not displaying any differently.

I would love to fix all of them, but there is just too many ways in which this specific warning can be created to debug it effectively. It is like having 165 pages of code and having your compiler output "there appears to be an error in your code somewhere in either a function or a class or something - go fix it and try again".

1
bdkrqdln•

/usepackage{microtype}

1