0

My probşem is pretty simple but I could not solve the problem. I use the titlesec to modify the font and bold of my section, subsection and subsubsection but this is kinda messed up the indexing of the sections. What I want is: 1.First Section 1.1 First subsection 1.1.1 First subsubsection

But it only gives me an output of 1.First section 1.first subsection

\usepackage{titlesec}
\titleformat{\section}
  {\normalfont\fontsize{20}{15}\bfseries}{\thesection}{1em}{}

\titleformat{\subsection}
  {\normalfont\fontsize{14}{15}\bfseries}{\thesection}{1em}{}

\titleformat{\subsubsection}
  {\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}
3
  • 1
    You are using \thesection in every \titleformat. You should use \thesection \thesubsection etc. accordingly to what you are defining.
    – Nico
    Apr 16, 2020 at 11:28
  • This solves the problem. Thanks a lot. How I miss that point.
    – Berk
    Apr 16, 2020 at 11:57
  • You are welcome :)
    – Nico
    Apr 16, 2020 at 11:59

2 Answers 2

1

You are using \thesection in every \titleformat. You should use \thesection \thesubsection etc. accordingly to what you are defining.

So this is how your definitions should look like:

\usepackage{titlesec}
\titleformat{\section}
  {\normalfont\fontsize{20}{15}\bfseries}{\thesection}{1em}{}

\titleformat{\subsection}
  {\normalfont\fontsize{14}{15}\bfseries}{\thesubsection}{1em}{}

\titleformat{\subsubsection}
  {\normalfont\fontsize{12}{15}\bfseries}{\thesubsubsection}{1em}{}
0

This will point you in the right direction--when i change the \section I do it the following way using

\usepackage[explicit]{titlesec}%<-------------in the preamble
\usepackage[normalem]{ulem}%<-----------------in the preamble

\renewcommand{\thesection}{\Roman{section}}
\titleformat{\section}[block]
{\normalfont\bfseries\filcenter}{\uline{SECTION~\thesection :}}{0em} 
{\uline{\MakeUppercase{\hspace*{1em}   #1}}}
\titlespacing{\section}{0pt}{24pt}{12pt}

Now when I use it in the following manner

\section{professional competence}

my output is

enter image description here

Now if I want to change the subsection I use

\renewcommand{\thesubsection}{\thesection~\Alph{subsection}}
\titleformat{\subsection}[block]
{\normalfont\bfseries}{\uline{\thesubsection :}}{0em}{\uline{{\hspace*{1em}   #1}}}
\titlespacing{\subsection}{0pt}{24pt}{12pt}

and use it like

 \subsection{Annual workplan and achievements}

and my output is

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .