在具有多张幻灯片的投影机中进行帧编号对齐

在具有多张幻灯片的投影机中进行帧编号对齐

使用带有 wuerzburg 外部和倒角内部主题的 beamer,我创建了一个包含 100 多张幻灯片的长演示文稿。9 张幻灯片之后,帧编号未正确对齐,总帧数可见,但当前帧数在其上方,我没有找到正确对齐它的方法。

在 MWE 的最后 30 帧中尝试了以下解决方案:在 Beamer 中向所有幻灯片添加页脚文本但是这个删除了原始的 footline 背景 (colortheme)。如果你取消注释,\usecolortheme{shark}就会更清楚地看到当前帧号消失的原因。

\documentclass{beamer}
\mode<beamer>{
    \useoutertheme[glossy]{wuerzburg}
    \useinnertheme[shadow,outline]{chamfered}
    \usecolortheme{shark}
}
\setbeamertemplate{navigation symbols}{}

\usepackage{blindtext}

\begin{document}
\begin{frame}[allowframebreaks]{Original footline}
\blindtext[100]
\end{frame}

\setbeamertemplate{footline}[text line]{%
  \parbox{\linewidth}{\vspace*{-8pt}some text\hfill\insertframenumber/\inserttotalframenumber}
}

\begin{frame}[allowframebreaks]{Different footline}
\blindtext[50]
\end{frame}
\end{document}

答案1

假设你使用https://github.com/pmagwene/beamer-theme-collection/blob/master/beamerouterthemewuerzburg.sty您可以像这样更改 footline 定义:

\documentclass{beamer}
\useoutertheme[glossy]{wuerzburg}
\useinnertheme[shadow,outline]{chamfered}
\usecolortheme{shark}
\setbeamertemplate{navigation symbols}{}

\usepackage{blindtext}


\makeatletter
\setbeamertemplate{footline}{%
  \ifbeamer@wuerzburg@nofootline
  \else
  \leavevmode%
  \pgfuseshading{beamer@bottomshade}
  \ifbeamer@wuerzburg@glossy%
    \pgfuseshading{beamer@headfootshade}
    \vskip-3.5ex
    \hbox{%
      \begin{beamercolorbox}[wd=.8\paperwidth,ht=2.25ex,dp=1ex,left,ignorebg]{headfoot}%
        \usebeamerfont{author in head/foot}%
        \hspace*{3.5ex}%
        \insertshortauthor{}%
        \beamerwuerzburgthemeadddelimiter{\insertshortinstitute}%
        \beamerwuerzburgthemeadddelimiter{\insertshortdate}%
      \end{beamercolorbox}%
      \begin{beamercolorbox}[wd=.2\paperwidth,ht=2.25ex,dp=1ex,right,ignorebg]{headfoot}%
        \usebeamerfont{date in head/foot}%
        \insertframenumber{} / \if\thelastframecounter0\inserttotalframenumber\else\thelastframecounter\fi \hspace*{3.5ex}
      \end{beamercolorbox}}
  \else%
    \hbox{%
      \begin{beamercolorbox}[wd=.8\paperwidth,ht=2.25ex,dp=1ex,left]{headfoot}%
        \usebeamerfont{author in head/foot}%
        \hspace*{3.5ex}%
        \insertshortauthor{}%
        \beamerwuerzburgthemeadddelimiter{\insertshortinstitute}%
        \beamerwuerzburgthemeadddelimiter{\insertshortdate}%
      \end{beamercolorbox}%
      \begin{beamercolorbox}[wd=.2\paperwidth,ht=2.25ex,dp=1ex,right]{headfoot}%
        \usebeamerfont{date in head/foot}%
        \insertframenumber{} / \if\thelastframecounter0\inserttotalframenumber\else\thelastframecounter\fi \hspace*{3.5ex}
      \end{beamercolorbox}}
    \fi%
  \vskip0pt%
  \fi
}
\makeatother

\begin{document}

\begin{frame}[allowframebreaks]{Original footline}
\blindtext[100]
\end{frame}

\end{document}

在此处输入图片描述

相关内容