
答案1
透過設定section in toc
, subsection in toc
(也可能是section in toc shaded
, subsection in toc shaded
)模板,您可以變更目錄中分節單元條目的格式;這是一個小範例,顯示了部分條目的一些替代方案(禁止編號和球、使用圓圈、使用未編號的球和使用正方形):
\documentclass{beamer}
\usetheme{Warsaw}
\begin{document}
\setbeamertemplate{section in toc}{\inserttocsection}
\begin{frame}
\tableofcontents
\end{frame}
\setbeamertemplate{section in toc}[circle]
\begin{frame}
\tableofcontents
\end{frame}
\setbeamertemplate{section in toc}[ball unnumbered]
\begin{frame}
\tableofcontents
\end{frame}
\setbeamertemplate{section in toc}[square]
\begin{frame}
\tableofcontents
\end{frame}
\section{Test Section One}
\frame{test}
\section{Test Section Two}
\frame{test}
\end{document}
當然,您可以定義自己的風格;例如,要抑制球並保留數字,您可以說:
\documentclass{beamer}
\usetheme{Warsaw}
\setbeamertemplate{section in toc}{\inserttocsectionnumber.~\inserttocsection}
\begin{document}
\begin{frame}
\tableofcontents
\end{frame}
\section{Test Section One}
\frame{test}
\section{Test Section Two}
\frame{test}
\end{document}
以下是一個更詳細的範例,更改了目錄中節和小節條目的顯示方式:
\documentclass{beamer}
\usetheme{Warsaw}
\setbeamertemplate{section in toc}{%
{\color{orange!70!black}\inserttocsectionnumber.}~\inserttocsection}
\setbeamercolor{subsection in toc}{bg=white,fg=structure}
\setbeamertemplate{subsection in toc}{%
\hspace{1.2em}{\color{orange}\rule[0.3ex]{3pt}{3pt}}~\inserttocsubsection\par}
\begin{document}
\begin{frame}
\tableofcontents
\end{frame}
\section{Test Section One}
\subsection{Test Subsection One One}
\frame{test}
\subsection{Test Subsection One Two}
\frame{test}
\section{Test Section Two}
\subsection{Test Subsection Two One}
\frame{test}
\subsection{Test Subsection Two Two}
\frame{test}
\end{document}