1

I've formated my chapter titles with KOMA options to make the chapter number appear above the chapter title. Unfortunately, I couldn't figure out how to let both chapter names start at the same heigth. This picture shows the output of my current MWE. Maybe someone can help me with this problem. Thanks in advance!

enter image description here

\documentclass[
a4paper,
10pt,
listof=totoc,
bibliography=totoc,
twoside,
]{scrreprt}

\usepackage[no-math]{fontspec}
\PassOptionsToPackage{no-math}{fontspec}
\usepackage[showframe]{geometry}
\usepackage{blindtext}
\usepackage{footnotebackref}

\hypersetup{pdfpagelayout=TwoPageRight}
\setlength{\parindent}{0pt}

\KOMAoptions{chapterprefix=true}
\renewcommand{\raggedchapter}{\raggedleft}
\renewcommand{\chapapp}{}
\RedeclareSectionCommand[
    prefixfont = \bfseries\fontsize{50}{52}\selectfont,
    font = \Huge,
    beforeskip = 40pt,
    innerskip = 0pt,
    afterskip = 40pt,
]{chapter}


\begin{document}

\chapter*{Unnumbered Chapter} \addcontentsline{toc}{chapter}{Unnumbered Chapter}
\blindtext
\chapter{Numbered Chapter}
\blindtext

\end{document}

1 Answer 1

2

You can redefine \chapterlineswithprefixformat:

\documentclass[
  %a4paper,% default
  10pt,
  listof=totoc,
  bibliography=totoc,
  twoside
]{scrreprt}

\usepackage[no-math]{fontspec}
\usepackage[showframe]{geometry}
\usepackage{blindtext}
\usepackage{footnotebackref}

\hypersetup{pdfpagelayout=TwoPageRight}
%\setlength{\parindent}{0pt}% use class option parskip=half or parskip=full

\KOMAoptions{chapterprefix=true}
\renewcommand*{\raggedchapter}{\raggedleft}
\renewcommand*{\chapterformat}{\thechapter}
\RedeclareSectionCommand[
    prefixfont = \bfseries\fontsize{50}{52}\selectfont,
    font = \Huge,
    beforeskip = 40pt,
    innerskip = 0pt,
    afterskip = 40pt,
]{chapter}

\makeatletter
\renewcommand*\chapterlineswithprefixformat[3]{%
  \Ifstr{#1}{chapter}
    {\IfArgIsEmpty{#2}
      {{\usekomafont{#1prefix}{%
          \mbox{}%
          \setlength{\@tempskipa}{\csname scr@#1@innerskip\endcsname}\chapterheadmidvskip
        }}#3%
      }% unnumbered chapter headings
      {#2#3}% numbered chapter headings
    }
    {#2#3}% other headings using style=chapter
}
\makeatother

\begin{document}
\addchap{Unnumbered Chapter}% unnumbered chapter with ToC entry
\blindtext
\chapter{Numbered Chapter}
\blindtext
\end{document}

enter image description here

1
  • Thank you for your answer. It works fine. And thanks for the parskip remark :) Oct 12, 2021 at 19:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .