[Tex/LaTex] KOMA-Script scrreprt: How to change chapter appearance and produce a chapter based Mini TOC

chapterskoma-scriptsectioningtable of contents

This post is a 3 part question with which I would need help. The questions are all associated with chapter styling and subsections within the \documentclass{scrreprt}. I am sure I could work them out eventually, I come to you for guidance to learn and save a bit of time.

Intro

I am a fledgling LaTeXer, I have already used LaTeX to produce simple reports for which I wasn't too fussed about the formatting. Now I am writing a PhD thesis and I would like it to look the way I choose.

Desired Result

The result I would like to achieve for my chapters is roughly as shown in the below image.
The essential elements I would like to implement in my document are:

  • Chapter first page look as below with Chapter Title not having a number
  • Possibility of adding a quote before the Chapter Title. (probably not hard)
  • Mini ToC for each chapter
  • More than the \subsection level of sectioning that will be included in the ToC.

Thesis Desired Output Concept

Question 1: Subsections

I have been reading around on the site and saw that there were solutions suggested to this matter with the scrreprt class such as in the post scrreprt – add levels below \subparagraph; I have read that the titlesec package is very customisable, however I have also read it would disable/interfere with some of the KOMA-script macros (I don't know exactly which). What would be best to implement in my case to achieve my desired look?

Question 2: Setting up the chapter look and style

Based on the answer to question 1, could you help explain how I would set it up please?

Question 3: Mini ToC and quote

Could you please advise how you would go about adding a quote between the Chapter No. and Title (I might not for every chapter).
I imagine that to make a mini chapter confined ToC would simply require a package, or maybe there is already a functionality in scrreprt?

MWE Update 10/02/2014

Sorry again for not having this sooner, here is my MWE of the thesis setup. I included the title page I use and the Dedication and Abstract sections which are fine the way they are for now.

I have implemented what @Crissov suggested but unfortunately I cannot get the minitoc to generate or the chapter format to match the one presented in his MWE which does work until implemented in my case. Due to his code working alone, but not once I implemented it into mine, I included what I realise is a bit of a bulky MWE, but the mistake I am making must be somewhere in there.

\documentclass[
DIV=11,
twoside,
headinclude=false,
titlepage=firstiscover,
abstract=true,
headsepline=true,
footsepline=true,
%headings=big
]{scrreprt}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=3cm]{geometry} %typearea has that nasty problem of double bottom margin so had to remove it
\usepackage{setspace}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{minitoc} 

\linespread{1.5}
\flushbottom

\iffalse % don’t use titlesec.sty with KOMA script classes
\usepackage{titlesec}
%% \titleformat{⟨command⟩}[⟨shape⟩]{⟨format⟩}{⟨label⟩}{⟨sep⟩}{⟨before⟩}[⟨after⟩]
\titleformat{name=\chapter}[display]
{\usekomafont{chapter}}
{\raggedleft\chaptertitlename\ {\textcolor{gray}{\fontsize{60}    {65}\selectfont\thechapter}}}
{20pt}{}[\minitoc]
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ToC DEPTH LEVEL
\setcounter{secnumdepth}{3} % number subsubsection
\setcounter{tocdepth}{3} % list subsubsection


\addtokomafont{chapterprefix}{\raggedleft}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PREFACE AND BODY STYLING
\def\preface{
    \pagenumbering{roman}
    \doublespacing
}

\def\body{
    \cleardoublepage
    \dominitoc
    \tableofcontents
    \linespread{1.5} %Clear double spacing from preface
    \pagenumbering{arabic}
    \pagestyle{headings}
}

\def\abstract{
    \begin{center}{
        \large\bf Abstract}
    \end{center}
    \normalsize
    \linespread{1.5}
    }{\cleardoublepage}
\def\endabstract{
  \par
}

\newenvironment{acknowledgements}{
   \cleardoublepage
    \begin{center}{
        \large \bf Acknowledgements}
    \end{center}
    \normalsize
    \linespread{1.5}
    }{\cleardoublepage}
\def\endacknowledgements{
  \par
}

