Beamer中的footnote被footline遮盖住,如何解决?

发布于 2022-06-22 21:09:14

理想效果:

  1. 内容页(第3、4页)headline footline显示完整;
  2. 标题页(第1页)、目录页 (第2页)不出现headline和footline

附件 (里面有logo和第一页的图片)

MWE.zip

问题描述

footline和headline所放位置产生的这种遮盖冲突:

1. 如果将headline和footlinne命令放在maketitle和tableofcontents后面 如图所示(对应下方MWE),会导致footline显示不完整

image

最小工作示例(MWE)

%%%%% Xelatex

\documentclass[10pt,aspectratio=169]{beamer}
\usepackage{color}
\usepackage{ctex} 

\usetheme[]{Pittsburgh}

\definecolor{green}{RGB}{77,124,44}
\setbeamercolor{footline color}{fg=black,bg=green!20}
\setbeamercolor{headline color}{fg=red,bg=green!50}
\setbeamercolor{symbol color}{fg=green}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%设置标题、作者、机构等信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title[beamer short title]{\vspace{2cm}\newline \textbf{Beamer template for presentations}} 
\author[Trump]{Donald J. Trump}
\institute{University}
\date{2016}

\begin{document}
    {
        
        \logo{\includegraphics[scale=0.25]{logo}\hspace{\dimexpr\paperwidth-1.8cm}\vspace{-0cm}}
        
        \usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\textheight,keepaspectratio=true]{head}}
        
        
        \frame{\titlepage}
    }

\begin{frame}{Outline}
    \tableofcontents
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%设置headline  显示各章主题
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{headline}
{ 
    \begin{beamercolorbox}[wd=\paperwidth,center]{headline color}%
        \usebeamerfont{title in head/foot}
        \insertsectionnavigationhorizontal{\dimexpr\paperwidth-2cm}{}{}
    \end{beamercolorbox}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%设置footline为带底色  显示页码、作者简短姓名、标题简短姓名
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setbeamertemplate{footline}{
    
    \begin{beamercolorbox}[wd=\paperwidth, ht=2.25ex, dp=1ex, leftskip=0pt, rightskip=10pt]{footline color}{
            \insertshortauthor  \hfill \insertshorttitle \hfill \insertframenumber/\inserttotalframenumber}
    \end{beamercolorbox}%
}

\section{section1}
        \begin{frame}
            Bla bla bla \footnote{footnote1} Ble ble ble\footnote{footnote2} 
        \end{frame}
    
\section{section2}        
\begin{frame}
    内容...
\end{frame}
    \end{document}
    

2. 如果将headline和footlinne命令放在maketitle和tableofcontents之前 如图所示(对应下方MWE),内容页(第3、4页)footline显示完整,但是标题页(第1页)、目录页 (第2页)也出现了headline和footline(这是作者不想要的)。

image

image

最小工作示例(MWE)

%%%%% Xelatex

\documentclass[10pt,aspectratio=169]{beamer}
\usepackage{color}
\usepackage{ctex} 

\usetheme[]{Pittsburgh}

\definecolor{green}{RGB}{77,124,44}
\setbeamercolor{footline color}{fg=black,bg=green!20}
\setbeamercolor{headline color}{fg=red,bg=green!50}
\setbeamercolor{symbol color}{fg=green}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%设置headline  显示各章主题
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{headline}
{ 
    \begin{beamercolorbox}[wd=\paperwidth,center]{headline color}%
        \usebeamerfont{title in head/foot}
        \insertsectionnavigationhorizontal{\dimexpr\paperwidth-2cm}{}{}
    \end{beamercolorbox}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%设置footline为带底色  显示页码、作者简短姓名、标题简短姓名
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setbeamertemplate{footline}{
    
    \begin{beamercolorbox}[wd=\paperwidth, ht=2.25ex, dp=1ex, leftskip=0pt, rightskip=10pt]{footline color}{
            \insertshortauthor  \hfill \insertshorttitle \hfill \insertframenumber/\inserttotalframenumber}
    \end{beamercolorbox}%
}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%设置标题、作者、机构等信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title[beamer short title]{\vspace{2cm}\newline \textbf{Beamer template for presentations}} 
\author[Trump]{Donald J. Trump}
\institute{University}
\date{2016}

\begin{document}
    {
        
        \logo{\includegraphics[scale=0.25]{logo}\hspace{\dimexpr\paperwidth-1.8cm}\vspace{-0cm}}
        
        \usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\textheight,keepaspectratio=true]{head}}
        
        
        \frame{\titlepage}
    }

\begin{frame}{Outline}
    \tableofcontents
\end{frame}




\section{section1}
        \begin{frame}
            Bla bla bla \footnote{footnote1} Ble ble ble\footnote{footnote2} 
        \end{frame}
    
\section{section2}        
\begin{frame}
    内容...
\end{frame}
    \end{document}
    

查看更多

关注者
0
被浏览
3k
1 个回答
寄存器
寄存器 2022-06-24
这家伙很懒,什么也没写!

个人建议:

  1. 在导言区进行格式调整,也就是说将以下代码置于导言区:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%设置headline  显示各章主题
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{headline}
{ 
    \begin{beamercolorbox}[wd=\paperwidth,center]{headline color}%
        \usebeamerfont{title in head/foot}
        \insertsectionnavigationhorizontal{\dimexpr\paperwidth-2cm}{}{}
    \end{beamercolorbox}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%设置footline为带底色  显示页码、作者简短姓名、标题简短姓名
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setbeamertemplate{footline}{
    
    \begin{beamercolorbox}[wd=\paperwidth, ht=2.25ex, dp=1ex, leftskip=0pt, rightskip=10pt]{footline color}{
            \insertshortauthor  \hfill \insertshorttitle \hfill \insertframenumber/\inserttotalframenumber}
    \end{beamercolorbox}%
}
  1. 如果在Beamer中的某一帧不需要页眉页脚,可以对frame命令或环境使用[plain]可选项,如:
\frame[plain,noframenumbering]{\titlepage}

\begin{frame}[plain,noframenumbering]{Outline}
  \tableofcontents
\end{frame}

其中的[noframenumbering]选项用于停止该帧计数。

PS.建议在命令行用texdoc beamer打开其说明书,通读后按Beamer的逻辑进行工作,而不是简单的以结果导向写代码。

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览