2

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
\addtokomafont{disposition}{\normalfont}
\setkomafont{chapter}{\LARGE}

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

The corresponding output is

enter image description here

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

enter image description here

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
\addtokomafont{disposition}{\normalfont}
\setkomafont{chapter}{\LARGE}

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

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

\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}

\fancypagestyle{theorems}{
\renewcommand{\chaptermark}[1]{\markboth{##1}{}}
\fancyhead[LO, RE]{\itshape\nouppercase\leftmark}
\fancyhead[LE, RO]{\thepage}
\fancyfoot{}}

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

Corresponding heading

enter image description here

noibe
  • 2,084
  • 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 '19 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 '19 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 '19 at 15:37
  • Use scrlayer-scrpage as recommended by the warning in the log-file. – Schweinebacke Mar 24 '19 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 '19 at 16:08

1 Answers1

2

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
\addtokomafont{disposition}{\normalfont}
\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}

enter image description here

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
\ohead{\headmark}
Schweinebacke
  • 26,336