如何在主题模板中添加帧编号“5/12”样式?

如何在主题模板中添加帧编号“5/12”样式?

我有一个很长的标题,所以我选择Amsterdam主题对于beamer包。但是,我还需要显示帧数“frame/fromTotalFrames”样式。

如何在页脚左侧添加框架编号,同时使标题居中?

主题代码:

\useoutertheme[footline=authortitle]{miniframes}
\useinnertheme{circles}
\usecolortheme{whale}
\usecolortheme{orchid}

\definecolor{beamer@blendedblue}{rgb}{0.137,0.466,0.741}

\setbeamercolor{structure}{fg=beamer@blendedblue}
\setbeamercolor{titlelike}{parent=structure}
\setbeamercolor{frametitle}{fg=black}
\setbeamercolor{title}{fg=black}
\setbeamercolor{item}{fg=black}

\setbeamertemplate{headline}
{%
  \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
  \end{beamercolorbox}
  \begin{beamercolorbox}{section in head/foot}
    \vskip2pt\insertsectionnavigationhorizontal{\paperwidth}{}{}\vskip2pt
  \end{beamercolorbox}%
  \ifbeamer@theme@subsection%
    \begin{beamercolorbox}[colsep=1.5pt]{middle separation line head}
    \end{beamercolorbox}
    \begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
      \usebeamerfont{subsection in head/foot}\insertsubsectionhead
    \end{beamercolorbox}%
  \fi%
  \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
  \end{beamercolorbox}
}
\mode
<all>

一些示例框架:

\documentclass{beamer}

\usepackage{beamerthemesplit}
\usetheme{Amsterdam} 
\usepackage[utf8]{inputenc}

\title{General Theory of Relativity is a long Title\\
for normal Footers}
\author{Albert Einstein}
\date{April 2, 1922}

\begin{document}

\frame{\titlepage}

%%%
\section[Overview]{}
%\subsection{Layout}
\begin{frame}
\begin{itemize}
\item Here comes the Figure
\end{itemize}
\end{frame}

%\subsection{Agenda}
\frame{\tableofcontents}
%%%


%%%
\section{Motivation}
\begin{frame}{Theory is practical}
\begin{itemize}
\item Here come the reasons
\end{itemize}
\end{frame}
%%%


%%%
\section[Review]{Review of casual theory}
\subsection{classic Theories}
\begin{frame}{Which is Eligible?}
Newton, Lagrange, etc.
\end{frame}

\section[Review]{Review of casual theory}
\subsection{classic Theories}
\begin{frame}{Which is Eligible?}
Goethe, Dasgupta etc.
\end{frame}

\end{document}

答案1

适当地重新定义footline模板;在下面的代码中我使用了三个beamercolorboxes;一个用于作者,另一个用于标题,第三个用于框架编号;请根据需要随意调整宽度:

\documentclass{beamer}

\usepackage{beamerthemesplit}
\usetheme{Amsterdam} 
\usepackage[utf8]{inputenc}

\title{General Theory of Relativity is a long Title\\
for normal Footers}
\author{Albert Einstein}
\date{April 2, 1922}

\makeatletter
  \defbeamertemplate*{footline}{myminiframes theme}
  {%
    \begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
    \end{beamercolorbox}
    \hbox{%
    \begin{beamercolorbox}[wd=.1\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm,center]{title in head/foot}%
      {\usebeamerfont{author in head/foot}\usebeamercolor[fg]{author in head/foot}\insertframenumber/\inserttotalframenumber}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.75\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil,center]{title in head/foot}%
      \leavevmode{\usebeamerfont{title in head/foot}\insertshorttitle}%
    \end{beamercolorbox}%
       \begin{beamercolorbox}[wd=.15\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm]{title in head/foot}%
      {\usebeamerfont{author in head/foot}\usebeamercolor[fg]{author in head/foot}\insertshortauthor}
    \end{beamercolorbox}%
  }%
    \begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
    \end{beamercolorbox}
  }
\makeatother

\begin{document}

\frame{\titlepage}

%%%
\section[Overview]{}
%\subsection{Layout}
\begin{frame}
\begin{itemize}
\item Here comes the Figure
\end{itemize}
\end{frame}

%\subsection{Agenda}
\frame{\tableofcontents}
%%%


%%%
\section{Motivation}
\begin{frame}{Theory is practical}
\begin{itemize}
\item Here come the reasons
\end{itemize}
\end{frame}
%%%


%%%
\section[Review]{Review of casual theory}
\subsection{classic Theories}
\begin{frame}{Which is Eligible?}
Newton, Lagrange, etc.
\end{frame}

\section[Review]{Review of casual theory}
\subsection{classic Theories}
\begin{frame}{Which is Eligible?}
Goethe, Dasgupta etc.
\end{frame}

\end{document}

脚注线的图像:

在此处输入图片描述

当然你也可以把相关代码放进去:

  \defbeamertemplate*{footline}{myminiframes theme}
  {%
    \begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
    \end{beamercolorbox}
    \hbox{%
    \begin{beamercolorbox}[wd=.1\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm,center]{title in head/foot}%
      {\usebeamerfont{author in head/foot}\usebeamercolor[fg]{author in head/foot}\insertframenumber/\inserttotalframenumber}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.75\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil,center]{title in head/foot}%
      \leavevmode{\usebeamerfont{title in head/foot}\insertshorttitle}%
    \end{beamercolorbox}%
       \begin{beamercolorbox}[wd=.15\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm]{title in head/foot}%
      {\usebeamerfont{author in head/foot}\usebeamercolor[fg]{author in head/foot}\insertshortauthor}
    \end{beamercolorbox}%
  }%
    \begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
    \end{beamercolorbox}
  }

在文件中beamerthemeAmsterdam.sty而不是在您的.tex文件中(在您不使用的 .sty 文件中\makeatletter\makeatother)。

相关内容