\NeedsTeXFormat{LaTeX2e} \ProvidesPackage{paketrazmak}[2026/09/22 Section space configuration package] \RequirePackage{etoolbox} \RequirePackage{needspace} % Define the default space fraction (0.5 \textheight) \newcommand{\sectionspace@fraction}{0.5} % Allow setting the fraction via package option (e.g., \usepackage[0.35]{paketrazmak}) \DeclareOption*{% \let\sectionspace@fraction\CurrentOption } \ProcessOptions\relax % Command to change the fraction later in the document \newcommand{\setsectionspace}[1]{% \renewcommand{\sectionspace@fraction}{#1}% } % Prepend the \Needspace command to \section \pretocmd{\section}{\Needspace{\sectionspace@fraction\textheight}}{}{} \endinput