\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TITLE PAGE
\titlehead{
    \Large \centering University of London \\
}
\subject{Department of Materials \\
}
\title{My PhD Thesis Title}
\author{Edoardo}
\date{
    \vskip 1cm
    \normalsize Submitted \\
    \Large 2014 \\
    \vskip 2cm
    \normalsize Supervisors: \\
    \Large Jim Bob \\
    John Doe \\
    \vskip 2cm
    \normalsize Submitted in part fulfilment of the requirements for the degree of \\
    Doctor of Philosophy in Materials
}

\dedication{Dedication here}
\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PREFACE
\preface
\addcontentsline{toc}{chapter}{Abstract}
\begin{abstract}

In this study we did a lot of things

\end{abstract}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ToC ToF ToT
\body
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTERS
\chapter{Introduction}

\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}

\minitoc % should be put here automatically


\section{Test of depth}

We are delving deeper into the unknown.


\subsection{Publications}

Many publications here.

\subsubsection{Text Mass}
Here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text

\end{document}

I have however found out that there is a way to put a quote (if desired) just after the chapter using the {after} part of the command line for \titleformat as follows:

\titleformat{name=\chapter}[display]
  {\usekomafont{chapter}}
  {\raggedleft\chaptertitlename\ {\textcolor{gray}{\fontsize{60}{65}\selectfont\thechapter}}}
  {20pt}{\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}}

All I'd need to workout is how to link that specific \dictum section for each chapter to a part I can write just after \chapter{chapter} I suppose…

Best Answer

Partial answer, because I was lately trying something similar. Updated with @speravir’s suggestions and two ugly solutions of putting \dictum between prefixed chapter number and chapter title.

\documentclass[
  headings=big,
  chapterprefix=true%% like in standard class "report"
]{scrreprt}
%\usepackage[T1]{fontenc}%% pdflatex
\usepackage{fontspec}%% xelatex
\usepackage{xcolor}
\usepackage{graphicx}

%% partial TOCs after chapter title
\usepackage[]{minitoc}
\setcounter{secnumdepth}{3} % number subsubsections
\setcounter{tocdepth}{3} % list subsubsections
\mtcsetdepth{minitoc}{2}% ~ \setcounter{minitocdepth}{2}
\mtcsetfont{minitoc}{*}{\usekomafont{chapterentry}}
\mtcsetfont{minitoc}{section}{\usekomafont{chapterentry}\bfseries} 
\mtcsetfont{minitoc}{subsection}{\usekomafont{chapterentry}} 
\mtcsettitle{minitoc}{\relax}% remove “Contents”
\mtcsetoffset{minitoc}{-3.5em}% don’t know the appropriate length
\mtcsetrules{minitoc}{off}
\mtcsetpagenumbers{minitoc}{on}% default anyway
%\mtcsetfeature{minitoc}{before|after|open|close|pagestyle}{command} 

%% layout of chapter title by @Speravir
\addtokomafont{chapterprefix}{\raggedleft}
\renewcommand*{\chapterformat}{%
\mbox{\chapappifchapterprefix{\nobreakspace}%
\scalebox{5}{\color{gray}\thechapter\autodot}\enskip}%
}

%% put dictum between chapter number (with prefix) and title
%% \setdictum[⟨source⟩]{⟨quote⟩} -- before \chapter
\iftrue % change to \iffalse to test different approach
%% hacky approach
\newcommand\getdictum{\relax}
\newcommand\setdictum[2][]{\renewcommand\getdictum{\dictum[#1]{#2}}}
\usepackage{etoolbox}
\makeatletter
%% \patchcmd{⟨command⟩}{⟨search⟩}{⟨replace⟩}{⟨success⟩}{⟨failure⟩}
\patchcmd{\@@makechapterhead}{\size@chapterprefix{}}{\size@chapterprefix{}{\vskip 1em\getdictum}}{}{}
\makeatother
\else
% 
\newcommand\setdictum[2][]{%
  \setchapterpreamble[ol][0.5\textwidth]{\vskip 5em\dictum[#1]{#2}}%
}
\fi

\begin{document}
\dominitoc
\faketableofcontents

\setcounter{chapter}{6}\setcounter{page}{199}

\setdictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}
\chapter{Conclusions}

\minitoc

\section{Summary of Achievements}
Text goes here
\newpage\setcounter{page}{212}
\subsection{Papers Submitted}
\subsubsection{I want to go into the TOC}
\end{document}
Related Question