(Not a dupe of Is something the first item on a page? and another similar question, because these involve preventing rules at the top of a page by putting them in leaders; but leaders require boxes, and I don't want a box, but simply to issue a header command.)
So I often roll my own sectioning commands, and I'm currently typesetting a volume which has frequent, shorter chapters. As a result, I don't want to start a new page for every chapter, so when I wrote my sectioning command, it simply skips, prints the title, sends the title to the TOC, then skips again to be ready for the text. Normally, these chapters do not begin at the start of a page; so in that case, having the full, normal header is the correct behavior.
Occasionally, however, the chapters do begin at the top of a page, and in those circumstances I'd like to have the equivalent of \thispagestyle{plain} happen. I can't simply put that in the chapter definition, because most of the time the chapters don't start at the top of the page. I only want a plain pagestyle when the chapter falls at the top of the page. MWE:
\documentclass{article}
\usepackage{fancyhdr}
\fancyhead{Header}
\pagestyle{fancy}
\def\newchap#1{%
\vskip 3em plus1em minus0.5em%
\hbox to\linewidth{\LARGE\hfil#1\hfil}%
\vskip 3em plus1em minus0.5em%
}%
\begin{document}
\newchap{New Chapter Here}
\end{document}
Notice that, although the chapter is the first thing on the page, we end up with the full header. (As the code directs.) I'd like to know something I can put in \newchap which, when it's at the top of the page, will issue \thispagestyle{plain}, or something with equivalent functionality.
