I have added a splash of colour to my thesis and found it looked quite nice. The theme is: Chapter and Section headings are a dark blue, and the numbering is a brighter blue.

I managed to do this for the \part and \chapter sections in this scrreprt class, however I cannot seem to find a way to use the only apparently available control for other sections being the following: \othersectionlevelsformat{sectioning name}{}{counter output}.

How do I change just the colour of the numbering for \section \subsection, \subsubsection and \paragraph? Would I have to start using the titlesec package?

Please find below my MWE. Thank you

chapterprefix=true, %this allows for editing of the chapter titles
bibliography=totoc,%adds unnumbered Bibliography chapter to toc

%%% Packages
%,bookmarksopen=true,bookmarksopenlevel=4 %This is for the appendix command formulated

\linespread{1.5} %imperial uses 1.5 

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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Entry of TOC LOF LOT
    %%% MINITOC
    % MINITOC styling

    \mtcsettitle{minitoc}{Contents \textcolor{white}{mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmn} Page}

    %%% TOC
    \addtocontents{toc}{~\hfill\textbf{Page}\par} %Adds the word Page

    %%% LOF
    \listoffigures \addcontentsline{toc}{section}{List of Figures}
    \addtocontents{lof}{~\hfill\textbf{Page}\par} %Adds the word Page

    %%% LOT
    \listoftables \addcontentsline{toc}{section}{List of Tables} 
    \addtocontents{lot}{~\hfill\textbf{Page}\par} %Adds the word Page


    \addtokomafont{chapterprefix}{\raggedleft \linespread{1}}






\chapter{First Chapter}
\dictum[Neil deGrasse Tyson]{The good thing about science is that it's true whether or not you believe in it.}


Here is some introduction

\section{Here is a section for the minitoc}
Bla bla.

\subsection{And why not a subsection too}
Just to spice things up a bit.


A little explanation:

As you said in your question, \othersectionlevelsformat is given 3 arguments, so, when you (re)define it, it needs to have 3 arguments, hence the [3]. And the definition only uses the third argument (where the counter is given) so you only need to use #3.

By the way, the examples in pages 97 an 98 of scrguien.pdf are self explaining.

  • Thank you, if it's not too much trouble could you explain a little bit how the command works please? I don't intuitively understand the [3] and {#3} parts. – Fiztban Jul 25 '14 at 11:59
  • 1
    Done, but I really just looked into the documentation. – Manuel Jul 25 '14 at 12:04
  • Ah ok that makes more sense now, well I had read them but I am still rather new to LaTeX and command jargon I didn't realise that that was what inserting those parts meant, I read them but I didn't know how to use them I was writing \othersectionlevelsformat}{section} etc... as it said that \othersectionlevelsformat{sectioning name} in the manual. – Fiztban Jul 25 '14 at 12:14
  • 1
    Aha :) The thing is that KOMA-Script uses that command inside of the sectioning commands, and it uses it in that way: \othersectionlevelsformat{…}{…}{…}. So you needed to redefine it (with three arguments), and make use of them as you wish; in this case only the third one was relevant since it's the one where the counter is given. – Manuel Jul 25 '14 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.