[texhax] List of Examples (page break?)

Uwe Lueck uwe.lueck at web.de
Sat Sep 26 18:03:07 CEST 2015

BB> all very well, but is there a way to
BB> avoid a page break when the next bit
BB> after the *heading* is \begin{enumerate}
BB> or one of its kin?

BB> usually, the text of a theorem is
BB> expected to start on the same line as
BB> the *header*, but some authors insist
BB> on starting with a list.  and that
BB> can leave the header by itself at the
BB> bottom of a page.

Somewhat unfair, my conviction has become that 
sections have *headings*, theorems have *headers*
(all stars mine). I violated this rule myself late 
at night in 


but the topic was headings, as in \@afterheading.

Anyway, the theorem example modified:

                            texhax pbrk. thm. env.s (bb/ul)]
%\usepackage{amsthm} %% either ...
    \clubpenalty\@M     %% TODO restored properly?
%% choose from:
%   \@afterheading
%% ... without both, bad spacing (only!)
  \tracingonline=1 \showboxdepth=0 \showboxbreadth=10 
  \iftrue         %% see real-life pagebreak or don't
text at top of page\par
some more text\par
\item xxxx
  \par \showlists
\item yyyy

\@item is very complex, I won't understand all of it soon,
but at some place it uses \clubpenalty \@M too, and at some
other, it restores the normal value by 
    \clubpenalty \@clubpenalty

I can't tell soon whether this happens in time with my trick, 
but something like that is necessary, because \clubpenalty
and \widowpenalty create a possible breakpoint after the 
first line in the example, namely a penalty of their sum
(even with a two-line first item, strangely).



More information about the texhax mailing list