我使用信息线作为外部主题,我很喜欢它。我想只显示当前幻灯片编号,而不显示总幻灯片编号。
我找到了 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}