如何抑制latex-beamer中目录中的小节?

Nil*_*ang 33 latex

假设我的乳胶 - 投影仪演示中有一些部分.其中一些部分包含子部分,而另一部分则不包含.所以在目录中看起来很奇怪.

如何抑制目录中的小节?

ypn*_*nos 41

要保留索引的特定子部分,请使用: \subsection*{...}

要仅从TOC中删除所有子部分,请使用:( \tableofcontents[hideallsubsections]从另一个答案添加)


Ale*_*ysh 40

隐藏小节使用非常不言自明的:

\tableofcontents[hideallsubsections]

  • 这对使用 book 文档类的常规 LaTeX 文档没有任何作用。也许它是 Beamer 特定的。 (2认同)

Mat*_*gro 5

与其他两个答案相同,也可以使用\setcounter{tocdepth}{1}, before (or after)来实现\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}
Run Code Online (Sandbox Code Playgroud)

与使用 相同\tableofcontents[hideallsubsections]subsections 消失在 sframe所在的\tableofcontents位置,但不会出现在侧边栏中(如果您使用的主题中存在)。同样,在本地使用 starred 也是如此\subsection*{Subsection Title}