In the following MWE, \clubpenalty has the expected default value of 150 at the begin of the document. However, a combination of a) a \section b) a paragraph c) a quote environment – in this particular sequence – will result in a \clubpenalty of 10000 (i.e. no orphans are allowed from this point forward). Leaving out any of these three elements will produce the expected value of 150 for \clubpenalty. Why is this the case?



Clubpenalty: \the\clubpenalty\ (should be 150)

% Removing either a) the \section or b) the paragraph following it
%     or c) the "quote" environment following it will produce
%     the expected value of 150 for \clubpenalty
\section{A section}

Some text.

Some text inside a \texttt{quote} environment.

Clubpenalty: \the\clubpenalty\ (should be 150)

  • I'm the one that reported that bug. I discovered it while typesetting something using the mwart class (which is derived from article); I thought it is a mwart-specific bug. Marcin Woliński, who is the author of mwart, sent me a patch then; if nothing else works, I'll look into it and post it here (but I don't have too much time for that, so I can't do it now and don't want to do it unless someone really needs it). – mbork Jul 16 '11 at 21:40
  • It would be nice to see that patch. – egreg Aug 31 '11 at 14:32

I found that this hack seems to work, at least if the problematic environment is based on list:

  • The definition of \@item includes the code snippet \if@nobreak \@nobreakfalse \clubpenalty \@M \else \clubpenalty \@clubpenalty \everypar{}% \fi. According to source2e, "[t]his code is intended to prevent a page break after the first line of an item that comes immediately after a section title". I don't know if this feature is affected by your "hack", but the latter is good enough for me. – lockstep Jul 15 '11 at 15:27
  • 2
    The hack will set the \clubpenalty after the list environment (because of \aftergroup); that code in \@item will only set the \clubpenalty inside the list environment, which is good, but the group ending will make TeX forget it. – egreg Jul 15 '11 at 15:38

I would say it is a bug. It also already reported (but neither analyzed nor solved): http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/4065

Rougly I would say that the problem is that in a list (quote is list) the \item doesn't start a paragraph and so the everypar trickery of the list and the section clash.

  • 3
    I've reminded the other members of the LaTeX3 Project about this. I avoid doing LaTeX2e bug fixes (much too complex!), but perhaps someone else will feel more inclined to take a look. – Joseph Wright Jul 15 '11 at 8:42
  • 1
    A fix for this problem was added 2015 to the LaTeX kernel (late but eventually it happened) – Frank Mittelbach Feb 8 '16 at 21:07

Sorry for the delay. Since my previous answer was converted into a comment, and AFAIK I can't include TeX code in comments, I paste Marcin Woliński's patch I mentioned here (I don't have time to analyze it now, just pasting it):


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.