0

Here is the code I am using

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable}
\usepackage{mathtools, amsmath, amsthm}
\usepackage{fancyhdr}
\usepackage{todonotes}
\usepackage{pgfornament}
\usepackage{pgfpages}
\usepackage[margin=1in]{geometry}
\usepackage{titlesec}
\usepackage{xcolor}
\usepackage{fontawesome}
\usepackage{pgfornament}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage[titles]{tocloft}




\titleformat{\section}{\Large\bfseries\color{blue}}{\faBook}{1em}{\thesection.}
\titleformat{\subsection}{\large\bfseries\color{black}}{\faAngleRight}{1em}{\thesubsection.}

\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{Page \thepage}
\renewcommand{\footrulewidth}{0.4pt}
\fancyhead[C]{\pgfornament[width=2cm]{88}}


\begin{document}

\title{Hello All}
\author{XYZ}
\date{\today}
\maketitle

\listoftodos

\tableofcontents

\section{Introduction}




\end{document}

I get 0.To Do list and 0. Content. How do I get rid of this and just have 1.Introduction?

1
  • 2
    I think you may have too many packages loaded for your MWE. Try loading only the packages you need first. The issue is probably with one of the loaded packages. Commented Jan 22, 2023 at 8:00

1 Answer 1

2

Adaptations

  • I removed the packages that are not needed for this example

You define the format of section and subsection with:

\titleformat{\section}{\Large\bfseries\color{blue}}{\faBook}{1em}{\thesection.}
\titleformat{\subsection}{\large\bfseries\color{black}}{\faAngleRight}{1em}{\thesubsection.}

Because the headings "Todo list" and "Contents" are placed as section*, they are affected by this. If you put both \titleformat lines below the \tableofcontents it only affects the following sections and subsections.

Result

enter image description here

Code

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{todonotes}
\usepackage[margin=1in]{geometry}
\usepackage{titlesec}
\usepackage{xcolor}
\usepackage{fontawesome}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage[titles]{tocloft}

\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{Page \thepage}
\renewcommand{\footrulewidth}{0.4pt}
\fancyhead[C]{\pgfornament[width=2cm]{88}}

\begin{document}

\title{Hello All}
\author{XYZ}
\date{\today}
\maketitle

\listoftodos

\tableofcontents

\titleformat{\section}{\Large\bfseries\color{blue}}{\faBook}{1em}{\thesection.}
\titleformat{\subsection}{\large\bfseries\color{black}}{\faAngleRight}{1em}{\thesubsection.}

\section{Introduction}

\end{document}

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.