2

It seems in the letter class that CCs don't get split across page breaks. Is there some way to make this happen?

I'm including addresses in the CC, so it can become quite long. and if it doesn't break across pages, it wastes a lot of space.

Alternatives/workarounds also appreciated.

Example follows. The output occupies two pages, with a big gap left on the first page. Commenting out the last two (of four CCs) makes the letter fit on one page.

\documentclass{letter}
\signature{(Someone)}
\address{Street \\ City \\ Country}
\newcommand\drd[1]{#1,\\
The Little House in the Big Garden,\\
Oxenthorpe Road,\\
Puddleby on the Marsh,\\
Slopshire\\
England,\\
UK}
\begin{document}
\begin{letter}{\drd{Dr. John Dolittle}}
\opening{Dear Dr. Dolittle,}
\dots
\closing{Sincerely,}
\cc{\drd{Jip}}
\cc{\drd{Gub-Gub}}
\cc{\drd{Dab-Dab}}
\cc{\drd{Polynesia}}
\end{letter}
\end{document}

NOTE: Thanks to @egreg for the solution. This workaround is not necessary for scrlttr2, which handles breaks in CCs just fine.

1
  • \cc includes its argument in a \parbox.
    – egreg
    Mar 14, 2015 at 10:31

1 Answer 1

4

If you have several \cc commands and you want to allow breaks between them, you have to override the \stopbreaks declaration that's issued by \closing, which disables page breaks.

Since \par comes to mean “end paragraph and issue \nobreak”, adding \penalty0 after \par is a good remedy.

\documentclass{letter}

\makeatletter
\renewcommand*{\cc}[1]{%
  \par\noindent
  \parbox[t]{\textwidth}{%
    \@hangfrom{\normalfont\ccname: }%
    \ignorespaces #1\strut}\par\penalty\z@
}
\makeatother


\signature{(Someone)}
\address{Street \\ City \\ Country}
\newcommand\drd[1]{#1,\\
The Little House in the Big Garden,\\
Oxenthorpe Road,\\
Puddleby on the Marsh,\\
Slopshire\\
England,\\
UK}
\begin{document}
\begin{letter}{\drd{Dr. John Dolittle}}
\opening{Dear Dr. Dolittle,}
\dots
\closing{Sincerely,}
\cc{\drd{Jip}}
\cc{\drd{Gub-Gub}}
\cc{\drd{Dab-Dab}}
\cc{\drd{Polynesia}}
\end{letter}
\end{document}

Explanation

The \closing command is defined by

\newcommand{\closing}[1]{\par\nobreak\vspace{\parskip}%
  \stopbreaks
  <...irrelevant code omitted...>
  \par}

where \stopbreaks is

\newcommand*{\stopbreaks}{%
  \interlinepenalty\@M
  \def\par{\@@par\nobreak}%
  \let\\\@nobreakcr
  \let\vspace\@nobreakvspace}

which basically means “don't break across pages from this point on”. The definition of \cc is similar to the redefinition above, with just the \penalty\z@ missing, so \par does \@@par\nobreak (where \@@par is the primitive \par) and no page break are allowed. The command \nobreak is a shorthand for \penalty10000.

However, TeX is allowed to break at any penalty in vertical mode, provided the value is less than 10000. So, if we add a “neutral” penalty like \penalty0 after \nobreak, we are allowing a page break.

What's the difference between \penalty0 and \penalty\z@? Almost none, if we're in a context where \makeatletter is in force. The code could have \penalty0 (but no % to mask the end of line); using \z@ avoids any doubt about protecting the line ending or not.

2
  • To be clear, I'm Ok with individual CCs not breaking, I have a group of CCs, and they appear to not be breaking as a group. I'll give an example. Mar 14, 2015 at 10:50
  • @FaheemMitha Here you find the solution.
    – egreg
    Mar 14, 2015 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.