答案1
将以下内容添加到您的序言中。
\definecolor{lightgr}{rgb}{0.7 0.7 0.7}
\makeatletter
\newcount\beamer@sectionstartframe
\newcount\beamer@sectionendframe
\beamer@sectionstartframe=1
\apptocmd{\beamer@section}{\addtocontents{nav}{\protect\headcommand{%
\protect\beamer@sectionframes{\the\beamer@sectionstartframe}{\the\c@framenumber}}}}{}{}
\apptocmd{\beamer@section}{\beamer@sectionstartframe=\c@framenumber\advance\beamer@sectionstartframe by1\relax}{}{}
\AtEndDocument{\immediate\write\@auxout{\string\@writefile{nav}%
{\noexpand\headcommand{\noexpand\beamer@sectionframes{\the\beamer@sectionstartframe}{\the\c@framenumber}}}}}{}{}
\def\beamer@startframeofsection{1}
\def\beamer@endframeofsection{1}
\def\beamer@sectionframes#1#2{%
\ifnum\c@framenumber<#1%
\else%
\ifnum \c@framenumber>#2%
\else%
\gdef\beamer@startframeofsection{#1}%
\gdef\beamer@endframeofsection{#2}%
\fi%
\fi%
}
\newcommand\insertsectionstartframe{\beamer@startframeofsection}
\newcommand\insertsectionendframe{\beamer@endframeofsection}
\def\beamertextwidth{\dimexpr 0.875 \textwidth\relax}
\makeatother
\addtobeamertemplate{footline}{%
\color{lightgr}% to color the progressbar
\rlap{\rule{\numexpr (\insertframenumber-\insertsectionstartframe)+1 \dimexpr \beamertextwidth/(\insertsectionendframe -\insertsectionstartframe+1) \relax}{3pt}}%
}%
上述代码应在每张幻灯片的页脚中创建一个部分进度条。请注意,如果您在环境中创建新的框架,则上述代码可以正常工作AtBeginSection
。