![如何在 Beamer 演示文稿中逐步显示整个目录?](https://linux22.com/image/405504/%E5%A6%82%E4%BD%95%E5%9C%A8%20Beamer%20%E6%BC%94%E7%A4%BA%E6%96%87%E7%A8%BF%E4%B8%AD%E9%80%90%E6%AD%A5%E6%98%BE%E7%A4%BA%E6%95%B4%E4%B8%AA%E7%9B%AE%E5%BD%95%EF%BC%9F.png)
我想逐步、逐节地展示我演示文稿的整个目录。为此,我认为我必须重新排列序言的这一部分,就像我的 MWE 中显示的那样:\AtBeginSubsection[]
我该如何修复它?
\documentclass{beamer}
\setbeamertemplate{section in toc}{\hspace*{1em}\inserttocsectionnumber.~\inserttocsection\par}
\setbeamertemplate{subsection in toc}{\hspace*{2em}\inserttocsectionnumber.\inserttocsubsectionnumber.~\inserttocsubsection\par}
\setbeamertemplate{subsubsection in toc}{\hspace*{3em}\inserttocsectionnumber.\inserttocsubsectionnumber.\inserttocsubsubsectionnumber.~\inserttocsubsubsection\par}
\AtBeginSubsection[]
{
\begin{frame}<beamer>
\frametitle{Outline}
\tableofcontents[
currentsection,
sectionstyle=show/show,
subsectionstyle=show/shaded/hide,
subsubsectionstyle=show/shaded,
]
\end{frame}
}
\begin{document}
\begin{frame}{outline}
\tableofcontents
\end{frame}
\section{Section title}
\begin{frame}{Section frame}
\end{frame}
\subsection{Subsection title}
\begin{frame}{Subsection frame}
\end{frame}
\subsubsection{Subsubsection title}
\begin{frame}{Subsubsection frame}
\end{frame}
\end{document}
答案1
在每个新部分中,目录中都会包含截至本节的所有条目。
\AtBeginSection
{
\begin{frame}
\frametitle{Outline}
\tableofcontents[sections={1-\thesection}]
\end{frame}
}
总体代码
\documentclass{beamer}
\setbeamertemplate{section in toc}{\hspace*{1em}\inserttocsectionnumber.~\inserttocsection\par}
\setbeamertemplate{subsection in toc}{\hspace*{2em}\inserttocsectionnumber.\inserttocsubsectionnumber.~\inserttocsubsection\par}
\setbeamertemplate{subsubsection in toc}{\hspace*{3em}\inserttocsectionnumber.\inserttocsubsectionnumber.\inserttocsubsubsectionnumber.~\inserttocsubsubsection\par}
%\AtBeginSubsection[]
\AtBeginSection
{
\begin{frame}<beamer>
\frametitle{Outline}
\tableofcontents[
sections={1-\thesection},
% currentsection,
% sectionstyle=show/show,
% subsectionstyle=show/shaded/hide,
% subsubsectionstyle=show/shaded,
]
\end{frame}
}
\begin{document}
\begin{frame}{outline}
\tableofcontents
\end{frame}
\section{First section title}
\begin{frame}{Section frame}
\end{frame}
\subsection{Subsection title}
\begin{frame}{Subsection frame}
\end{frame}
\subsubsection{Subsubsection title}
\begin{frame}{Subsubsection frame}
\end{frame}
\section{Second section title}
\begin{frame}{Section frame}
\end{frame}
\subsection{Subsection title}
\begin{frame}{Subsection frame}
\end{frame}
\subsubsection{Subsubsection title}
\begin{frame}{Subsubsection frame}
\end{frame}
\section{Third section title}
\begin{frame}{Section frame}
\end{frame}
\subsection{Subsection title}
\begin{frame}{Subsection frame}
\end{frame}
\subsubsection{Subsubsection title}
\begin{frame}{Subsubsection frame}
\end{frame}
\end{document}