Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress subsections in the table of contents in latex-beamer?

Tags:

latex

Assume I have some sections within my latex-beamer presentation. Some of these sections contain subsections, others do not. So it looks very weird in the table of contents.

How can I suppress subsections in the table of contents?

like image 469
NilsHaldenwang Avatar asked Jun 16 '11 13:06

NilsHaldenwang


People also ask

How to include table of contents in beamer?

Creating the table of contents in Beamer can be done with the same manner as in standard LaTeX. The first thing that we should do is to structure our presentation using the commands \section{} and \subsection{} ( \section*{} and \subsection*{} , to hide it from table of contents).

How do I put sections in a table of contents in LaTeX?

Generally, the table of contents includes chapters, sections, and subsection. You are also allowed to add entries manually in LaTeX. This is generally done to add the unnumbered sections. To do so, just add the \addcontentsline command, as shown in the above example.

What does section * Do in LaTeX?

The brief answer is, \section inserts a new entry into the table of contents at the appropriate tree-level and also inserts a new entry into the navigation bars. But \section* only adds an entry in the navigation bars, not in the table of contents.


2 Answers

To keep a specific subsection out of the index use: \subsection*{...}

To remove all subsections from the TOC only, use: \tableofcontents[hideallsubsections] (added from another answer)

like image 147
ypnos Avatar answered Sep 17 '22 04:09

ypnos


To hide subsections use the pretty self-explanatory:

\tableofcontents[hideallsubsections]

like image 43
Alexander Gladysh Avatar answered Sep 19 '22 04:09

Alexander Gladysh