开发者

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

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开发者_Go百科 table of contents.

How can I suppress subsections in the table of contents?


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)


To hide subsections use the pretty self-explanatory:

\tableofcontents[hideallsubsections]


The same as in the other two answers can also be achieved using \setcounter{tocdepth}{1}, before (or after) \begin{document}: try to compile the following code, then delete or comment the line marked with %%% and compile again (once, or twice if necessary) to see the difference.

\documentclass{beamer}
\usetheme{Goettingen}

\setcounter{tocdepth}{1} %%%

\begin{document}

\frame{\tableofcontents}

\section{First}
\begin{frame}
  A
\end{frame}

\section{Second}
\subsection{One only}
\begin{frame}
  B
\end{frame}

\end{document}

At the same way as using \tableofcontents[hideallsubsections], the subsections disappear in the frame where the \tableofcontents is, but not in the sidebar (if present in the theme you use). The same, again, with local use of starred \subsection*{Subsection Title}.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