# Chapter title under chapter number in KOMA class

Using the scrbook class, how do I place the chapter title under the chapter number? Here's a MWE

\documentclass{scrbook}
\usepackage{xcolor, graphicx}
\usepackage[showframe]{geometry}

\definecolor{chaptergrey}{rgb}{0.7,0.7,0.7}

\let\raggedchapter\raggedleft
\setkomafont{chapter}{\LARGE}

\renewcommand*{\chapterformat}{%
\scalebox{5}{\color{chaptergrey}\thechapter}%
}
\begin{document}
\chapter{A chapter}
\end{document}


The corresponding output is

And what I'd like to have is something like this

Once I can do that, how do I change the vertical space between the two?

EDIT:

\documentclass[chapterprefix]{scrbook}
\usepackage{xcolor, graphicx}
\definecolor{chaptergrey}{rgb}{0.7,0.7,0.7}

\let\raggedchapter\raggedleft
\setkomafont{chapter}{\LARGE}

\renewcommand*{\chapterformat}{%
\scalebox{5}{\color{chaptergrey}\thechapter}%
}

%\makeatletter
%\renewcommand{\@chapapp}{}
%\makeatother

\usepackage{fancyhdr}

\fancypagestyle{theorems}{
\renewcommand{\chaptermark}[1]{\markboth{##1}{}}
\fancyfoot{}}

\pagestyle{theorems}
\begin{document}
\tableofcontents
\chapter{A chapter}
\newpage
a
\end{document}


• Please note: \usepage[showframe]{geometry} changed the size of the text area and margins. If you don't want this, you should either use \usepackage{showframe} instead of loading geometry or add option pass. – Schweinebacke Mar 24 at 15:28
• Usage of fancyhdr together with a KOMA-Script class is not recommended. It needs extra user work to not break several features of KOMA-Script (e.g. to respect \chaptermarkformat). See the warning message of KOMA-Script. – Schweinebacke Mar 24 at 15:35
• Got it. Should I open another post asking how to create that heading with a KOMA-Script class or do you have a quick fix? – noibe Mar 24 at 15:37
• Use scrlayer-scrpage as recommended by the warning in the log-file. – Schweinebacke Mar 24 at 15:44
• Thanks for the help, I posted a new question as I'm having a few issues with scrlayer-scrpage package. – noibe Mar 24 at 16:08

You can use option chapterprefix if you want a chapter heading with a prefix line, that has only the formatted number:

\documentclass[chapterprefix]{scrbook}
\usepackage{xcolor, graphicx}
\usepackage[showframe]{geometry}

\definecolor{chaptergrey}{rgb}{0.7,0.7,0.7}

\let\raggedchapter\raggedleft
\setkomafont{chapter}{\LARGE}

\renewcommand*{\chapterformat}{%
\scalebox{5}{\color{chaptergrey}\thechapter}%
}
\renewcommand*{\chaptermarkformat}{\thechapter\autodot\enskip}% If you don't want the chapter name in the running head.
\begin{document}
\chapter{A chapter}
\end{document}


There are already examples for similar chapter headings like:

Please avoid using fancyhdr with KOMA-Script classes. As the warning message tells you, using fancyhdr breaks several features of KOMA-Script classes. Use scrlayer-scrpage instead. If you want running head aligned to the inner margin and page numbers aligned to the outer margins and if the chapter titles in the running head should be without chapter numbers, you can use:

\renewcommand*{\chaptermarkformat}{}% If you want running heads without
% chapter number.

\usepackage[automark]{scrlayer-scrpage}
\clearpairofpagestyles
\ihead*{\pagemark}% page number also on plain pages

• I have the same version. I found a workaround through \makeatletter\renewcommand{\@chapapp}{}\makeatother – noibe Mar 24 at 15:28
• @noibe After the shown redefinition of \chapterformat KOMA-Script cannot produce the output you are talking about. And redefining \@chapapp would not remove the space. So you are doing something you are not telling us. And note, \appendix would again redefine \@chapapp. – Schweinebacke Mar 24 at 15:30