![Beamer:页脚显示当前幻灯片编号但没有总幻灯片编号;如何修改?](https://linux22.com/image/289321/Beamer%EF%BC%9A%E9%A1%B5%E8%84%9A%E6%98%BE%E7%A4%BA%E5%BD%93%E5%89%8D%E5%B9%BB%E7%81%AF%E7%89%87%E7%BC%96%E5%8F%B7%E4%BD%86%E6%B2%A1%E6%9C%89%E6%80%BB%E5%B9%BB%E7%81%AF%E7%89%87%E7%BC%96%E5%8F%B7%EF%BC%9B%E5%A6%82%E4%BD%95%E4%BF%AE%E6%94%B9%EF%BC%9F.png)
我使用信息线作为外部主题,我很喜欢它。我想只显示当前幻灯片编号,而不显示总幻灯片编号。
我找到了 Gonzalo Medina 提供的以下答案。非常好。
但是,我怎样才能从 footline 左侧面板中删除 0,如下图所示。
\documentclass{beamer}
\usetheme{Warsaw}
\useoutertheme{infolines}
\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~~\beamer@ifempty{\insertshortinstitute}{}{(\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\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
\begin{document}
\begin{frame}Test\end{frame}
\begin{frame}Test\end{frame}
\begin{frame}Test\end{frame}
\end{document}
答案1
事实上,“0”并不是一个“0”,而是一个空括号。要删除它,可以定义一个机构,\institute{where ever you want to be}
或者使用例如这样的方法:
\documentclass{beamer}
\usetheme{Warsaw}
\useoutertheme{infolines}
\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
\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\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
\begin{document}
\begin{frame}Test\end{frame}
\begin{frame}Test\end{frame}
\begin{frame}Test\end{frame}
\end{document}