[texhax] Orphan section heads

Uwe Lück uwe.lueck at web.de
Fri Oct 28 11:22:17 CEST 2005

Dear Phil and all involved,

the diagnosis is rather simple. The LTUGproc subsections
are embedded into the following text (the "next skip" is negative).
The authors of \@startsection seem not to have thought of
the possibility that an embedded heading could precede a
paragraph environment. In Standard LaTeX, the same would happen
with \paragraph. The environment is even likely to set a penalty
that overrides the \clupenalty (a general TeX problem).

I don't find good ways out so easily.

In your case I would suggest:
\def \expandafter \verbatim \expandafter{\expandafter
-- This should also prevent the \skip in \@verbatim
from breaking.

One may also try the samepage trick or
\parbox{\columnwidth}, I am not experienced with that.

Best Regards,

At 16:32 24.10.05, Philip TAYLOR wrote:
>Dear Uwe -- the relevant part of the log, as requested,
>as 1435 lines, and is at
>         http://personal.rhul.ac.uk/chaa/006/log.log.txt
>the input was :
>         \tracingmacros = 1
>         \subsection {explanation.cases}
>         \begin{verbatim}
>         0
>         1
>         2
>         \end{verbatim}
>         \tracingmacros = 0
>Note that this is a boundary case; one fewer lines in the
>verbatim text and it is all fitted on the current page.
>Looking at the first few lines of the log, I fear this
>is complicated (and perhaps even caused) by TUGboat's
>intervention : I am therefore cc'ing Barbara, who may
>wish to look at her part of the code ...
>** Phil.
>Uwe Lück wrote:
>>Sorry, sorry, sorry ... those orphan section headings are
>>still a mystery to me, and I haven't found any LaTeX bug
>>as claimed (they are at best "weaknesses", yet LaTeX
>>cares about them). \@startsection, through \@xsect,
>>indeed puts \penalty10000\vskip... to the list (in the vertical
>>case) and immediately following \vskip's aren't possible
>>points to break (TeXbook p. 110). The \write from \label
>>(or \addcontentsline; similarly \mark...) after \@startsection
>>neither enables breaking at a following \vskip -- the latter is
>>preceded by a \nobreak from \protected at write. This is what
>>\@nobreaktrue is for.
>>Phil, you might put \tracingmacros=1 before \subsection and
>>\tracingmacros=0 after \end{verbatim} and send the .log to me.
>>Similarly Michael Barr / Florian Knorn -- it should be possible
>>to delete confidential material from the .log (unless your bugged
>>sectioning macros are confidential).
>>-- Uwe.
>>>I bet I've got it, at least concerning Philip Taylor's sketch
>>>of an example. I see two bugs in LaTeX that might be
>>>responsible or raise the danger of orphan headings.
>>>At 16:12 21.09.05, Philip TAYLOR wrote:
>>>>Hmmm, sadly I can now demonstrate that it
>>>>is only too easy to get an orphaned subsection
>>>>head : this accomplishes it for me, though
>>>>I very much wish that it didn't :-(((
>>>>         \documentclass [final]{ltugproc}
>>>>         \usepackage {graphicx}
>>>>         \hfuzz = 1\jot
>>>>         \overfullrule = 1\jot
>>>>         \hyphenation {legit-imately}
>>>>         \flushbottom
>>>>                 . . .
>>>>         \subsection {byz-data.dat}
>>>>         \begin{verbatim}
>>>>                 . . .

More information about the texhax mailing list