How do I remove the section and subsection from the table of contents and just have the chapters?
\documentclass{book}
\usepackage{lipsum}
\usepackage{titletoc}
\begin{document}
\tableofcontents
\chapter{Introduction} \lipsum[1]
\section{First section} \lipsum[2-3]
\section{Second section} \lipsum[4-5]
\section{Last section} \lipsum[6-7]
\chapter{Second chapter} \lipsum[1]
\section{First section} \lipsum[2-3]
\section{Second section} \lipsum[4-5]
\section{Last section} \lipsum[6-7]
\chapter{Last chapter} \lipsum[1]
\section{First section} \lipsum[2-3]
\section{Second section} \lipsum[4-5]
\section{Last section} \lipsum[6-7]
\end{document}
\tableofcontents, in the preamble as well as in the body of text. – Miyase Apr 08 '22 at 08:20