[Tex/LaTex] Persistent Underfull \hbox Warning

line-breaking

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:

  1. how to suppress "Underfull \vbox (badness 10000) … while \output is active"?
  2. What are underfull hboxes and vboxes and how can I get rid of them?
  3. http://www.tex.ac.uk/FAQ-overfull.html

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 ?).

Best Answer

3503 isn't so bad.

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

enter image description here

\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

enter image description here

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