0

I want my introduction to appear in the table of contents without the chapter number, but because I've used the \chapter* command to achieve this all the sections in the introduction are numbered as:

0.1 Title of Section

And I don't want the zero there (i.e. I want the first section of the introduction to be numbered 1). But for all the other chapters I do want the chapter number to be included in the section number (e.g. I want the 2nd section of chapter 1 to be numbered 1.2). Is there a way to get the section numbering of a single chapter to ignore the chapter number? Thanks!

Here's a MWE:

\documentclass[12pt, twoside]{report}

\usepackage[explicit]{titlesec} %adjust titles
\usepackage{lipsum}

\titleformat{\chapter}[display]{\LARGE\bfseries\centering}{\thechapter}{10pt}{#1}
\titleformat{\section}{\normalfont\fontsize{20}{20}\centering}{\thesection}{1em}{\MakeUppercase{#1}}
\titleformat{\subsection}{\normalfont\centering}{\thesubsection}{1em}{\textit{{#1}}}

\setcounter{tocdepth}{1} %removes subsubsections from toc

%%%%%%%%%removes dots from toc
\makeatletter 
\renewcommand{\@dotsep}{10000} 
\makeatother
%%%%%%%%%

\begin{document}

\tableofcontents

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

\section{Here's a Section}

I want this section just to be numbered `1' rather than `0.1'. I would also like it to be numbered `1' instead of `0.1' in the table of contents.

\section{And Here's Another One}

This one should be numbered `2' rather than `0.2'.

\chapter{The First Chapter}

\section{Here's Another Section}

This section is numbered correctly.

\section{And Here's Another One}

And so is this one.

\end{document}
4
  • Do you also want to hide the sections in the introduction from the table of contents? Probably a minimal working example (MWE) that shows your current approach would be helpful.
    – leandriis
    Commented Sep 6, 2020 at 11:42
  • Did you use titlesec to format your sections?
    – Bernard
    Commented Sep 6, 2020 at 12:19
  • @leandriis Sorry I thought this would be a quick question that didn't need one. I've added one now, thanks! Commented Sep 6, 2020 at 13:04
  • Possible duplicate: tex.stackexchange.com/questions/277169/… Commented Jan 10, 2022 at 14:39

1 Answer 1

0

Change the section numbering style at appropriate places.

% secnumprob.tex  SE 561571
\documentclass[12pt, twoside]{report}

\usepackage[explicit]{titlesec} %adjust titles
\usepackage{lipsum}

\titleformat{\chapter}[display]{\LARGE\bfseries\centering}{\thechapter}{10pt}{#1}
\titleformat{\section}{\normalfont\fontsize{20}{20}\centering}{\thesection}{1em}{\MakeUppercase{#1}}
\titleformat{\subsection}{\normalfont\centering}{\thesubsection}{1em}{\textit{{#1}}}

\setcounter{tocdepth}{1} %removes subsubsections from toc

%%%%%%%%%removes dots from toc
\makeatletter 
\renewcommand{\@dotsep}{10000} 
\makeatother
%%%%%%%%%

\begin{document}

\tableofcontents

\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}
\renewcommand{\thesection}{\arabic{section}}  % PW ADDED

\section{Here's a Section}

I want this section just to be numbered `1' rather than `0.1'. I would also like it to be numbered `1' instead of `0.1' in the table of contents.

\section{And Here's Another One}

This one should be numbered `2' rather than `0.2'.

\chapter{The First Chapter}
\renewcommand{\thesection}{\thechapter.\arabic{section}} % PW ADDED

\section{Here's Another Section}

This section is numbered correctly.

\section{And Here's Another One}

And so is this one.

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .