I wondered how I can add a pagebreak before a section, sub-section, or sub-sub-section heading only in case the previous page has less than x% of the horizontal space available yet? E.g. don’t begin a new (sub)section below the middle of a page but rather move it to the next one.