There is a common thing that bothers me about the way ConTeXt makes page breaks : there are things I'd rather not have in first line. For instance, if the following code snippet is found within a longer document
which leads to the result
\startformula
a = b
\stopformula
it may produce an output where the text is the last line of a page and the formula is starting the next page. Another exemple is the way I manage exercises in separate files, which look like
\exercisetitle{My title}
\startmode[questions]
Here are the questions
\stopmode
\startmode[answer]
Here are the answers
\stopmode
I often find the title at the bottom of a page and the beginning of the exercise on the next page, while the page break would be better before the title in order to keep the title and the exercise stuck together. However, I can't simply use a \vbox
, since the exercise may be long and a page break inside the exercise may occur without problems.
I can manage it by hand, but it is quite stupid since the aim of a such a tool is to be free (at least, most of the time) of these minor adjustements. What are the configuration options that I could put in my environment file to regulate this behavior ? I am aware of \page[no]
, but it is not that automated, and sometimes just doesn't work (for instance, I the following MWE works, but I had an exactly similar situation in my real documents where the \page[no]
command didn't work.
\setuppapersize[A5][A5]
\defineitemgroup[questions][levels=2]
\setupitemgroup[questions][1][n,packed]
\setupitemgroup[questions][2][a,packed,repeat][stopper=)]
\starttext
% A bit of text to reach the end of the page
\input knuth
\blank
\input knuth
% The useful part
{\sl My dear fellow TeX users}, I would like to introduce you the following itemize :
\page[no]
\startquestions[columns]
\item one !
\item two !
\item three !
\item four !
\item five !
\item six !
\stopquestions
\stoptext
\blank[samepage]
instead of\page[no]
. The latter only works in vertical mode and will produce no result if applied in horizontal mode (which might happen by accident).autointro
to your options:\setupitemgroup[questions][1][n,packed,autointro]