我使用的是德累斯顿主题,默认情况下,它会在每张幻灯片的底部显示两行,第一行左侧包含作者姓名,右侧包含机构名称,第二行左侧包含演示文稿的标题,没有其他内容。
是否可以在第二行的右侧包含幻灯片编号,而不使用\setoutertheme{infolines}
?
答案1
添加
\setbeamertemplate{footline}%{miniframes theme}
{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
\end{beamercolorbox}
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{author in head/foot}%
\leavevmode{\usebeamerfont{author in head/foot}\insertshortauthor}%
\hfill%
{\usebeamerfont{institute in head/foot}\usebeamercolor[fg]{institute in head/foot}\insertshortinstitute}%
\end{beamercolorbox}%
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
{\usebeamerfont{title in head/foot}\insertshorttitle} \hfill \insertframenumber%
\end{beamercolorbox}%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
\end{beamercolorbox}
}
之后\usetheme{Dresden}
。这将添加一个帧编号,如下所示:
这只是对主题的另一项修改。这些主题可以在 texmf-tree 中的 beamer 目录中找到。beamer 特定宏的功能已记录在 beamer 文档中。
完整代码:
\documentclass{beamer}
\usetheme{Dresden}
\title[title]{long title}
\institute[inst]{long inst}
\setbeamertemplate{footline}%{miniframes theme}
{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
\end{beamercolorbox}
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{author in head/foot}%
\leavevmode{\usebeamerfont{author in head/foot}\insertshortauthor}%
\hfill%
{\usebeamerfont{institute in head/foot}\usebeamercolor[fg]{institute in head/foot}\insertshortinstitute}%
\end{beamercolorbox}%
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
{\usebeamerfont{title in head/foot}\insertshorttitle} \hfill \insertframenumber%
\end{beamercolorbox}%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
\end{beamercolorbox}
}
\begin{document}
\frame{1}
\end{document}
答案2
在某些情况下,您只需要在后面添加此行\useoutertheme
:
\setbeamertemplate{page number in head/foot}[framenumber]