Beamer 样式文件:如果仅从幻灯片 2 开始使用,脚注线会从幻灯片中掉出来

Beamer 样式文件:如果仅从幻灯片 2 开始使用,脚注线会从幻灯片中掉出来

我正在为 Beamer 演示文稿创建样式文件。大多数事情都很简单,但我对页脚有一些问题。特别是,我不希望标题页上有页脚,但它应该出现在所有后续幻灯片中。我基本上遵循以下方法:创建自定义 Beamer 主题。只需删除标题页的脚注

但是,我发现我的脚线与幻灯片底部没有正确对齐。它实际上掉到了下面,只有大约三分之一仍然可见。我在如何删除投影仪幻灯片标题页上的脚注。但是在这里我需要更改实际的 beamer slides tex 文件,如果可能的话我想避免这种情况。所有内容都应该在我的 *.sty 文件中定义。

我尝试找出这个问题的原因,但没有成功。有人能帮我吗?提前感谢大家提供的建议。

我尝试编写一个(不是那么)最小的工作示例来展示效果。在顶部,我定义了自定义脚注线“Ffootline”,有两个版本,第一个版本通过在所有幻灯片上显示脚注线来工作(在 MWE 中注释掉)。第二个版本显示了部分覆盖的脚注线。

\documentclass[11pt]{beamer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% DEFINE CUSTOM FOOTLINE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\Ffootline}{%
  \insertsection % The left end of the footline
  \hfill
  \insertfooter % The center
  \hfill
  \insertframenumber/\inserttotalframenumber
} % And the right end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% VERSION I: working
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \setbeamertemplate{footline}{%
%   \usebeamerfont{structure}
%   \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex]{footlinecolor}%
%     \Tiny\hspace*{4mm} \Ffootline \hspace{4mm}
%   \end{beamercolorbox}
% }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% VERSION I: end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% VERSION II: NOT working
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This removes the footline from the title page but then it is too low on the others
\setbeamertemplate{footline}
{%
  \ifnum \thepage=1 
  {
    % Don't add a Footline
  } 
  \else 
  {
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex]{footlinecolor}%
      \Tiny\hspace*{4mm} \Ffootline \hspace{4mm}
    \end{beamercolorbox}
  }
  \fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% VERSION II: END
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% STUFF sucht that MEW compiles:
\beamertemplatenavigationsymbolsempty % Supress navigation baar
% Slides Content
\title{Title Page Title}
\author{Main author,}
\institute{Our Lab}
\newcommand{\insertfooter}{Custom Footline Text - bla bla bla}
\begin{document}
%--------------
\begin{frame}
  \titlepage
\end{frame}
%--------------
\section*{Introduction}
%--------------
\begin{frame}
  \frametitle{My Project}
  Some content
\end{frame}
%--------------
\end{document}

答案1

我能想到[plain]的第一个解决方案是使用模板title page。此模板会抑制页眉和页脚,因此如何footline定义并不重要。xlr8t 没有解释是否已考虑过此选项。

在这种情况下,另一个可行的解决方案是插入一个空白的beamercolorbox标题页:

\documentclass[11pt]{beamer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% DEFINE CUSTOM FOOTLINE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\Ffootline}{%
  \insertsection % The left end of the footline
  \hfill
  \insertfooter % The center
  \hfill
  \insertframenumber/\inserttotalframenumber
} % And the right end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% VERSION I: working
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \setbeamertemplate{footline}{%
%   \usebeamerfont{structure}
%   \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex]{footlinecolor}%
%     \Tiny\hspace*{4mm} \Ffootline \hspace{4mm}
%   \end{beamercolorbox}
% }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% VERSION I: end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% VERSION II: NOT working   %<--------- Now it works
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This removes the footline from the title page but then it is too low on the others
\setbeamertemplate{footline}{%
\ifnum\thepage=1
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex]{footlinecolor}
    \end{beamercolorbox}
\else
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex]{footlinecolor}%
        \Tiny\hspace*{4mm} \Ffootline \hspace*{4mm}
    \end{beamercolorbox}
\fi}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% VERSION II: END
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% STUFF sucht that MEW compiles:
\beamertemplatenavigationsymbolsempty % Supress navigation baar
% Slides Content
\title{Title Page Title}
\author{Main author,}
\institute{Our Lab}
\newcommand{\insertfooter}{Custom Footline Text - bla bla bla}
\begin{document}
%--------------
\begin{frame}%[plain]  %<------[plain] could be another solution
  \titlepage
\end{frame}
%--------------
\section*{Introduction}
%--------------
\begin{frame}
  \frametitle{My Project}
  Some content
\end{frame}
%--------------
\begin{frame}
  \frametitle{My Project}
  Some content
\end{frame}
%--------------
\end{document}

在此处输入图片描述

答案2

我知道这个问题有点过时了,但我找到了另一个我更喜欢的解决方案。可以通过在花括号内覆盖单个框架(或框架组)的模板来自定义它们。在本例中,我仅将第一个框架设置为空:

\documentclass[11pt]{beamer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% DEFINE CUSTOM FOOTLINE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\Ffootline}{%
  \insertsection % The left end of the footline
  \hfill
  \insertfooter % The center
  \hfill
  \insertframenumber/\inserttotalframenumber
} % And the right end

% Declare constant footline
\setbeamertemplate{footline}
{%
  \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex]{footlinecolor}%
  \Tiny\hspace*{4mm} \Ffootline \hspace{4mm}
  \end{beamercolorbox}
}

%%% STUFF such that MEW compiles:
\beamertemplatenavigationsymbolsempty % Supress navigation baar
% Slides Content
\title{Title Page Title}
\author{Main author,}
\institute{Our Lab}
\newcommand{\insertfooter}{Custom Footline Text - bla bla bla}
\begin{document}
%--------------
{
  % Erase the footline on this frame
  % Made local by enclosing it in a group
  \setbeamertemplate{footline}{}
  \begin{frame}
    \titlepage
  \end{frame}
}
%--------------
\section*{Introduction}
%--------------
\begin{frame}
  \frametitle{My Project}
  Some content
\end{frame}
%--------------
\end{document}

(看Overleaf 上的一个例子

相关内容