# Persistent Underfull \hbox Warning

I can't fix this no matter how I set the parameters \pretolerance, \tolerance, and \emergencystretch.

Minimum Working Example with downloadable font using xelatex:

\documentclass[10pt,twoside]{book}
\usepackage[paperwidth=5.5in,paperheight=8.75in,left=1in,top=1in,right=0.75in,bottom=1in]{geometry}
\usepackage{fontspec}
\setmainfont{sorts_mill_goudy.otf}
\usepackage{fix-cm}
\usepackage{microtype}
\tolerance=2000
\emergencystretch=1in

\begin{document}

Vivamus est quam, maximus vulputate felis a, fringilla scelerisque sapien.

\vspace{2em}
\clearpage

\end{document}


Warning:

Underfull \hbox (badness 3503) in paragraph at lines 12--13
[]\EU1/sorts_mill_goudy.otf(0)/m/n/10 Vivamus est quam, maximus vulputate felis
a, fringilla


Nothing I try will eliminate this warning except masking it with \hbadness. In my real-life case, by changing \pretolerance or \tolerance in either direction I can produce more warnings, but there are several persistent ones like this. Increasing \emergencystretch has no effect.

I've read all of the following, and still have no clue what else to try:

It's definitely unlikely to occur... I had to try some 20 paragraphs of generated lorem ipsum before I could reproduce this without using my exact real-life text.

However, if there are just rare combinations of text that are impossible to typeset without errors, why does my project have 3 of them in 11,000 words while the last one I did has 0 in 60,000?

And above all, why doesn't increasing \emergencystretch satisfy it?

I feel frustrated and confused here, and strongly relate to the use of "black art" to describe this part of LaTeX (What's the difference between \tolerance and \badness ?).

Of course you are hyphenating mock latin with English hyphenation rules which doesn't help.

\emergencystretch adds (effective) extra stretch to help the line breaking but so that you know this emergency action has been taken, TeX still gives the original badness warning. So adding to this parameter makes the output look better but without curing the intrinsic badness calculation for the paragraph.

unrelated but you probably don't want fix-cm with xelatex (you are not using cm at all but even if you don't specify a font fontspec defaults to latin modern)

I don't have your font but here is one using latin modern with badness 2080

\documentclass[10pt,twoside]{book}
\usepackage[paperwidth=5.5in,paperheight=8.75in,left=1in,top=1in,right=0.75in,bottom=1in]{geometry}
\usepackage{fontspec}
%\setmainfont{sorts_mill_goudy.otf}
\usepackage{fix-cm}
\usepackage{microtype}
\tolerance=2000
\emergencystretch=1in

\begin{document}

Vius est quam, maximus vulputate felis a, fringilla scelerisque sapien.

\vspace{2em}
\clearpage

\end{document}


The problem here is basically that TeX can't hyphenate scelerisque so it's better to fix that rather than distort the spacing

Vius est quam, maximus vulputate felis a, fringilla scel\-er\-is\-que sapien.

• Of course, the mock Latin is only illustrative; my real case is English and hyphenation doesn't help. So changing \emergencystretch can under no circumstances possibly effect warning output? It's great to know it's working properly ... I guess I just need to increase \hbadness then? – Quartz Nov 26 '15 at 2:15
• I neglected to strip the fix-cm from my MWE, but it does seem to address warnings in my real example. I'm still pretty ignorant about its purpose and function TBH. – Quartz Nov 26 '15 at 2:34
• @Quartz if hyphenation doesn't help then something is wrong. Look at your bad lines why is tex needing to stretch them so much? It must either be that the next word (or inline image or something) can not break as in the example here, or you have set \parfillskip so it does not stretch enough to fill the last, short, line of the paragraph. – David Carlisle Nov 26 '15 at 7:57
• I haven't touched \parfillskip and can't seem to learn what it does. Just that it's something to the last line of the paragraph, but in my real case the offending line is the 1st of 5. It's only a badness of 1038, and it actually looks fine. Is it possible that it's just a better fit than the hyphenation would allow? – Quartz Nov 27 '15 at 15:56
• @Quartz the thing to look at is the first word on the next line, why didn't that split to push a few letters back on to the previous line so it wasn't so underful. despite your comment that hyphenation doesn't help, I still assume hyphenation (or lack of it) is the issue here. – David Carlisle Nov 27 '15 at 16:01