Here is an example to see what I mean:
Code: Select all
\documentclass[11pt,a4paper]{moderncv}
\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\firstname{John}
\familyname{Doe}
% how to cleanly renew this command so that it has most of the properties of a normal
% latex-section (e.g. not leaving a sect.-heading alone on the bottom of a page)?
\makeatletter
\renewcommand*{\section}[1]{%
\vspace*{2.5ex \@plus 1ex \@minus .2ex}%
\phantomsection{}% reset the anchor for hyperrefs
\addcontentsline{toc}{part}{#1}%
\parbox[m]{\hintscolumnwidth}{%
\raggedleft\hintfont{\color{sectionrectanglecolor}\rule{\hintscolumnwidth}{1ex}}%
}%
\hspace{\separatorcolumnwidth}%
\parbox[m]{\maincolumnwidth}{\sectionstyle{#1}}\\[1ex]}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\section{Lipsum}
\lipsum[2-8]
\section{Test}
\lipsum[1]
\end{document}
Does anyone have any clue? Even if I put a \nopagebreak after the \section{Test} it does break the page there.
(Additionally it seems to make a difference whether there is a blank line after the section title or not, as with \section{Lipsum})