I use \subsection{example} and on the toc shows 1.4.1 Example. But on the text only shows 1.4 Example. The numbered after chapter number 1 and section number 4 is missing. How to add the number for subsection?

Btw i have tried to see some duplicates. Tried their codes but didn't work.

My duplicate: enter link description here


\usepackage{pgf, tikz}
\usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry}


\setcounter{secnumdepth}{2} %I TRIED THIS BUT DID'NT WORK


\frontmatter %


%   \listoffigures
%   \listoftables


\chapter*{\textbf{BAB 1. PENDAHULUAN}}
\addcontentsline{toc}{chapter}{\textbf{BAB 1. PENDAHULUAN}}  

\section{\textbf{Batasan Masalah}}  

\section{\textbf{Tujuan Penelitian}}  

\section{\textbf{Manfaat Penelitian}}  

\section{\textbf{Kebaruan Penelitian}}  

\subsection{Subsection 1}
\subsection{Subsection 2}

  • 1
    please upload you entire working code as a MWE – js bibra Aug 5 '20 at 13:18
  • @jsbibra please see my update – user516076 Aug 5 '20 at 13:30
  • Please make sure your example actually compiles. Never just ignore compilation errors, After adding two missing } and a d in \blintext, a \ before setcounter, removing the blank lines in the titleformat setup. The example compiles just fine and the subsection is numbered in TOC and doc. – daleif Aug 5 '20 at 13:48
  • @daleif if there's a typo it's my fault. But there's no typo on my main doc. And it still missing. The number behind subsection i mean – user516076 Aug 5 '20 at 14:00
  • Please copy and paste from your main document so that there's no typo. And please trim the main document down to the minimal necessary, probably by copying everything to a new file. – Teepeemm Aug 5 '20 at 14:02

After getting the MWE to actually compile, the problem boils down to this:


which is wrong, note the \thesection, it should be


to match the fact that it is for \subsection

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.