1

I would like a numbering of the sections as below. I have previously asked this question in Numbering sections independent of chapters numbering. An excellent answer was provided https://tex.stackexchange.com/a/207971/39306 using remreset package. Also a more general solution is given in https://tex.stackexchange.com/a/28334/39306 using chngcntr package.

I am wondering if there is a solution without the use of any external package?

Chapter 1
   section 1
   section 2
Chapter 2
   section 3
   section 4
   section 5
Chapter 3
   section 6
   section 7

Here is my file:

\documentclass{book}

\renewcommand{\thesection}{\arabic{section}}

\begin{document}
\tableofcontents
\chapter{First}
\section{First}
\section{Second}
\section{Third}
\chapter{Second}
\section{Fourth}
\section{Fifth}
\section{Sixth}

\end{document}
Name
  • 2,816

1 Answers1

3
\documentclass{book}

\makeatletter
\def\cl@chapter{}
\makeatletter

\renewcommand{\thesection}{\arabic{section}}

\begin{document}
\tableofcontents
\chapter{First}
\section{First}
\section{Second}
\section{Third}
\chapter{Second}
\section{Fourth}
\section{Fifth}
\section{Sixth}

\end{document}
David Carlisle
  • 757,742