0

I want to achieve simple numbering of sections using titlesec, something like this:

1. Chapter
1.1. Section
1.1.1. Subsection

I get the feeling that something is wrong configured in my latex environment or titlesec is broken.

I have followed How to set the chapter style in report class? to achieve my goal but the result is that instead of:

Chapter 1
Chapter
Section
Subsection

I get:

Chapter
Section
Subsection

I have also tried to use \titlelabel{\thetitle.\quad} to achieve any kind of numbering but without success.

I use Texmaker to compile to .pdf. Here is my experimental piece of code:

\documentclass{report}

\usepackage{titlesec}

%\titleformat{\chapter}
%  {\normalfont\LARGE\bfseries}{\thechapter.}{1em}{}
%\titlespacing*{\chapter}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}

%\titleformat{\section}
%  {\normalfont\LARGE\bfseries}{\thesection.}{1em}{}

%\titlelabel{\thetitle.\quad}

\begin{document}

\chapter{Chapter}
\section{Section}
\subsection{Subsection}

\end{document}

Can anyone suggest me what might be wrong? A task like this should be rather simple.

Al Bundy
  • 101
  • 1
    Which titlesec do you use? If it is 2.10.1 then you have to update the package. See https://tex.stackexchange.com/q/299969/43317 – esdd Nov 23 '17 at 13:33

1 Answers1

1

using the documentation of titlesec :

\documentclass{report}

\usepackage{titlesec}

%\titleformat{\chapter}
%  {\normalfont\LARGE\bfseries}{\thechapter.}{1em}{}
%\titlespacing*{\chapter}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}

%\titleformat{\section}
%  {\normalfont\LARGE\bfseries}{\thesection.}{1em}{}

%\titlelabel{\thetitle.\quad}

\titleformat{\section}[block]
{\Large\bfseries}%
{\thesection}
{5mm}
{}
\titleformat{\subsection}[block]
{\large\bfseries}%
{\thesubsection}
{5mm}
{}

\titleformat{\chapter}[block]
{\Huge\bfseries}%
{\thechapter}
{5mm}
{}

\begin{document}

\chapter{Chapter}
\section{Section}
\subsection{Subsection}

\end{document}

enter image description here

flav
  • 4,714