1

I am wondering if it is possible to remove the chapter number from the section numbers in the class book, although the chapters keep their numbers. In other words, instead of this:

Chapter 1

Chapter title

1.1. Section

I want to have that:

Chapter 1

Chapter title

1. Section

I thank you all in advance for your help!!!!!

  • Welcome to TeX.SX! What is the expected number of the first section in the second chapter? "Section 1" as well or do you expect the section counter to continue from the previous chapter resulting in continuously numbered sections throughout the whole document? – leandriis May 31 '21 at 20:33
  • 1
    Welcome to TeX SX. Depending on your document class, you can try \counterwithin*{section}{chapter}in your preamble. – Bernard May 31 '21 at 20:34
  • Hello Leandriis. First of all, thanks for the fast answer. The expected output is to have section 1 at the beginning of the second chapter. I don't want to have a continuous numbering. – Thomas Dobrenel May 31 '21 at 21:15
  • Hello @Bernard. Thank you very much for the suggestion. However, it does not seem to work. My code follows this example:

    \documentclass[a4paper, 10pt]{book}

    \usepackage{blindtext}

    \counterwithin*{section}{chapter}

    \setcounter{secnumdepth}{5}

    \begin{document}

    \chapter{Chapter title}

    \section{This is a section} \section{Section} \subsection{Subsection} \subsubsection{Subsubsection} \paragraph{Paragraph} \subparagraph{Subparagraph} \blindtext \end{document}

    – Thomas Dobrenel May 31 '21 at 21:21
  • @ThomasDobrenel: Still simpler: just add \renewcommand\thesection}{\arabic{section}} to your preamble. – Bernard May 31 '21 at 22:02
  • Thank you very much @Bernard. Your suggestion to add \renewcommand{\thesection}{\arabic{section}} in the preamble worked as a charm. – Thomas Dobrenel May 31 '21 at 22:34

1 Answers1

1

The suggestion by @Bernard to add \renewcommand{\thesection}{\arabic{section}} in the preamble worked like a charm.

Stefan Kottwitz
  • 231,401