I want to avoid displayed formulas at the top of pages in ConTeXt (in fact, my big document has several displayed formulas on top of pages), and I have read this answer on the subject.
Thus, I played with \predisplaypenalty, which by default is set to 0 in ConTexT. I used the following code:
\predisplaypenalty=10000
\starttext
\dorecurse{3}{\input knuth\par}
\input knuth text without a new paragraph
\startformula
\exp(x)=\sum_{k=0}^{+\infty}\frac{x^k}{k!}.
\stopformula
Still we have \tex{predisplaypenalty} set to \the\predisplaypenalty
\stoptext
The top of page 2 looks like this:
In the source, predisplaypenalty is mentioned in some files, for example in strc-mat.mkiv where it is set to \zerocount. In syst-pln.mkiv, which is a module setting "a couple of variables to the Plain TeX values" it is set to 10000, but that is probably overwritten (if read) in strc-mat.mkiv.
Question What is the correct way to avoid displayed formulas on top of pages in ConTeXt?
Just to clarify, you can assume that I use the latest standalone version of ConTeXt.
Update I changed the code so that there is no paragraph break before the formula. This was not the problem.


\parbefore the start of\startformula? LaTeX does the same thing. – daleif Aug 30 '17 at 09:38