[Tex/LaTex] Chapter, section, subsections title font size

fontsizesectioning

In my master thesis the specification of the University should be as following:

Chapter (font size= 16 and font type= Times New Roman)

Section (font size= 14 and font type= Times New Roman)

Subsection (font size= 12 and font type= Times New Roman)

but at the chapter should look like in the pictureenter image description here :

I used this command `

\newcommand{\mychapter}[2]{
\chapterfont{\fontsize{16}{15}}
\setcounter{chapter}{#1}
\setcounter{section}{0}
\chapter*{#2}
\addcontentsline{toc}{chapter}{#2}

}

` But The font size didn't change for nether the chapters, sections or subsection can you help me please?

Best Answer

try this code

\documentclass{report}
\usepackage{titlesec}

\newcommand{\chapfnt}{\fontsize{16}{19}}
\newcommand{\secfnt}{\fontsize{14}{17}}
\newcommand{\ssecfnt}{\fontsize{12}{14}}

\titleformat{\chapter}[display]
{\normalfont\chapfnt\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\chapfnt}

\titleformat{\section}
{\normalfont\secfnt\bfseries}{\thesection}{1em}{}

\titleformat{\subsection}
{\normalfont\ssecfnt\bfseries}{\thesubsection}{1em}{}

\titlespacing*{\chapter} {0pt}{50pt}{40pt}
\titlespacing*{\section} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\titlespacing*{\subsection} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

\begin{document}
\chapter{Introduction}
\section{Test}
\subsection{More}

\end{document}

you can also do it without titlesec like this

\documentclass{report}

\newcommand{\chapfnt}{\fontsize{16}{19}}
\newcommand{\secfnt}{\fontsize{14}{17}}
\newcommand{\ssecfnt}{\fontsize{12}{14}}

\makeatletter
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \chapfnt\bfseries \@chapapp\space \thechapter
        \par\nobreak
        \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \chapfnt \bfseries #1\par\nobreak
    \vskip 40\p@
  }}
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\secfnt\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\ssecfnt\bfseries}}
\makeatother

\begin{document}

\chapter{Introduction}
\section{Test}
\subsection{More}
test 
\end{document}