I have a simple document layout with a main heading for the title, and the possibility of starting the first sectional unit (with a standard \section command) right after the title -- meaning, with no preliminary typeset text --, or after some introductory text following the title.
I'd like to change the vertical skip that the \section command adds before the title of the sectional unit depending on whether there is some introductory text or not. Generally, I use the titlesec package facilities in this context, but I'm not committed to any package in particular. My issue boils down to defining some test for the existence of that preliminary text before the sectional unit. How can I do this? TeX, LaTeX2e or LaTeX3/expl3 solutions would all be welcome.