Andrea Valle
26. Mai 2016 um 10:56
Dear all, 

I’m finishing a book, and getting the following undesired result.
Many times I have section or subsection title at the bottom of a page, with no text. Text starts on the next page.
I have looked at 

http://wiki.contextgarden.net/Widows_and_orphans_control

but I wasn’t able to solve.

I guess it could depend on the formatting of my headlines. Here they are: 

\setuphead[section]
[style=\ss\tfa, before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black,
rulethickness=0.01cm, frame=off, topframe=off,  bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}]

\setuphead[subsection]
[style=\ss, before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black,
rulethickness=0.01cm, frame=off, topframe=off,  bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}]
Your lack of a working minimal example makes it hard to give a solution
but adding changing the way how the frame is added should improve things.

\startsetups[section:andrea]
    \ifconditional\headshownumber
        \scratchdimenone\dimexpr\headnumberwidth+\headnumberdistance\relax
        \scratchdimentwo\dimexpr\headnumberdistance\relax
    \else
        \scratchdimenone\zeropoint
        \scratchdimentwo\zeropoint
    \fi
    \startframedtext[offset=0.25cm,loffset=\scratchdimenone,rulethickness=0.01cm,frame=off,bottomframe=on]
        \dontleavehmode\llap{\headnumbercontent\hskip\scratchdimentwo}
        \headtextcontent
    \stopframedtext
\stopsetups

\defineheadalternative[section:andrea][alternative=vertical,renderingsetup=section:andrea]

\setuphead
  [section]
  [alternative=section:andrea,
   numberwidth=1em,
        before={\blank[0.5cm]},
         after={\blank[1cm]}]

\starttext

\section{\input ward }

\subject{\input ward }

\stoptext

Wolfgang