Theses, Books, Title pagesHow do I hide subsections from the table of contents?

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

How do I hide subsections from the table of contents?

Post by templateuser »

Hello ! Thank you for the template, it is very well done ! I am writing my Master thesis on it ! How can I hide a subsection from the table of contents ??

I have tried \subsection*{…} but with this command all the subsections become hidden and that subsection specifically becomes non-numbered !

I would appreciate any help.

Greetings, Bruno

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Vel
Site Moderator
Posts: 463
Joined: Fri Jun 29, 2012 1:20 am

How do I hide subsections from the table of contents?

Post by Vel »

Hi Bruno,

To hide a single subsection from the table of contents but still keep its numbering, use the following:

Code: Select all

\addtocontents{toc}{\protect\setcounter{tocdepth}{1}}
\subsection{A (not so short) Introduction to \LaTeX{}}
\addtocontents{toc}{\protect\setcounter{tocdepth}{2}}
To hide all subsections, add \setcounter{tocdepth}{1} to the preamble.

Cheers,
Vel
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com
Post Reply