To me, LaTeX too much prefers overfull to underfull by default. What's the parameter to shift this preference toward underfull?
For my current draft, I was surprised that I needed to go to \linebreak[4] to avoid an overfull line with a protrusion into the the right margin by ~5% of linewidth, and I was even more surprised that the resultant underfull line after the insertion of \linebreak[4] didn't look bad at all: You wouldn't have even noticed that it was underfull by LaTeX's standards.
The line in question starts a paragraph and includes nothing special (no math) except for a \cref and a longish "word" at the end that I don't want to break. I use the standard article class.
On the other hand, if you look at MS Word, you can see that it prefers underfull very much and produces ugly lines like
Interword spaces are too much
blah blah blah blah . . . . . . . . . blah
Perhaps this is too much but still more acceptable than a 5% protrusion into the margin. So, I want to move LaTeX somewhat in this direction.
I still have a lot more overfull lines with much less protrusion but I don't have any underfull lines. I still want warnings. I just want to shift the preference somewhat toward underfull.
Edit: Thanks to @David Carlisle's answer, I've arrived at a "partial solution": I've just added these two lines
\tolerance 1000%
\emergencystretch 3em%
to my preamble. The problematic line is no longer overfull and has become (without \linebreak) a justified line with somewhat wider spacing than normal. The result is much better than the original overfull line, where the spacing was so narrow as to affect the legibility a bit and with the egregious protrusion into the right margin. I looked over the entire document but didn't find any egregious underfull lines.
So, my conclusion, at least for the type of document I write with the regular article class, is that LaTeX by default is a bit too intolerant to underfull lines.
The remaining problem is that I don't get underfull warnings for the lines which were judged to be overfull in the default settings. I just want be made aware of the potential problem. Probably this is an impossible request?
The lua-typo package, which @rallg kindly pointed out, didn't change the warnings.
\sloppy(as opposed to\fussy). Most authors and journals try to cram as much text as possible into each page. – John Kormylo Jan 25 '24 at 16:35lualatex, then you can use packagelua-typo. Among other things, you can tell it to warn you when lines are underfull by a certain amount. Does not fix anything, merely provides info (better than fixing). So then you can use David's info (below link) to allow more underfull, and havelua-typowarn you when it happens. – rallg Jan 25 '24 at 17:46\pretolerance,\tolerance,\emergencystretch. Of course, you have to understand how TeX calculates the badness of lines and the sum of demerits of the resulting paragraph. – wipet Jan 25 '24 at 18:48\crefand to replicate the problem I'm seeing would either take a lot of trial-and-error or need to include the figure environment referred to by\cref. I just wanted to see whether my original question would be sufficient. I may modify my original posting to include a code when I get more free time – Ryo Jan 26 '24 at 05:10%after1000andemshould better be omitted. It doesn't make a difference here, but in other situations it could. – egreg Jan 26 '24 at 09:13