I am new to LaTex and I am writing a document where I do not want my sections to be numbered. I did a quick google search and found this line of code to turn them off: \setcounter{secnumdepth}{0} % Turns off numbering for sections.
However, when using this, I notice that my second level items in my TOC are not indenting properly. You can see here that I have a chapter and underneath that chapter is the first section; however, it is on the same indentation level as the chapter. Is there a way to correct this so my sections appear indented? Also if there is a better way to disable section numbering, please let me know. Thanks!
[Tex/LaTex] Turn off Section Numbering without Affecting TOC Indentation
indentationsectioningtable of contents
Best Answer
The following suggestion re-inserts the
\numberline
component of the ToC entry for all sectional units higher thansecnumdepth
. So, you'll get the original spacing of\section
,\subsection
,... in the ToC:etoolbox
is used to patch\@sect
, adding an empty\numberline
as part of the test onsecnumdepth
.