Hi, I have put the following in my latex file; however, after I add the table of content, the chapters and subsections are all numbered but just the sections are not. Is there anyone who knows what is going on here? Thank you!
The following is my code in the file before \begin{document} which is from a website http://zoonek.free.fr/LaTeX/LaTeX_sampl ... ter/0.html :
\documentclass{sample}
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
{\parindent \z@ \raggedright
\reset@font
\hrule
\vspace*{10\p@}%
\par
\Large \scshape \@chapapp{} \Huge\bfseries \thechapter
\par\nobreak
\vspace*{10\p@}%
\hrule
\par
\vspace*{1\p@}%
\hrule
%\vskip 40\p@
\vspace*{20\p@}
\Huge \bfseries #1\par\nobreak
\vskip 70\p@
}}
\def\section#1{%
\par\bigskip\bigskip
\hrule\par\nobreak\noindent
\refstepcounter{section}%
\addcontentsline{toc}{chapter}{#1}%
\reset@font
{ \Large \bfseries
\strut\S \thesection \quad
#1}%
\par
\medskip
}
General ⇒ Having Problems to Number Setions in Table of Content
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Having Problems to Number Setions in Table of Content
Looking at the examples, I suggest to use packages like fncychap, sectsty or titlesec (and maybe titletoc) instead.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10