如何从 Beamer Slide 中排除幻灯片总数

如何从 Beamer Slide 中排除幻灯片总数

这是我的 Beamer 幻灯片的 MWE:

\documentclass[compress]{beamer}

\usetheme{Madrid}
\usecolortheme{seagull}

\setbeamertemplate{navigation symbols}{}

\title[Name of Presentation Slides]{Name}
\author[Author A and Author B]{Author A and Author B}
\date[September 20, 2017]{September 20, 2017}

\begin{document}

\begin{frame}
\frametitle{First Slide}
\textbf{Letters}
\begin{itemize}
    \item A
    \item B
    \item C
\end{itemize}

\end{frame}

\end{document}

我想在底部栏保留相同的格式,但仅排除幻灯片总数,以便仅显示当前幻灯片。

我针对这些问题尝试了以下解决方案(Beamer:没有总页数的页码Beamer 帧数(无总数),但它们从来没有正常工作过,总是以某种方式修改底部栏的其他部分。

1.

\setbeamertemplate{footline}
    {\begin{beamercolorbox}[sep=1ex]{author in head/foot}
      \rlap{\textit{\insertshorttitle}}\hfill\insertauthor\hfill\llap{\insertframenumber}%
      \end{beamercolorbox}%
}

2.

\setbeamertemplate {footline}{\quad\hfill\insertframenumber\strut\quad}

3.

\setbeamertemplate{footline}{% 
  \hfill% 
  \usebeamercolor[fg]{page number in head/foot}% 
  \usebeamerfont{page number in head/foot}% 
  \insertframenumber%
  %\,/\,\inserttotalframenumber
  \kern1em\vskip2pt% 
}

我的情况该做什么?

答案1

马德里主题使用了信息线外部主题的脚注线,您可以像这样重新定义它:

\documentclass[compress]{beamer}

\usetheme{Madrid}
\usecolortheme{seagull}

\setbeamertemplate{navigation symbols}{}

\title[Name of Presentation Slides]{Name}
\author[Author A and Author B]{Author A and Author B}
\date[September 20, 2017]{September 20, 2017}

\makeatletter
\setbeamertemplate{footline}{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor\expandafter\ifblank\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
    \insertframenumber{}%
%     / \inserttotalframenumber
    \hspace*{2ex} 
  \end{beamercolorbox}}%
  \vskip0pt%
}
\makeatother

\begin{document}

\begin{frame}
\frametitle{First Slide}
\textbf{Letters}
\begin{itemize}
    \item A
    \item B
    \item C
\end{itemize}

\end{frame}

\end{document}

在此处输入图片描述


从 beamer v. 3.49 开始,新的 beamer 模板page number in head/foot将其简化为:

\documentclass[compress]{beamer}

\usetheme{Madrid}
\setbeamertemplate{page number in head/foot}[framenumber]

\begin{document}

\begin{frame}
\end{frame}

\end{document}

相关内容