2

I want to have numbered sections in an unnumbered chapter.

This is my code:

\documentclass{book}

\begin{document}

\tableofcontents

\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}
\section{First numbered section in unnumbered chapter}
\section{Second numbered section in unnumbered chapter}

\chapter{First numbered chapter}
\section{First numbered section in numbered chapter}

\end{document}

This is a preview of the compiled Table of Contents: Compiled ToC

As you can see the numbered sections have leading zeroes in the Table of Contents. How can I delete the leading zeros? Of course I want to achieve the same in the actuel text.

Thank you

1

Temporarily change the definition of \thesection (no guarantee this won't break anything...)

\documentclass{book}

\begin{document}

\tableofcontents

\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}

\begingroup
\makeatletter
\renewcommand\thesection{\@arabic\c@section}
\makeatother
\section{First numbered section in unnumbered chapter}
\section{Second numbered section in unnumbered chapter}
\endgroup

\chapter{First numbered chapter}
\section{First numbered section in numbered chapter}

\end{document}

enter image description here

  • Correct answer, thank you very much! – GlennyDC Apr 25 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.