I would like to be able to use an
\if command to check if a
\section appears on the first line of a new page. If a section heading is the first line of a new page, I would like to then adjust some of the spacing between the section heading and the header by modifying
Is there a simple way to do this?
More info (edit): The issue arises whenever you don't forcibly add new pages to separate sections. If you were to write continuously, then, whenever TeX decides to insert a page break, the spacing arguments native to
\section are suppressed iff the page break occurs right before a new section.
Hence, if, for instance, you have long, ruled headers, the lack of spacing looks odd:
As far as I know, TeX doesn't have a built-in counter for line numbering that can be used to check if a heading appears on the first line of a new page. You don't know when a page break is likely to occur, either. Thus, although I have a specific purpose for finding a way to check if something is on the first (or nth line) of a page, it might still help others with different purposes.