
我正在編寫一個投影機演示文稿,該演示文稿應分為幾個部分,每個部分都包含部分、小節等。
這段程式碼(沒有\part
指令)運作正常並且正確產生目錄:
\documentclass{beamer}
\title{Title}
\subtitle{Subtitle}
\author{Author Of Presentation}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\tableofcontents
\end{frame}
%\part{Part 1}
%\frame{\partpage}
\section{Section 1}
\begin{frame}
Section 1
\end{frame}
\subsection{Subsection 1.1}
\begin{frame}
Subsection 1.1
\end{frame}
\subsection{Subsection 1.2}
\begin{frame}
Subsection 1.2
\end{frame}
\section{Section 2}
\begin{frame}
Section 2
\end{frame}
%\part{Part 2}
%\frame{\partpage}
\section{Section 3}
\begin{frame}
Section 3
\end{frame}
\subsection{Subsection 3.1}
\begin{frame}
Subsection 3.1
\end{frame}
\subsection{Subsection 3.2}
\begin{frame}
Subsection 3.2
\end{frame}
\section{Section 4}
\begin{frame}
Section 4
\end{frame}
\end{document}
但是當我取消註解\parts
命令和\frame{\partpage}
命令時,我得到一個空目錄。
我應該改變什麼來視覺化正確的目錄?我希望在目錄中實現以下結果(沒有小節和更深層次):
第一部分
+++ 第 1 節
+++ 第 2 節
第二部分
+++ 第 3 節
+++ 第 4 節
答案1
為了以後參考,\tableofcontents
beamer 中的指令僅列出目前部分的條目。可選參數[part=N]
將列出 N 部分的條目。投影機手冊。
\documentclass{beamer}
\title{Title}
\subtitle{Subtitle}
\author{Author Of Presentation}
\newcommand{\makepart}[1]{ % For convenience
\part{Title of part #1} \frame{\partpage}
\section{Section} \begin{frame} Section \end{frame}
\subsection{Subsection} \begin{frame} Subsection \end{frame}
\subsection{Subsection} \begin{frame} Subsection \end{frame}
\section{Section} \begin{frame} Section \end{frame}
}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
Part I:
\tableofcontents[part=1]
Part II:
\tableofcontents[part=2]
\end{frame}
\makepart{1}
\makepart{2}
\end{document}