1

In scrreprt, I want

  1. the word "Chapter" and the chapter number to be in two consecutive lines (achieved)
  2. the word "Chapter" and the chapter number to be indented (achieved)
  3. the word "Chapter" and the chapter number to be in different styles (achieved)
  4. the chapter title to be indented
  5. the chapter title to be in italics

I have achieved 1, 2 and 3 but can't figure out how to get 4 and 5

MWE:

\documentclass[chapterprefix=true]{scrreprt}

\usepackage{lmodern}
\usepackage[english]{babel}

\usepackage{xcolor}
\usepackage{lipsum}

%%%--chapter no. underneath the word "chapter" and in different styles

\renewcommand*{\chapterformat}{%
    \hskip 2cm \mychaptername{\chaptername}\\*\vskip 0.5\baselineskip
    \hskip 2cm \mychapternumber{\thechapter}%
}

\newcommand{\mychaptername}[1]{%
    \usekomafont{chapter}%
    {\color{black}\bfseries\fontsize{20}{20}\selectfont#1}%
}%

\newcommand{\mychapternumber}[1]{%
    \usekomafont{chapter}%
    {\color{blue}\bfseries\fontsize{40}{40}\selectfont#1}%
}%

%%%--chapter title indented and in italics

\renewcommand*{\chapterlinesformat}[3]{%
    \hskip 2cm \mychaptertitle{#3}%
    #2%
}

\newcommand{\mychaptertitle}[1]{%
    \usekomafont{chapter}%
    {\itshape#1}%
}

\begin{document}
    
\chapter{General Introduction}

\lipsum[1]    

\end{document}

enter image description here

1 Answer 1

1

You set option chapterprefix, so you have to redefine \chapterlineswithprefixformat:

\documentclass[chapterprefix=true]{scrreprt}
\usepackage{lmodern}
\usepackage[english]{babel}

\usepackage{xcolor}
\usepackage{lipsum}% only for dummy text

\addtokomafont{chapter}{\itshape}
\addtokomafont{chapterprefix}{\upshape}
\newkomafont{chapternumber}{\usekomafont{chapterprefix}\color{blue}\fontsize{40}{40}\selectfont}

\newlength{\chapterindent}
\setlength{\chapterindent}{2cm}

\renewcommand*{\chapterformat}{%
  \IfUsePrefixLine
    {%
      \hskip\chapterindent\chapapp\\*\vskip 0.5\baselineskip
      \hskip\chapterindent {\usekomafont{chapternumber}\thechapter}%
    }{%
      \thechapter\autodot\enskip
    }%
}

\makeatletter
\renewcommand*{\chapterlineswithprefixformat}[3]{%
  #2%
  \@hangfrom{\hskip \chapterindent}{#3}%
}
\makeatother

\begin{document}
\tableofcontents
\chapter{General Introduction}
\lipsum[1]
\chapter{Long chapter title which fills more than one line}
\lipsum[2]
\end{document}

enter image description here

You must log in to answer this question.

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