Defining sectioning styles

To set sectioning styles and packages, You can use the titlesec package. The sectsty package is also available, but I didn’t use it.

Note: I added line breaks in some of the commands for readability. You need to remove those breaks when using the syntax.

titlesec package

You use titlesec to pro­vid­e an in­ter­face for se­lec­ting from var­i­ous ti­tle styles. With this package, you set marginal ti­tles and change the font of all head­ings with a sin­gle com­mand.

1
\usepackage{titlesec}

Defining the chapter titles

I configured the chapter title to have a 19pt font size.

1
\titleformat{\chapter}{\fontsize{19pt}{0em}\selectfont\bf}{\thechapter.}{1em}{}

I wanted to remove the large space above the chapter title, so I use the following command.

1
\titlespacing*{\chapter}{0pt}{-30pt}{20pt}

To indent the section label, I used this command.

1
\titlelabel{\llap{\makebox[1cm][l]{\thetitle}}\hspace*{25.4mm}}

To set the size and position of the chapter heading, I used these commands.

1
2
\titleformat{\chapter}{\fontsize{20pt}{0em}
  \selectfont\bf\color{namecolor}}{\thechapter.}{1em}{}

Defining the section headings

To set the size and position of the section headings, I used these commands.

1
2
3
4
5
6
\titleformat{\section}[hang]
  {\normalfont\Large\bfseries\color{namecolor}}
  {\thesection.}
  {1em}{}

\titlespacing{\section}{0pt}{*4}{*1\.5}

Defining the subsection headings

To change the size and position of the subsection headings, I used this command.

1
2
3
\titleformat{\subsection}[hang]
  {\normalfont\Normalsize\bfseries\color{namecolor}}
  {\thesubsection.}{1em}{}

Defining the subsubsection headings

To change the size and position of the subsubsection headings, I used this command.

1
2
3
\titleformat{\subsubsection}[hang]
  {\normalfont\Normalsize\bfseries\color{namecolor}}
  {\thesubsubsection.}{1em}{}