When entering a page in normal typesetting mode, Context
- is in vertical mode, and
- will gobble all skips that follow immediately so as to align the top
of the first line of the text body appropriately.
For this reason, inserting a vertical skip has no effect at the top of
a page.
To work around this behavior you need to force TeX into horizontal
mode, which you can do by
- inserting horizontal material, for instance a strut, or
- terminating vertical mode explicitly, which is usually done by means
of the
\dontleavehmode
directive (the Context synonym for the
\quitvmode
primitive), or alternatively the lesser known
\leavevmode
[0].
The idiomatic solution would look like this:
\starttext
\dontleavehmode \vfill
foo
\vfill
\stoptext

Thus, if you intend to vertically center a page without using makeups,
you could define an environment as follows (thanks to /u/Aditya for the
suggestion):
\definestartstop [centeredpage] [
before=\dontleavehmode \vfill,
after=\vfill,
]
\starttext
\startcenteredpage
foo
\stopcenteredpage
\stoptext
On a related note, what you are asking for can actually be achieved
conveniently by tweaking the
options to \setupmakeup
.
The key settings are pagestate
whose value is passed to an
implicit \setuppagenumber
, as well as headerstate
and
footerstate
that govern the behavior of running heads and footers,
respectively.
To make headers and footers appear on the makeup, and to prevent the
page numbering from ignoring that page, these options need to be set to
start (they default to stop).
For example:
\definemakeup [centeredpage]
\setupmakeup [centeredpage] [
pagestate=start,
top=\vfill,
bottom=\vfill,
headerstate=start,
footerstate=start,
page=yes,
]
\setupheadertexts [dummy header]
\setupfootertexts [dummy footer] [{\getnumber [userpage]}]
\starttext
text on page before
\startcenteredpagemakeup
\input ward
\stopcenteredpagemakeup
text on page after
\stoptext

[0] For a discussion of \leavevmode
vs. \dontleavehmode
/
\quitvmode
see
this post by Taco on the Pdftex list.
\dontleavehmode \vfill foo bar \vfill
.