2

I'm using cleanthesis template and have trouble in to compile since KOMA-script and titlesec are not compatible

Then, the idea would be to "translate" the titlesec section:

\titleformat{\chapter}[display]%
{\usekomafont{chapter}}%
{\vspace{-8em}\raggedleft{%
    {\color{ctcolorchapterline}%
        \rule[-5pt]{2pt}{5cm}}\quad% Line
    {\color{ctcolorchapternum}
        \fontsize{60}{60}\selectfont\thechapter}% Chapter number
    }%
}%
{-2.1em}%
{\ctformatchapter}%
[\phantomsection]

into a KOMA-script one, that I tried:

\renewcommand*{\chapterformat}{%
\vspace{-8em}\raggedleft{%
        {\color{ctcolorchapterline}%
            \rule[-5pt]{2pt}{5cm}}\quad%
        {\color{ctcolorchapternum}
            \fontsize{60}{60}\selectfont \thechapter \autodot\endskip}% Chapter number
        }%
}

What I would like is: enter image description here

What I have: enter image description here

Thank you.

  • I once stood at the exact same point, but I took the other road and switched to book class - so I could keep the titelsec definitions. I did not regret it in the last two or so years. – user36296 Nov 22 '16 at 18:39
  • But why are you asking the same question two times? – user36296 Nov 22 '16 at 18:40
5

The linked cleanthesis package uses KOMA-Script commands. So it should be used with a KOMA-Script class but it breaks many of their features. For example listof=totoc does not work with cleanthesis.

\documentclass{scrbook}[2015/10/03]
\usepackage{lmodern}
\usepackage{xcolor}
\definecolor{ctcolorchapternum}{cmyk}{.48, .05, .91, 0}
\colorlet{ctcolorchapterline}{ctcolorchapternum}

\RedeclareSectionCommand[
    beforeskip=1sp,
    font=\huge\mdseries
]{chapter}

\renewcommand*\chapterformat{%
    \smash{\textcolor{ctcolorchapterline}{\rule[-5pt]{2pt}{10cm}}}%
    \quad
    \textcolor{ctcolorchapternum}{\fontsize{60pt}{60pt}\selectfont\thechapter}%
}%

\renewcommand*\chapterlinesformat[3]{%
    \parbox[t]{\dimexpr\textwidth-2em\relax}{\raggedchapter #3}%
    \hfill
    \makebox[0pt][l]{#2}%
}

\usepackage{blindtext}
\begin{document}
\tableofcontents
\blinddocument
\chapter{This is a really long chapter title, so there is a line break}
\end{document}

enter image description here

enter image description here

Or if you use option b instead t for \parbox:

enter image description here


If you really want to use classicthesis you can add the following code between \usepackage{classicthesis} and \begin{document} in the file thesis-example.tex of your linked example:

\KOMAoptions{chapterprefix=false}
\RedeclareSectionCommand[
    beforeskip=1sp,
    font=\huge\mdseries
]{chapter}

\renewcommand*\chapterformat{%
    \smash{\textcolor{ctcolorchapterline}{\rule[-5pt]{2pt}{10cm}}}%
    \quad
    \textcolor{ctcolorchapternum}{\fontsize{60pt}{60pt}\selectfont\thechapter}%
}

\renewcommand*\chapterlinesformat[3]{%
    \parbox[t]{\dimexpr\textwidth-2em\relax}{\raggedchapter #3}%
    \hfill
    \makebox[0pt][l]{#2}%
}

Note that you also can simple remove chapterprefix=true from the class options instead using \KOMAoptions{chapterprefix=false}.

enter image description here

enter image description here

  • This is the perfect answer to my question. Thank you so much – Leon-Alph Nov 23 '16 at 10:01

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.