Regarding the following two examples my question is: Is it a bug or is it a feature (or do I miss something)?
\documentclass{scrbook}
\usepackage{xcolor}
% \addtokomafont{sectioning}{\color{green}}
\addtokomafont{chapter}{\color{green}}
\addtokomafont{section}{\color{green}}
\addtokomafont{subsection}{\color{green}}
\addtokomafont{subsubsection}{\color{green}}
\setlength{\textheight}{13\baselineskip}
\begin{document}
\chapter{test}
AAA
\section{test}
\subsection{subtest}
AAA
\end{document}
Please compare the results [sorry, I can not upload images] of the examples.
\documentclass{scrbook}
\usepackage{xcolor}
\addtokomafont{sectioning}{\color{green}}
% \addtokomafont{chapter}{\color{green}}
% \addtokomafont{section}{\color{green}}
% \addtokomafont{subsection}{\color{green}}
% \addtokomafont{subsubsection}{\color{green}}
\setlength{\textheight}{13\baselineskip}
\begin{document}
\chapter{test}
AAA
\section{test}
\subsection{subtest}
AAA
\end{document}
The former one shows a page break between \section and \subsection.


\colorin vertical mode, which is always dangerous. The two examples differ in when the color change is performed. – egreg Mar 17 '17 at 07:21\addtokomafont{sectioning}and\addtokomafont{section}and so on. – Jürgen Mar 17 '17 at 07:30\leavevmodeWe already have a similar question. – Johannes_B Mar 17 '17 at 07:42\sectionand\subsection. But with version 3.20 I can reproduce the described behavior. See also http://tex.stackexchange.com/q/314235/43317 and http://www.komascript.de/release3.20 (German). – esdd Mar 17 '17 at 07:48