答案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}