17

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...

Fiztban
  • 2,071
  • 1
    Welcome to TeX.sx! Regarding the quotes see http://tex.stackexchange.com/questions/53377/inspirational-quote-at-start-of-chapter/53450#53450 – cgnieder Feb 09 '14 at 17:21
  • 2
    Please provide a MWE to show your effort.. – subham soni Feb 09 '14 at 17:21
  • 1
    See: http://tex.stackexchange.com/questions/142022/how-can-i-add-a-list-of-sections-within-a-chapter-at-the-start-of-every-chapter/142025#142025 – Marco Daniel Feb 09 '14 at 17:38
  • @cgnieder Thank you for the post I will try and implement that.

    @subhamsoni I am working on trying to make a MWE for me to play around with; I am currently working from the Imperial College Thesis template that can be found in ShareLatex.com, I guess I am doing a little bit of reverse engineering. I will post an MWE when I have one working, currently I have issues with the way in which the preface is set (the template uses the report class I am trying to use scrreprt).

    @MarcoDaniel Thank you for the post I will try and implement it as soon as I have it all sort of working :)

    – Fiztban Feb 09 '14 at 18:03
  • 1
    @Fiztban You should generally ask separate questions in separate question postings. Here, questions 1 & 2 belong together in my opinion, and so could be asked together. Question 3 is probably asked in KOMA-Script (scrbook): onecolumn table of contents & minitoc in twocolumn document and scrwfile removes partial Toc created with titletoc. If not, make an edit and refer to them, what does not fit. – Speravir Feb 09 '14 at 21:39
  • @MarcoDaniel: This answer does use report. With recent KOMA-Script version one will get a warning, when one uses titesec and titletoc. For the latter see also this comment: scrwfile removes partial Toc created with titletoc. – Speravir Feb 09 '14 at 21:42
  • 1
    @Fiztban And for the chapter quote there exists a command \dictum. I used this in KOMA-Script (scrbook): onecolumn table of contents & minitoc in twocolumn document togehter with a minitoc. – Speravir Feb 09 '14 at 21:48
  • @cfr Thank you for your reply, our university has a recommended style but it will not turn down an adequately formatted and legible style. I do wish to do this both for personal use and for my thesis. @Speravir Thanks, I do realise it would have been easier but it felt like they were reasonably close but in future I will do so. Thank you also for the heads up on the \dictum command, I am slowly making my way through the KOMA-script manual to find my adequate format/layout, I think the hardest part will be the titles. I will post an MWE tomorrow to see how far I have reached. – Fiztban Feb 09 '14 at 22:59
  • 2
  • 1
    Another hint: When you load setspace then use its facilities. You do not need \linespread and you’ve set it BTW quite probably to a wrong value, cf. Why is the linespread factor as it is?. – Speravir Feb 11 '14 at 17:50
  • @Speravir sorry for missing your intent to help within these comments, I am just now realising how much better setspace is and your comment here has helped in the understanding, for what its worth thank you for trying to help me across my different questions trying to point out the better nature of setspace. – Fiztban Jan 29 '15 at 14:05

2 Answers2

15

In addition to Crissov’s answer:

I used his MWE and redefined (below \addtokomafont{chapterprefix} – it’s generally useful to keep definitions for the same topic as far as possible together) the command \chapterformat (the original definition is shown in documentation). I added a color change definition and a \scalebox from graphicx:

\renewcommand*{\chapterformat}{%
\mbox{\chapappifchapterprefix{\nobreakspace}%
\scalebox{3}{\color{gray}\thechapter\autodot}\enskip}}

I also loaded fontenc just to get rid of a font warning. All together:

\documentclass[
headings=big,
chapterprefix=true% like in standard class "report"
]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{minitoc}
\setcounter{secnumdepth}{3} % number subsubsections
\setcounter{tocdepth}{3} % list subsubsections

\addtokomafont{chapterprefix}{\raggedleft}

\renewcommand*{\chapterformat}{%
\mbox{\chapappifchapterprefix{\nobreakspace}%
\scalebox{3}{\color{gray}\thechapter\autodot}\enskip}}

\begin{document}
\dominitoc
\tableofcontents

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

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

\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}

The output looks this way:

Screenshot of example

Speravir
  • 19,491
  • You're a wizard! I will begin learning this, was reading your minitoc reply here, but I will wrap my head around this one for the time being. Thank you for all your help thus far! – Fiztban Feb 10 '14 at 23:29
  • Oh yes of course I will do that. Sorry to bother you again, would you please post the entire code, I can't quite make out where you added the renewcommand. – Fiztban Feb 10 '14 at 23:41
  • Oh how silly of me, forgot to load the graphicx package thank you so so much, now all that is left is getting it to work with my code for the minitoc. Speravir I wish you many good things! Thank you – Fiztban Feb 11 '14 at 00:00
  • @Speravir, why should Fiztban accept my partial answer (which is hardly the MWE he should have provided), when yours is so much closer to the desired result? – Crissov Feb 11 '14 at 10:02
  • @Crissov: Because you made the effort of building the MWE (and even improved it meanwhile); because you deserve the points … :-) – Speravir Feb 11 '14 at 17:27
  • @Speravir @Crissov I want to add a little note I discovered with our solution, it is possible to scale also the Chapter word by adding another \scalebox. However if one does not remove the \autodot command, when one adds a \part{part} section it will automatically produce a dot after the chapter number, but removing it does remove the dot in that case, so I implemented it as follows: \renewcommand*{\chapterformat}{% \mbox{\scalebox{1.5}{\chapappifchapterprefix{\nobreakspace}}% \scalebox{4}{\color{gray}\thechapter}\enskip}} – Fiztban Feb 11 '14 at 17:47
9

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}
Crissov
  • 1,866
  • @Crissov Oh my that is a brilliant start! I will try and integrate this into my MWE. Much appreciated! – Fiztban Feb 10 '14 at 15:06
  • @Crissov I have added an MWE to my original post, I didn't have much luck achieving the desired effect when I implemented your code, would you be able to have a look through what I have done and see if you can spot the mistake I must have done. Thank you – Fiztban Feb 10 '14 at 15:56
  • 1
    A remark as comment, that you’ve used \setcounters just for the example, would be better in my eyes. For an experienced user this is obvious, but … – Speravir Feb 10 '14 at 22:16
  • @Speravir Thank you for the concern, but that I worked out quickest out of all the commands :D. Right now I am trying to assess whether the titlesec package helps or rather disrupts the KOMA-script macros fiven this post – Fiztban Feb 10 '14 at 22:56
  • @Fiztban: You, Crissov and me are not the only ones who can read this. :-) For titlesec: You must find out by trial & error, which functions work and which don’t. And it can happen, that functions working now will not in a future KOMA-Script release (recently happened, as can re read in one of the questions linked in comments below your question). – Speravir Feb 10 '14 at 23:29
  • @Speravir That is true, you live and you learn, no two ways around it especially considering latex has a rather steep learning curve. I will simply have to make a post if I run into trouble and work it out for future help. Take a little give back a little. – Fiztban Feb 10 '14 at 23:47
  • @Fiztban: Another hint: According to this short German forum thread Paket titlesec und \dictum aus KOMA-Script (accidently reread in my older answer you linked an hour ago) you can replace KOMA-Script’s \dictum with a command or environmet from package epigraph, that is supposed to work together with titlesec. – Speravir Feb 11 '14 at 00:30