假设我的乳胶 - 投影仪演示中有一些部分。其中一些部分包含子部分,而另一部分则不包含。所以在目录中看起来很奇怪。
如何抑制目录中的小节?
要保留索引中的特定子部分,请使用:\subsection*{...}
要仅从TOC中删除所有子部分,请使用:\tableofcontents[hideallsubsections]
(从另一个答案添加)
隐藏小节使用非常不言自明的:
\tableofcontents[hideallsubsections]
在\setcounter{tocdepth}{1}
之前(或之后)使用\begin{document}
也可以实现与其他两个答案相同:尝试编译以下代码,然后删除或注释标记为%%%
的行并再次编译(必要时一次或两次)看到不同。
\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}
与使用\tableofcontents[hideallsubsections]
一样,subsection
s消失在frame
所在的\tableofcontents
,但不在侧边栏中(如果出现在你使用的主题中)。同样,再次,与当地使用星号\subsection*{Subsection Title}
。