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, so that this blog post is also to help me in case I forget again. I was getting 0.0 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.


We have to then 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}




_________________________________



Please help us keep on inspiring you

No comments:

Post a Comment