Is there a way to force hyphenation even when it would generate overfull hboxes? I read here (texfaq.org) that when tex can't find a resolution that doesn't overfill the line, it just gives up with a warning. I have many situations in my document where a word hangs over the line, but it could be hyphenated to hang less far over (oftentimes much less far). Explicitly adding hyphenation marks doesn't help, I guess because the line would still be overfull.
Update with example
Ok, I guess this is an ill-formed question because my understanding of the texfaq article must have been incorrect. I'll explain what I think is happening in case either
- someone else makes the same mistake I did, or
- someone can correct my further misunderstanding(s).
Here's an example showing that tex does indeed hyphenate even when hboxes would be overfull. (I don't know if it matters that I'm using the cleveref package, but I am so I included it.)
Note: The explicit settings of textwidth and hyphenation are just for the purposes of this example.
\documentclass[draft]{amsbook}
\textwidth=49mm
\usepackage[english]{babel}
\usepackage[capitalise]{cleveref}
\newtheorem{corollary}{Corollary}
\hyphenation{corol-lary}
\begin{document}
\noindent
aaaaaaaaaaaaaaaaaaaaaaaaaa \cref{testcor}.
\begin{corollary}\label{testcor}
a a a a a a a a a a a a a a
\end{corollary}
\setcounter{corollary}{999}
\noindent
aaaaaaaaaaaaaaaaaaaaa \cref{testcor-b}.
\begin{corollary}\label{testcor-b}
a a a a a a a a a a a a a a
\end{corollary}
\end{document}
The output looks like this:
In the line referring to Corollary 1, there is hyphenation even though the hbox is overfull. In the line referring to Corollary 1000, no hyphenation occurs because it's too close to the end of the word. Furthermore, tex doesn't separate the number 1000 from the word, and that is the desired behavior.
I don't actually have 1000 corollaries in my document, but I do have numbers like 3.4.21 to refer to corollary 21 of section 4 of chapter 3. Looking again, most of my long overfull hboxes are because the numbers are so long. I suppose there's nothing to be done about that other than \sloppy
(or changing \tolerance
some other way) or rewording.
\sloppy
\sloppy
since (I think) that's even more distracting.sloppypar
environment limits the scope of the sloppiness, and is actually almost unnoticeable when applied sparingly.sloppypar
, because the choice of which paragraphs need it will probably change with the publisher's margins. (And also there are a lot of paragraphs.) But I did add someemergencystretch
, which sounds like it's kind of the same thing. (maybe?) Anemergencystretch
of 10pt reduced the number of overfull hboxes in one chapter from 16 (with three of them overfull by more than 20pt) to 4 (with 13pt the largest), so that seems quite a bit better.