0

Im quite new to LaTex but i am willing to learn how to style my own Thesis instead of just copy and paste some code from a template.

Now im facing a problem. I would like to style my thesis similar to that example:

CleanThesis Template example page

Sure, the CleanThesis Template can do that, but i dont really want to include all the other code which i maybe dont neeed at all.

Therefore i would like to ask you, how i can implement the red marked behaviour. In CleanThesis the big "Section" Numbers are in fact Chapter numbers. Since my thesis is based on the "article" class i dont have chapters at all. Is it also possible to style the main "sections"

\section{some Section}

according to my example? Or is it only possible for Chapters?

Thank you :)

Edit 1: It is also important for me to learn how to put the subsection number (here 2.1) beneath or "outside" of the textblock

Edit 2:

Now i have changed my class to scrreprt to include koma script. Then i added the following:

\definecolor{chaptercolor}{rgb}{0.36,0.73,0.82}

\setkomafont{chapter}{\normalfont\color{chaptercolor}\Huge}
\setkomafont{chapterprefix}{\Large}
\renewcommand*{\raggedchapter}{\raggedleft}
\renewcommand*{\chapterformat}{%
    \MakeUppercase{\chapappifchapterprefix{}}%
    \rlap{\enskip\resizebox{!}{2.2cm}{\thechapter} \rule{1.5mm}{4cm} }%
}

\RedeclareSectionCommand[beforeskip=8mm,afterskip=10mm]{chapter}
\renewcommand*\chapterheadmidvskip{\par\nobreak\vspace{10pt}}

With the above code i got this:

enter image description here

How can i make the Text that it floats to left and define its margin from the chapter number? and how can i change the position of the line to the left side of the number?

Thanks

  • I beg your pardon, but the report class does have chapters. This being said, you should take a look at the titlesec package for a custom formatting of section titles. – Bernard May 17 at 9:10
  • yes, you are right. i meant the article class... Thanks, i will take a look at it. Is it also usefull to add the mentioned footer line beneath the page number? And can it also be used to put the section number beneath the text? – C. Hediger May 17 at 9:17
  • Do you mean the section number also in the footer? – Bernard May 17 at 9:21
  • No in the footer in only want the page number but with a blue line. – C. Hediger May 17 at 9:47
  • Where, then, ‘the section number beneath the text’? – Bernard May 17 at 10:29
0

Here is a suggestion using KOMA-Script class scrreprt (onesided, without chapterprefix, section titles all left aligned) as mentioned in your "Edit 2" in the question:

\documentclass[paper=letter,DIV=11,
  %twoside=true,open=right% if the document should be twosided
]{scrreprt}
\usepackage{blindtext}% only for dummy text
\usepackage{lmodern}% scalable font

\usepackage{xcolor}
\definecolor{chaptercolor}{rgb}{0.36,0.73,0.82}

\colorlet{ctcolorchapterline}{chaptercolor}
\colorlet{ctcolorchapternum}{chaptercolor}
\colorlet{ctcolorfooterline}{chaptercolor}
\colorlet{ctsectiontitles}{chaptercolor}

\usepackage{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\cfoot*{}
\ofoot*{}

\AddLayersToPageStyle{scrheadings}{pagenumber.odd,pagenumber.even}
\AddLayersToPageStyle{plain.scrheadings}{pagenumber.odd,pagenumber.even}
\DeclareNewLayer[
  foreground,
  oddpage,
  foot,
  contents={%
    \hfill
    \makebox[0pt][l]{%
      \pagenumberrule
      \hspace*{10pt}%
      \pagemark
    }%
  }
]{pagenumber.odd}
\DeclareNewLayer[
  clone=pagenumber.odd,
  evenpage,
  contents={%
    \makebox[0pt][r]{%
      \pagemark
      \hspace*{10pt}%
      \pagenumberrule
    }%
  }
]{pagenumber.even}
\newcommand*\pagenumberrule{%
  {\color{ctcolorfooterline}\rule[\dimexpr-10cm+\ht\strutbox\relax]{1.25pt}{10cm}}%
}
\addtokomafont{pagenumber}{\usekomafont{disposition}}

\makeatletter
\renewcommand\chapterlinesformat[3]{%
  \ifstr{#1}{chapter}
    {%
      \parbox[b][\ht\strutbox]{\textwidth}{%
        \parbox[b]{\dimexpr\textwidth-3em\relax}{\raggedright#3}%
        \makebox[3em][r]{%
          \hfill
          #2%
        }%
      }%
    }{\@hangfrom{#2}{#3}}% <- original definition for other levels
}
\makeatother
\renewcommand\chapterformat{%
  \textcolor{ctcolorchapterline}{\rule[-5pt]{2pt}{10cm}}%
  \quad
  {\fontsize{60}{60}\selectfont\textcolor{ctcolorchapternum}{\thechapter}}%
}

\renewcommand*\sectionlinesformat[4]{%
  \makebox[0pt][r]{#3}{\textcolor{ctsectiontitles}{#4}}%
}

\begin{document}
\tableofcontents
\chapter{Chapter with short title}
\Blindtext[2]
\chapter{A test chapter with a long title that will span two lines}
\Blindtext
\blinddocument
\end{document}

Result:

enter image description here

enter image description here

  • Wow! Thank you so much! works perfectly – C. Hediger May 17 at 13:11
  • how can i change the fontstyle from normal to thin or to bold for the chapter number, section and chapter title? – C. Hediger May 17 at 16:19
  • By default they are all bold. If they all should not be bold, add \addtokomafont{disposition}{\mdseries}. Please read the KOMA-Scirpt documentation: \addtokomafont, \setkomafont, ... – esdd May 17 at 22:48

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.