使用 beamerdefs.sty 在标题上插入背景壁纸

使用 beamerdefs.sty 在标题上插入背景壁纸

我有一个.tex使用beamerdefs.sty文件的文件。我现在想在标题页上(仅)添加背景图片,但问题是,开始文档部分开始得较晚,如果我尝试在 tex 文件或文件中插入它,beamerdefs.sty它就不会出现。我\usepackage{wallpaper}已经添加了,这里是代码:

% Type of the document
\documentclass{beamer}

% elementary packages:
\usepackage{graphicx}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{eso-pic}
\usepackage{mathrsfs}
\usepackage{url}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{hyperref}
\usepackage{booktabs}
\usepackage{wallpaper}
% additional packages
\usepackage{bbm}

% packages supplied with ise-beamer:
\usepackage{cooltooltips}
\usepackage{colordef}
\usepackage{beamerdefs}
\usepackage{lvblisting}
\usepackage{eso-pic}
\usepackage{everyshi}
\usepackage{calc}
\usepackage{graphicx}
\usepackage{ifthen}

% Change the pictures here:
% logobig and logosmall are the internal names for the pictures: do not modify them. 
% Pictures must be supplied as JPEG, PNG or, to be preferred, PDF
\pgfdeclareimage[height=3cm]{logobig}{hulogo}
% Supply the correct logo for your class and change the file name to "logo". The logo will appear in the lower
% right corner:
\pgfdeclareimage[height=0.7cm]{logosmall}{logo}

% Title page outline:
% use this number to modify the scaling of the headline on title page
\renewcommand{\titlescale}{1.0}
% the title page has two columns, the following two values determine the percentage each one should get
\renewcommand{\titlescale}{1.5}
\renewcommand{\leftcol}{0.6}

% Define the title.Don't forget to insert an abbreviation instead 
% of "title for footer". It will appear in the lower left corner:
\title[title]{title}
% Define the authors:
\authora{Author\footnote[1]{footnote}} % a-c
\authorb{}
\authorc{}

% Define any internet addresses, if you want to display them on the title page:
\def\linka{}
\def\linkb{}
\def\linkc{}
% Define the institute:


\institute{\textbf{School of Business and Economics}\\
 \vskip1em

insert here\\
Chairholder: professor\\
Supervisors: another one\\
\vskip1em
\vskip1em
\definecolor{darkblue}{RGB}{21,58,96}
\textcolor{darkblue}{\textit{text blab alblal bla text}}
 \vskip1em
 \small
date and time\\
 \vskip1em
\footnotesize
\textit{$^1$insert footnote here}}
\normalsize


% Comment the following command, if you don't want, that the pdf file starts in full screen mode:
\hypersetup{pdfpagemode=FullScreen}

%Start of the document
\begin{document}

% create the title slide, layout controlled in beamerdefs.sty and the foregoing specifications
\frame[plain]{
\titlepage
}

因此这里是 beamerdefs.sty 文件:

%########################################
% Do NOT modify, unless you know what you do!

