![Beamer:增加目录中的圆半径并包含子部分项目符号](https://linux22.com/image/248505/Beamer%EF%BC%9A%E5%A2%9E%E5%8A%A0%E7%9B%AE%E5%BD%95%E4%B8%AD%E7%9A%84%E5%9C%86%E5%8D%8A%E5%BE%84%E5%B9%B6%E5%8C%85%E5%90%AB%E5%AD%90%E9%83%A8%E5%88%86%E9%A1%B9%E7%9B%AE%E7%AC%A6%E5%8F%B7.png)
我正在尝试增加 Beamer 演示文稿目录中圆圈的半径并包含子部分项目符号。Beamer 手册中给出了一个示例\setbeamertemplate{some beamer element}[circle]{3pt}
,但这会破坏下面的 MWE。
本质上,“球”内部主题完全符合我的要求(一个漂亮的大圆圈和一个用于子部分的项目符号),但我一点也不喜欢这个图形。我只想使用“普通”项目符号。
\documentclass{beamer}
\mode<presentation>
{
\usetheme{Warsaw}
\setbeamercovered{transparent}
}
\setbeamertemplate{section in toc}[circle]%{3pt}
\setbeamertemplate{subsection in toc}[circle]
\begin{document}
\begin{frame}{Outline}
\tableofcontents
\end{frame}
\section{Introduction}
\subsection{First Subsection Name}
\section{Test}
\subsection{Second Subsection}
\begin{frame}{Make Titles Informative.}
\end{frame}
\begin{frame}{Make Titles Informative.}
\end{frame}
\end{document}
答案1
基本上你必须设置 beamer 模板section in toc
并subsection in toc
关联到circle
选项;原始定义可以在文件中找到beamerbaseauxtemplates.sty
。以下是供参考的原始定义:
\defbeamertemplate{section in toc}{circle}
{\leavevmode\leftskip=2ex%
\llap{%
\usebeamerfont*{section number projected}%
\usebeamercolor{section number projected}%
\begin{pgfpicture}{-1ex}{0ex}{1ex}{2ex}
\color{bg}
\pgfpathcircle{\pgfpoint{0pt}{.75ex}}{1.2ex}
\pgfusepath{fill}
\pgftext[base]{\color{fg}\inserttocsectionnumber}
\end{pgfpicture}\kern1.25ex%
}%
\inserttocsection\par}
\defbeamertemplate{subsection in toc}{circle}
{\leavevmode\leftskip=2em\inserttocsubsection\par}
下面的示例文档展示了一种可能的重新定义,增加了用于部分的圆的半径,并使用了\bullet
用于子部分的圆的半径:
\documentclass{beamer}
\mode<presentation>
{
\usetheme{Warsaw}
\setbeamercovered{transparent}
}
\setbeamertemplate{section in toc}
{\leavevmode\leftskip=2ex%
\llap{%
\usebeamerfont*{section number projected}%
\usebeamercolor{section number projected}%
\begin{pgfpicture}{-1ex}{0ex}{1ex}{2ex}
\color{bg}
\pgfpathcircle{\pgfpoint{0pt}{.75ex}}{1.7ex}
\pgfusepath{fill}
\pgftext[base]{\color{fg}\inserttocsectionnumber}
\end{pgfpicture}\kern1.25ex%
}%
\inserttocsection\par}
\setbeamertemplate{subsection in toc}
{\leavevmode\leftskip=2em$\bullet$\hskip1em\inserttocsubsection\par}
\begin{document}
\begin{frame}{Outline}
\tableofcontents
\end{frame}
\section{Introduction}
\subsection{First Subsection Name}
\section{Test}
\subsection{Second Subsection}
\begin{frame}{Make Titles Informative.}
\end{frame}
\begin{frame}{Make Titles Informative.}
\end{frame}
\end{document}
如果您想要模仿ball
章节的风格,但使用\bullet
小节的风格,则必要的重新定义将如下所示:
\makeatletter
\setbeamertemplate{section in toc}
{\leavevmode\leftskip=2.75ex%
\llap{%
\normalsize%
\begin{pgfpicture}{-1ex}{-0.7ex}{1ex}{1ex}
\pgftext{\beamer@usesphere{section number projected}{tocsphere}}
\pgftext{%
\usebeamerfont*{section number projected}%
\usebeamercolor{section number projected}%
\color{fg!90!bg}%
\inserttocsectionnumber}
\end{pgfpicture}%
\kern1.25ex}%
\inserttocsection\par
}
\setbeamertemplate{subsection in toc}
{\leavevmode\leftskip=2em$\bullet$\hskip1em\inserttocsubsection\par}
\makeatother