[Tex/LaTex] Is there really no better solution to “Overfull \hbox” than adding a line break

errorsline-breakingwrap

I am going through a rather long book to resolve the Overfull \hbox problem. Here is an example:

varies greatly from organization to organization, team to team, and
manager to manager. Innovation is exceptional only because so many <<<<this too long
organizations fail to act on and to capture the benefit of good ideas.

The word "many" can not be hyphenated, and it reports the line is 0.77357pt too wide — such a small amount. I really just want it to wrap this to the next line – the word is not a big one, and the additional white space would be trivial. The documentation (http://www.tex.ac.uk/cgi-bin/texfaq2html?label=overfull) says to add a line feed, like this:

varies greatly from organization to organization, team to team, and
manager to manager. Innovation is exceptional only because so \linebreak
many organizations fail to act on and to capture the benefit of good ideas.

By putting a hard line break in there, it wraps it down. But later, if I edit the paragraph in front of that work, it may no longer need the line break, but the hard line break will cause it to do so anyway. If the paragraph changes so that this is no longer on the very right edge of the line, then I will not want a linebreak at that point. What do I do?

Isn't there a way to say "wrap this word down if it will cause an overflow, but include it normally otherwise" ????

The word "many" is not really a long word. I don't mind specially marking individual words in particular situations, but using \linebreak permanently causes a line break there, whether I need it or not. I would like it to do a line break ONLY if there is an overflow situation.

Another solution is to increase \pretolerance value. How do I know what that value is now? I need to know this so that I can set it to a slightly higher value. Is there a way to increase it by 10%. A word like "many" is not an exceptionally long work, and I have lots and lots of these problems. I would like it to automatically handle these cases.

UPDATE

Here is a MWE showing the problem:

\documentclass[paper=6in:9in,10pt,twoside,pagesize=pdftex,openright,headings=twolinechapter,chapterprefix=true]{scrbook}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{xcolor}
\usepackage{makeidx}
\makeindex
\voffset=0in
\topmargin = 0in
\headheight = 12pt
\headsep = 25pt
\textheight = 7in
\footskip = 30pt
\hoffset=0in
\marginparwidth = 0pt
\marginparsep = 0pt
\textwidth = 4.5in
\oddsidemargin = 0pt
\marginparpush = 0pt
\usepackage[inner=0.75in,outer=0.75in,top=1.0in, bottom=1.0in, footnotesep=.4in]{geometry}
\usepackage{fontspec}
\fontspec{Alegreya Sans SC Light}
\fontspec{Palatino Linotype}
\setmainfont[Ligatures={Common,TeX}, Numbers={OldStyle}]{Palatino Linotype}
\linespread{1.05}         % Palatino needs more leading (space between lines)
\addtokomafont{footnote}{\footnotesize\sffamily}
\deffootnote{1.5em}{1em}{% modified example from page 83
  \makebox[1.5em][l]{\textsuperscript{\thefootnotemark}}}
\renewcommand*\chapterheadstartvskip{\vspace*{.1\textheight}}
\renewcommand*\chapterheadendvskip{\vspace*{.1\textheight}}
\addtokomafont{chapter}{\fontspec{Alegreya Sans SC Light}}
\addtokomafont{chapterprefix}{\fontspec{Alegreya Sans SC Light}\Huge}
\addtokomafont{chapterprefix}{\raggedleft}
\renewcommand*{\chapterformat}{%
   \mbox{\scalebox{1}{\chapappifchapterprefix{\nobreakspace}}%
   \scalebox{4}{\color{gray}\thechapter}\enskip}}
\pdfpagewidth=\paperwidth
\pdfpageheight=\paperheight
\begin{document}
\frontmatter
\title{Innovation Management Challenge}
\author{Keith D Swenson, Jim Farris}
\date{\today}
\maketitle
\tableofcontents
\mainmatter
\chapter{Innovation Management Challenge}
\section{Innovators}
\begin{itemize}
\item Innovation Everywhere - Surprisingly, innovation is both exceptional and commonplace.  Good ideas are the product of intelligence, and all people at all levels are intelligent.  The ability to act on good ideas varies greatly from organization to organization, team to team, and manager to manager.   Innovation is exceptional only because so many organizations fail to act on and to capture the benefit of good ideas.
\end{itemize}
\end{document}

Searching for overfull \hbox recommendations, most of the examples are about hyphenating words. If it was a hyphenation problem, I could manually put the \- in the desired place and force a hyphenation. This example is unusual because the word many is only 4 letters and would never be split. It is short. The whole word needs to go to the next line. For this reason \hyphenate{} and \- can not do anything.

I tried using \sloppy which works (meaning the word is wrapped down and the paragraph in question looks fine), but created a lot of disgust among the onlookers saying that this simply 'should not be done'.

There was a suggestion to try \linebreak[3] which apparently means this is a kind of linebreak that does not always break, but the rule behind exactly when and why it breaks are not clear. Does it only break if the work following it is sticking a fraction of a point into the margin? I did not try it because is not clear at all the this will break when I want it to, and not break when the word fits.

I tried \usepackage{microtype} and it had no effect … the word many remained at the end of the line and overflowing the hbox.

I tried \setlength{\emergencystretch}{2pt} and this works fine. Apparently emergency stretch is 0 by default. When an overfull situation is encountered, if emergency stretch is larger than 0, then it relaxes the requirements on that line, and allows the wrapping down of a slightly larger word. This is probably the best solution, but I still am curious why a small word like "many" needs such special handling in the first place.

I was told about \begin{sloppypar} and \end{sloppypar} which you put around the paragraph so that the entire document is no subject to the sloppy formatting. That is at least a way to do point solutions when nothing else seems to be working.

I got a long reply about changing the way that the printable area is determined. Good advice, but does not address the fundamental question of why a short word like "many" is not being wrapped down to the next line, when it extends .78 points into the margin.

Seems to me that the wrapping algorithm is simply wrong. Some say it may be a font problem, but does anyone know how to prove this? How do I get the current values of the settings that drive the word wrapping algorithm, in order to show that a critical value is too small (smaller than the length of the word "many")

Best Answer

There are many better solutions. Some short sugestions for a start.

  1. More characters in a line is one of the simplest solutions. You should have 60 characters in a line as the starting point. More than, say, 70 can deeply improve the appearance of a paragraph.

  2. If you can tolerate occasional too long spaces, \sloppy solves most of the problems. \sloppy means \tolerance 9999 \emergencystretch 3em\relax, hence really ugly paragraphs could be accepted. Hence it is rather for local usage, e.g. to a fixed paragraph.

  3. If you can use pdftex, not the original TeX engine, package microtype is a very good solution.

Related Question