# No page break before a heading, while preserving some vertical space before heading?

How can I prevent a page break before a run-in section heading while preserving vertical spacing before the heading?

Based on the suggestion in How to prevent a page break before an itemize list?, I have defined a run-in heading as

\makeatletter
{2.1ex \@plus1ex \@minus 0.64ex}{-1em}%
{\sffamily\normalsize\bfseries}}
\makeatother


I use this heading in the following way:

..., but the process assignment is still in bijective
correspondence with the proof rules.

\nobreakruninheading*{Cut reduction as computation.}
The principal cut reduction is
\begin{equation*}
\text{several lines of math go here}
\end{equation*}
When annotated according to the process interpretation,
we can extract the process reduction


Indeed, LaTeX does not insert a page break before the run-in heading. However, there is no vertical space between the end of the paragraph (... with the proof rules.) and the run-in heading.

I do know that there is enough room on the page with 1.6ex of vertical space prior to the heading because if I instead define \nobreakruninheading* as \vspace{1.6ex}\noindent{\sffamily\normalsize\bfseries #1}\hspace{1em}, everything fits the way I want. I'd like to avoid resorting to this alternate definition, if possible, because it does not match the other section headings in my paper (which use \@startsection).

-

My feeling is that if you want vertical space before the runin heading, then a page break is good as well.

Anyway, you get what you ask by adding the spacing after \nobreak:

\makeatletter