Using ConteXt, how could one prevent a page break between a heading and an image or text + image? For example, given:
\section{With a Chart}
\placefigure[here] {}{\externalfigure[Chart.pdf]}
% or
\section{With a Chart}
\placefigure[right] {}{\externalfigure[Chart.pdf][width=5cm]}
Hello, world ...
The above sequences regularly result in a page break between the section heading.
I noticed a couple related questions, but nothing exactly on this - what I would think as a trivial situation that might have a more straightforward answer than I have seen in the other questions.
\setuphead[setion][before={\testpage[4]}]
which will check if there are at least space for4
lines on the page; if not, it will issue a page break.\setuphead[after={\blank[samepage]}]
or\placefigure[force,here]
or\placefigure[always,here]