使用新加坡主题配置 Beamer

使用新加坡主题配置 Beamer

我发现新加坡主题非常有用。但是我找不到在框架顶部放置小圆圈的方法,对于尚未讨论的幻灯片,这些小圆圈是空的,对于已讨论的幻灯片,这些小圆圈会变成黑色。我该如何放置它们?

答案1

我猜正确的做法是向 beamer 开发人员发送一个补丁,修改\slideentry(in beamerbasenavigation.sty),以便它使用三个模板 (之前、当前、之后)。

但是,这里有一个不修改任何内部宏的解决方案。

\documentclass{beamer}
\usetheme{Singapore}
\useoutertheme{miniframes}
\usepackage{etoolbox}

% a flag that tells us how the circles should be drawn
\newif\ifnavbeforecurrent
% reset the flag before every navigation bar
\pretocmd\insertnavigation{\navbeforecurrenttrue}{}{}

% change the circle drawing code so that it changes based on the flag
\defbeamertemplate*{mini frame in current subsection}{changing}[1][50]
{%
  \begin{pgfpicture}{0pt}{0pt}{0.1cm}{0.1cm}
    \pgfpathcircle{\pgfpoint{0.05cm}{0.05cm}}{0.05cm}
    \ifnavbeforecurrent
        \pgfusepath{fill,stroke}
    \else
        \pgfusepath{stroke}
    \fi
  \end{pgfpicture}%
}
\setbeamertemplate{mini frame in current subsection}[changing]

% after the circle for the current frame is drawn, change the flag
\defbeamertemplate*{mini frame}{changing}
{%
  \begin{pgfpicture}{0pt}{0pt}{0.1cm}{0.1cm}
    \pgfpathcircle{\pgfpoint{0.05cm}{0.05cm}}{0.05cm}
    \pgfusepath{fill,stroke}
  \end{pgfpicture}%
  \global\navbeforecurrentfalse
}
\setbeamertemplate{mini frame}[changing]

\begin{document}
\section{A section}
\subsection{A subsection}
\frame{...}
\frame{...}
\frame{...}
\subsection{A second subsection}
\frame{...}
\frame{...}
\frame{...}
\end{document}

结果

相关内容