3

I am trying to have a conditional page break for a section if there is not enough space in the bottom. To be clear, when an new section starts I want to check if there is enough space (25% of the text height) to start a new section. If there is not enough space then I want to start the new section in a new page. I am trying to use needspace with classicthesis style. Still no change in the output. Here is the relevant part of the code

\usepackage{needspace}
\newcommand*{\conditionalBreak}{%
    \Needspace{5\baselineskip}
    \noindent\section%
}
\begin{document}
\frenchspacing
\raggedbottom
\selectlanguage{american}
\pagenumbering{roman}
\pagestyle{plain}

1 Answers1

3

The titlesec package already does that as an option: write in your preamble:

\usepackage[nobottomtitles*]{titlesec}
\renewcommand{\bottomtitlespace}{0.25\textheight}

If the remaining vertical space on the page is less than 25% of the text height, the page will be raged bottom, and the title will be moved to the next page. See details § 3.3, Spacing related tools, of the documentation.

Bernard
  • 271,350