0

The chapter and section numbers are missing when I generate the output pdf. The problem goes away if I comment out the \usepackage{titlesec} line. However, I need the package for my document and cannot remove it.

I would like to have the chapter and section numbers in the document, and would appreciate it if someone could help me figure this out.

The basic code and output are below:

\documentclass[12pt]{report}
\usepackage{titlesec}

\begin{document}

\chapter{Chapter}
\section{Section}
\subsection{SubSection}
\section{Another Section}

\end{document}

pdf output without section numbers

Abhilash
  • 203
  • How could we guess what it contains? – Bernard Jun 17 '19 at 17:52
  • Try adding \setcounter{tocdepth}(5) either at the end of the preamble or just before \tableofcontents. – barbara beeton Jun 17 '19 at 18:04
  • With the information you provided so far, I can't reproduce the issue. I instead get the following output that includes chapter, section and subsection numbers: https://i.stack.imgur.com/T1g11.png – leandriis Jun 17 '19 at 18:09
  • @leandriis I am running pdflatex test on the commandline to generate the pdf file. Is there some issue with doing this? – Abhilash Jun 17 '19 at 18:15
  • the posted code produces numbered sections but I think there may have been a bug in an old version of koma script. what version do you have? – David Carlisle Jun 17 '19 at 19:18
  • @DavidCarlisle how do I check the version of koma script? I tried tlmgr info koma-script but it just throws an error. I am still unable to generate the chapter and section numbers. – Abhilash Jun 17 '19 at 23:51
  • See if your version of titlesec is up to date. – Johannes_B Jun 18 '19 at 04:42
  • @Johannes_B It does appear that I have an issue with the titlesec package. I have updated my question to make the problem clear. I am using titlesec v2.10.1, which as far as I can tell, is a very recent version. – Abhilash Jun 18 '19 at 16:19
  • See https://ctan.org/pkg/titlesec Your version is not up-to-date. In fact, you have the version that was online for just a few days because it introduced a bug that let the numbers disappear. – Johannes_B Jun 18 '19 at 16:36
  • @Johannes_B Thank you so much! Updating the titlesec version fixed the numbering issue. – Abhilash Jun 18 '19 at 17:21

0 Answers0