## Saturday, 4 June 2016

### Chapter/Section Numbers in Latex: Format

The problem that I had today I had already had in the past, but, because I forgot the solution, I was here struggling another two hours or so. I was getting 0.0, for instance, as a chapter number.

To get rid of complications, I used sections instead of chapters when building my pages, but I then wanted to use Table of Contents to get a nice index.

That is how the problem appeared. The solution is quite easy, but it takes us a long time to get there on our own, is it not?

We just have to add this to the preamble:

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

And we then  have to add this to the body:

\begin{document}
\setcounter{tocdepth}{1}
\setcounter{chapter}{1}
\setcounter{section}{0}
\setcounter{secnumdepth}{1}

_________________________________