在 beamer 中更改 partpage

在 beamer 中更改 partpage

我在 beamer 中找到了定义模板的一些代码。现在我正在修改它,但部分页面出现了问题。首先它是一个白色标题,所以我添加了以下代码:

\definecolor{MGreen}{RGB}{50, 102, 71}
\makeatletter
\def\ps@navigation@partpage{%
  \setbeamercolor{background canvas}{use=part title,bg=part title.bg}%
  \@nameuse{ps@navigation}}
\addtobeamertemplate{part page}{\thispagestyle{navigation@partpage}}{}
\define@key{beamerframe}{bgcolor}[]{%
  \ifx#1\@empty\else\setbeamercolor{part title}{bg=#1}\fi}
\makeatother

\setbeamercolor{part title}{bg=MGreen} % default color

现在它看起来像这样: 在此处输入图片描述

所以我想使用像马德里主题那样的白色背景颜色和绿色矩形。我还想删除包含作者和演示文稿编号的下部部分,并关闭部分页面上的编号。

有人能帮助我吗?

有一个模板代码:

\documentclass[aspectratio=169]{beamer}

    %%% YOUR PACKAGES HERE %%%
    \usepackage{comment}
    \usepackage{hyperref}
    
    %%% IMPORT PRESENTATION STYLE %%%
    % THEME OPTIONS
        
        \usetheme{Boadilla}
        \usecolortheme{default}
        \usefonttheme{professionalfonts}
        
        % colors
        
        \definecolor{MGreen}{RGB}{50, 102, 71}
        \definecolor{PGRed}{RGB}{173,17,17}
        \definecolor{PGSilver}{RGB}{200,200,200}
        \definecolor{PGBlack}{RGB}{0,0,0}
        
        % MGreen
        \setbeamercolor{frametitle}{fg=PGBlack}
        \setbeamercolor{normal text}{fg=PGBlack}
        \setbeamercolor{structure}{fg=MGreen}
        \setbeamercolor{item}{fg=MGreen}
        
        % PGRed
        \setbeamercolor{alerted text}{fg=PGRed}
        \setbeamercolor{item projected}{fg=PGRed}
        
        % white
        \setbeamercolor{title}{fg=white}
        \setbeamercolor{titlelike}{fg=white}
        \setbeamercolor{subtitle}{fg=white}
        
        % enumerate and itemize styles
        
        \setbeamertemplate{itemize item}{\bfseries\color{MGreen}\raise1pt\hbox{\donotcoloroutermaths$\bullet$}}
        \setbeamertemplate{itemize subitem}{\color{MGreen}\raise0.5pt\hbox{--}}
        \setbeamertemplate{itemize subsubitem}{\color{MGreen}\tiny\raise1.5pt\hbox{\donotcoloroutermaths$\bullet$}}
        
        \setbeamertemplate{enumerate item}{\bfseries\color{MGreen}\insertenumlabel.}
        \setbeamertemplate{enumerate subitem}{\color{MGreen}\insertsubenumlabel.}
        \setbeamertemplate{enumerate subsubitem}{\color{MGreen}\insertsubsubenumlabel.}
        \setbeamertemplate{enumerate mini template}{\insertenumlabel}
        
        
        % disable navigation
        
        \beamertemplatenavigationsymbolsempty
        
        % additional commands
        
        \newcommand*{\vcenteredhbox}[1]{\begingroup
        \setbox0=\hbox{#1}\parbox{\wd0}{\box0}\endgroup}
        
        \graphicspath{{molbeamer/}}
        
        
        \usepackage{iflang}
        \IfLanguageName{polish}{
        \newcommand{\pglogobig}{mol_logo_big}
        \newcommand{\pglogosmall}{mol_logo_small}
        }{
        \newcommand{\pglogobig}{mol_logo_big}
        \newcommand{\pglogosmall}{mol_logo_small}
        }
        
        
        % FRAME TITLE LOGO
        \addtobeamertemplate{frametitle}{\vcenteredhbox{\includegraphics[height=7mm]{logo}}\bfseries}{}
        
        
        \newcommand{\pgtitleframe}{{
        % TITLE PAGE
        
        \setbeamercolor{background canvas}{bg=MGreen}
        \setbeamercolor{title}{fg=white}
        \setbeamercolor*{date}{fg=white}
        \setbeamercolor*{author}{fg=white}
        
        \setbeamertemplate{footline}{}
        
        \begin{frame}[noframenumbering]
        \centering
        \vspace{1cm}
        \includegraphics[height=3.5cm]{\pglogobig}
        \vspace{5mm}
        \maketitle
        \end{frame}
        }}
        
        % PART PAGE
        \makeatletter
        \def\ps@navigation@partpage{%
          \setbeamercolor{background canvas}{use=part title,bg=part title.bg}%
          \@nameuse{ps@navigation}}
        \addtobeamertemplate{part page}{\thispagestyle{navigation@partpage}}{}
        \define@key{beamerframe}{bgcolor}[]{%
          \ifx#1\@empty\else\setbeamercolor{part title}{bg=#1}\fi}
        \makeatother
        
        \setbeamercolor{part title}{bg=MGreen} % default color
        
        \newcommand{\pglastframe}{{
        % LAST PAGE
        
        \setbeamercolor{background canvas}{bg=MGreen}
        \setbeamercolor{title}{fg=white}
        \setbeamercolor*{date}{fg=white}
        \setbeamercolor*{author}{fg=white}
        
        \setbeamertemplate{footline}{}
        
        \begin{frame}[noframenumbering]
        \centering
        \vspace{1cm}
        \includegraphics[height=5cm]{\pglogobig}
        \end{frame}
        }}
    
    
    %%% YOUR OPTIONS HERE %%%
    
    \title[Presentation]{Presentation Beamer Template}
    \subtitle{Beamer rocks}
    \author{Author}
    \date{ }
    
    %%% DOCUMENT BEGINS HERE %%%
    
    \begin{document}
    
    %%% TITLE PAGE %%%
    \pgtitleframe
    
    %%% PRESENTATION HERE %%%
    
    \part{First part of this presentation}
    \frame{\partpage}
    
    \begin{frame}{The only slide}
        This is My University Beamer \LaTeX template.
    
        \pause
    
        \begin{itemize}
        \item official colors
        \item Itemize, enumerate like in official template
            \begin{enumerate}
            \item It
            \item is
            \item great!
            \end{enumerate}
        \item Nice first and last pages
        \item English language support
        \end{itemize}
    \end{frame}
    
    \begin{frame}
        \begin{block}{B}
        block
        \end{block}
        \begin{alertblock}{A}
        alert block
        \end{alertblock}
        \begin{exampleblock}{E}
        example block
        \end{exampleblock}
    \end{frame}
    
    %%% LAST PAGE %%%
    \pglastframe
    
    \end{document}

答案1

使用plain框架删除脚注线并noframenumbering关闭编号选项:

\documentclass{beamer}

\makeatletter
% THEME OPTIONS

\usetheme{Boadilla}
\usecolortheme{default}
\usefonttheme{professionalfonts}

% colors

\definecolor{MGreen}{RGB}{50, 102, 71}
\definecolor{PGRed}{RGB}{173,17,17}
\definecolor{PGSilver}{RGB}{200,200,200}
\definecolor{PGBlack}{RGB}{0,0,0}

% MGreen
\setbeamercolor{frametitle}{fg=PGBlack}
\setbeamercolor{normal text}{fg=PGBlack}
\setbeamercolor{structure}{fg=MGreen}
\setbeamercolor{item}{fg=MGreen}

% PGRed
\setbeamercolor{alerted text}{fg=PGRed}
\setbeamercolor{item projected}{fg=PGRed}

% white
\setbeamercolor{title}{fg=white}
\setbeamercolor{titlelike}{fg=white}
\setbeamercolor{subtitle}{fg=white}

% enumerate and itemize styles

\setbeamertemplate{itemize item}{\bfseries\color{MGreen}\raise1pt\hbox{\donotcoloroutermaths$\bullet$}}
\setbeamertemplate{itemize subitem}{\color{MGreen}\raise0.5pt\hbox{--}}
\setbeamertemplate{itemize subsubitem}{\color{MGreen}\tiny\raise1.5pt\hbox{\donotcoloroutermaths$\bullet$}}

\setbeamertemplate{enumerate item}{\bfseries\color{MGreen}\insertenumlabel.}
\setbeamertemplate{enumerate subitem}{\color{MGreen}\insertsubenumlabel.}
\setbeamertemplate{enumerate subsubitem}{\color{MGreen}\insertsubsubenumlabel.}
\setbeamertemplate{enumerate mini template}{\insertenumlabel}


% disable navigation

\beamertemplatenavigationsymbolsempty

% additional commands

\newcommand*{\vcenteredhbox}[1]{\begingroup
\setbox0=\hbox{#1}\parbox{\wd0}{\box0}\endgroup}

\graphicspath{{molbeamer/}}


\usepackage{iflang}
\IfLanguageName{polish}{
\newcommand{\pglogobig}{mol_logo_big}
\newcommand{\pglogosmall}{mol_logo_small}
}{
\newcommand{\pglogobig}{mol_logo_big}
\newcommand{\pglogosmall}{mol_logo_small}
}


% FRAME TITLE LOGO
\addtobeamertemplate{frametitle}{\vcenteredhbox{\includegraphics[height=7mm]{logo}}\bfseries}{}


\newcommand{\pgtitleframe}{{
% TITLE PAGE

\setbeamercolor{background canvas}{bg=MGreen}
\setbeamercolor{title}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{author}{fg=white}

\setbeamertemplate{footline}{}

\begin{frame}[noframenumbering]
\centering
\vspace{1cm}
\includegraphics[height=3.5cm]{\pglogobig}
\vspace{5mm}
\maketitle
\end{frame}
}}

\setbeamercolor{part title}{bg=MGreen} % default color

\newcommand{\pglastframe}{{
% LAST PAGE

\setbeamercolor{background canvas}{bg=MGreen}
\setbeamercolor{title}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{author}{fg=white}

\setbeamertemplate{footline}{}

\begin{frame}[noframenumbering]
\centering
\vspace{1cm}
\includegraphics[height=5cm]{\pglogobig}
\end{frame}
}}

\makeatother

\AtBeginPart{\begin{frame}[plain,noframenumbering]
\usebeamertemplate{part page}
\end{frame}}

\begin{document}

\part{Part title}

\begin{frame}
  abc
\end{frame}

\end{document}

在此处输入图片描述

相关内容