\newcommand{\authora}[1]{\def\theauthora{#1}}
\newcommand{\authorb}[1]{\def\theauthorb{#1}}
\newcommand{\authorc}[1]{\def\theauthorc{#1}}

\newcommand{\titlescale}{1.0}
\newcommand{\leftcol}{0.6}
\newcommand{\rightcol}{0.4}

\titlegraphic{\hspace{20pt}\raisebox{14pt}{\pgfuseimage{logobig}}}

% predefined commands:
\newcommand{\quantnet}{\hspace*{\fill} \raisebox{-1pt}{\includegraphics[scale=0.05]{qletlogo}}\,}

\newcommand{\BBI}[1]{\textit{#1} on BBI:\raisebox{-5pt}{\includegraphics[scale=0.11]{BBI_logo}}}

\newcounter{mexample} % define a new counter for the examples
\setcounter{mexample}{0} % initialize counter
\renewenvironment{example}{\refstepcounter{mexample}\color{isegreen}Example \themexample \par\vspace*{0.5em}}{\vspace*{0.5em}} % redefine example

% next line = with each \Section the pagecounter is reset
\let\oldSection\section
\renewcommand{\section}[1]{\oldSection{#1} \setcounter{page}{1}}%

% next line = pagecounter is not reset when a new section starts
%\newcommand{\Section}[1]{\section{#1}}

%We want no bullets or triangles
%\useitemizeitemtemplate{-}
\useitemizeitemtemplate{$\boxdot$}
\usesubitemizeitemtemplate{$\blacktriangleright$~}
\usesubsubitemizeitemtemplate{\textbullet~}

%We set the colors of the enumarte and itemize environment
\setbeamercolor{enumerate item}{fg=black}
\setbeamercolor{itemize item}{fg=navyblue}
\setbeamercolor{itemize subitem}{fg=navyblue}
\setbeamercolor{itemize subsubitem}{fg=navyblue}

% We want the example environment in green

%\renewenvironment<>{example}{\begin{originalexample}\color{isegreen}}{\end{originalexample}}

\setbeamercolor*{example text}{fg=green!40!black}
\setbeamercolor*{block body example}{fg=green!40!black}

%===========>
% Depending on your graphic file you may need to change the 3.2 and -2.8 values, 
% but the abs. difference of 0.4 is needed!
\useheadtemplate{%
\raisebox{-0.75cm}{\parbox{\textwidth}{%
\footnotesize{\color{isegray}%
\insertsection\ \leavevmode\leaders\hrule height3.2pt depth-2.8pt\hfill\kern0pt\\
hesection-\thepage}% was \thesection-\thepage}
}}}%

\usefoottemplate{% control footer layout
\raisebox{0.75cm}{\parbox{\textwidth}{\footnotesize{\color{isegray} \insertshorttitle\ \leavevmode\leaders\hrule height3.2pt depth-2.8pt\hfill\kern0pt\ \raisebox{-7pt}{\pgfuseimage{logosmall}}%
}}}}%

\usecaptiontemplate{% controls the layout of captions
\insertcaptionname~\insertcaptionnumber:~\insertcaption% 
}


\usetitlepagetemplate{
     \vbox{}
     \begin{flushleft}
       \Large\structure{{\color{isered}\scalebox{\titlescale}{\parbox{\linewidth}{\textbf{\inserttitle}}}}}%\scalebox{\titlescale}
       \vskip1em\par
     \end{flushleft}
     \begin{flushleft}
       \normalsize\theauthora\vskip0.5mm\par

       \normalsize\theauthorb\vskip0.5mm\par
       \normalsize\theauthorc\vskip2.5mm\par

     \end{flushleft}
\begin{columns}[onlytextwidth]
     \begin{column}{0.7\textwidth}
           {\normalsize\insertinstitute \\ {\color{iseblue}\href{\linka}{\linka}} \\ {\color{iseblue}\href{\linkb}{\linkb}} \\ {\color{iseblue}\href{\linkc}{\linkc}}}
     \end{column}
     \begin{column}{0.3\textwidth}
               \inserttitlegraphic % \cooltooltiptoggle{\textcolor{white}{$\boxdot$}}
     \end{column}
\end{columns}
}

\useframetitletemplate{%
     \begin{flushleft}
       \Large\structure{\color{isered}\textbf{\insertframetitle}}
       \par
     \end{flushleft}}

%no navigationbar
%deprecated: \beamertemplatenavigationsymbolsempty 
\setbeamertemplate{navigation symbols}{} 

\newcommand{\weblink}[2]{
    \href{#1}{\textcolor{linkblue}{#2}}}

\newcommand{\pointprog}[1]{
    \href{\apssplace/#1.html}{\includegraphics[height=.9em]{qletlogo} \color{magenta}\texttt{#1.xpl}}}

    \newcommand{\myprog}[2]{
    \href{#1}{\includegraphics[height=.9em]{qletlogo} \color{magenta}\texttt{#2}}}

那么我必须插入哪里\TileWallPaper{<width>}{<height>}{<filename>}才能使其工作?

非常感谢你的帮助!

答案1

您可以在包含壁纸background canvas的框架之前设置模板 \maketitle,然后再次设置模板以\ClearWallPaper从您不希望它再出现的点清除壁纸:

\documentclass{beamer}
\usepackage{wallpaper}

\title{The Title}
\author{The Author}
\institute{The Institute}

\begin{document}

\setbeamertemplate{background canvas}{\TileWallPaper{.25\paperwidth}{.25\paperheight}{ctanlion}}
\begin{frame}
\maketitle
\end{frame}

\setbeamertemplate{background canvas}{\ClearWallPaper}
\begin{frame}
test
\end{frame}

\end{document}

在此处输入图片描述

CTAN 狮子绘画由 Duane Bibby 绘制。

相关内容