我希望看起来\tableofcontents
像\itemize
,具有相同的缩进、未编号的圆半径、圆圈和文本颜色,但保留链接功能。
是否有 beamer 选项或我需要特定包?beamer 默认预设是什么?
\documentclass{beamer}
\setbeamertemplate{itemize items}[circle]
\setbeamertemplate{section in toc}[circle]
\begin{document}
\begin{frame}{Overview}
\setbeamercolor{structure}{fg=black}
\tableofcontents
\end{frame}
\section{First section}
\begin{frame}{First content frame}
\itemize
\item First item
\item Second item
\item Other item
\item Other item
\item Other item
\item Other item
\item Other item
\item Other item
\end{frame}
\section{Second section}
\section{Other section}
\section{Other section}
\section{Other section}
\section{Other section}
\begin{frame}{Second content frame}
\itemize
\item Other item
\item Other item
\end{frame}
\end{document}
答案1
该解决方案基于:
- 投影仪中目录项之间的分隔空间,由 Gonzalo Medina 回答ToC 条目之间的垂直距离
beamer
从beamer
源头重新定义模板- 添加一个
\quad
之前$\bullet$
以改善水平间距
\documentclass{beamer}
\usepackage{etoolbox}
% Patch vertical separation between sections in toc
\makeatletter
\patchcmd{\beamer@sectionintoc}
{\vfill}
{\vskip\itemsep}
{}
{}
\makeatother
% Define a new style of section in toc to look like itemize
\defbeamertemplate{section in toc}{sectionasitem}{%
\leavevmode%
\usebeamerfont*{itemize item}%
\raise1.25pt\hbox{\usebeamercolor[fg]{structure}\quad$\bullet$}
{\usebeamercolor*[fg]{normal text}\inserttocsection}%
}
\setbeamertemplate{section in toc}[sectionasitem]
\setbeamertemplate{itemize items}[circle]
\begin{document}
\begin{frame}{Overview}
\tableofcontents
\end{frame}
\section{First section}
\begin{frame}{First content frame}
\itemize
\item First item
\item Second item
\item Other item
\item Other item
\item Other item
\item Other item
\item Other item
\item Other item
\end{frame}
\section{Second section}
\section{Other section}
\section{Other section}
\section{Other section}
\section{Other section}
\begin{frame}{Second content frame}
\itemize
\item Other item
\item Other item
\end{frame}
\end{document}