I'm somewhat new to LaTeX and have been tasked with satisfying some strict formatting requirements for this LaTeX document using a custom class.
Currently, if there is a long chapter name (within a certain window around 1 line in length), it will show up on one line with the page number "pushed" outside the right margin. This isn't allowed, so how can I wrap these slightly-too-long chapter headings and avoid printing the page number outside the right margin?
I've already tried \setlength{\hfuzz}{0.0pt}
which I read about here but it sounds like that only applies to TeX, not LaTeX. In any case, it didn't work.
EDIT: Here is an example that illustrates the problem. The class I'm using/writing is based on report, and report has exactly the same problem, viewable to all in the following document:
\documentclass{report}
\begin{document}
\tableofcontents
\chapter{xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx 1234567890}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\chapter{xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx 1234567890}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\chapter{xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx12345}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\end{document}
When generated (with pdflatex in my case), the table of contents looks like this:
As you can see, the first title is short enough that it is on one line. The second is long enough that it is broken into two lines. The third, however, is somewhere in between and only pushes the page number (4) outside the margins. The first and second page numbers are correctly within the margins.
Given the strict margin requirements for these documents, I need the third title to break, probably with a hyphen, within the margin. I've seen this done, and in that case it broke right before where the page numbers are printed normall.
\hfuzz
is a TeX primitive so it absolutely applies to LaTeX. It's just irrelevant here. It controls the amount a box may be overfull before TeX reports it as such. – TH. Oct 20 '10 at 4:47