3

I have a problem formatting my subsubsection title using titlesec. From my code, I would have thought the Subsubsection title was numbered I.1.1 but I don't see any number on my resulting file:

result

I noticed that by passing \documentclass{article}, the problem did not occur

Do you have any idea where the problem could come from?

My code:

\RequirePackage{fix-cm}
\documentclass{book}

\usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french]{babel} \usepackage[left=1.5cm, right=1.5cm, top=1.5cm, bottom=1.5cm]{geometry}

\usepackage{array} \usepackage{enumitem} %pour l'option [resume] qui permet de reprendre la numérotation \usepackage{pifont} %\usepackage{tabularx} %\usepackage{tabulary} \usepackage{tabularray} \UseTblrLibrary{amsmath,booktabs,counter,diagbox,siunitx,varwidth} \usepackage[export]{adjustbox} %\usepackage{verbatim} \usepackage{multicol} \usepackage{appendix} \usepackage{libertine} \usepackage{graphicx} %\usepackage{picinpar}

\usepackage[european, RPvoltages, straightvoltages]{circuitikz} \usepackage{siunitx} \usepackage{hyperref} \usepackage[normalem]{ulem} \usepackage{titlesec} \usepackage{caption}

\hypersetup{colorlinks=true, linkcolor=black} \usetikzlibrary{babel} \usepackage{lmodern} \newenvironment{manip}{\begin{itemize}[label=\ding{45}]}{\end{itemize}} \usepackage{booktabs} \usepackage{tikzsymbols} \usepackage{moresize}

\usepackage[Rejne]{fncychap}

\usepackage{pgf-spectra}

\newcolumntype{Y}{>{\centering\arraybackslash}X} \titleformat{\section}[hang]{\LARGE \bfseries}{\Roman{section}.}{1em}{} \titlespacing{\section}{0pt}{6}{0.5} \titleformat{\subsection}[hang]{\Large \bfseries}{\Roman{section}.\arabic{subsection}}{1em}{} \titlespacing{\subsection}{0pt}{5}{0.5} \titleformat{\subsubsection}[hang]{\large \bfseries}{\Roman{section}.\arabic{subsection}.\alph{subsubsection}}{1em}{} \titlespacing{\subsubsection}{0pt}{5}{0.5} \titleformat{\paragraph}[hang]{\large \bfseries}{\theparagraph}{0em}{} \titlespacing{\paragraph}{0pt}{3}{0.5} \titleformat{\subparagraph}[hang]{\normalsize \bfseries}{\theparagraph}{0em}{} \titlespacing{\subparagraph}{0pt}{3}{*0.5} \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\begin{document} \mainmatter \chapter{Chapter1} \section{Section1} \subsection{Subsection1} \subsubsection{Subsubsection1} \end{document}

Werner
  • 603,163
Nicolas
  • 1,023

1 Answers1

4

If you want the numbers of \subsection-level headers -- and, presumably, of \section-level headers as well -- to include the chapter number, you need to change

\titleformat{\section}[hang]{\LARGE \bfseries}{\Roman{section}.}{1em}{}
\titleformat{\subsection}[hang]{\Large \bfseries}{\Roman{section}.\arabic{subsection}}{1em}{}

to

\titleformat{\section}[hang]{\LARGE\bfseries}{\arabic{chapter}.\Roman{section}.}{1em}{}
\titleformat{\subsection}[hang]{\Large\bfseries}{\arabic{chapter}.\Roman{section}.\arabic{subsection}}{1em}{}

If you want subsubsection-level headers to be numbered, you further need to run

\setcounter{secnumdepth}{3}

as the default value of the secnumdepth counter is 2 in the book document class.

Mico
  • 506,678