我想在演示文稿的标题页中插入 my_background_file.png 中包含的背景图像。为什么以下代码无法正常工作?我只得到一个标题页,背景上没有任何图像。
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\title{YYYY}
\author{D.S.}
\institute{Some University}
\usepackage{transparent}
\usepackage{eso-pic}
\newcommand\BackgroundPic{%
\put(0,0){%
\parbox[b][\paperheight]{\paperwidth}{%
\vfill
\centering
{\transparent{0.4} \includegraphics[width=\paperwidth,height=\paperheight,%
keepaspectratio]{my_background_file.png}}%
\vfill
}}}
\begin{document}
\AddToShipoutPicture*{\BackgroundPic}
\titlepage
\end{document}
那有什么问题吗?
答案1
尝试这个。
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\title{YYYY}
\author{D.S.}
\institute{Some University}
\usepackage{transparent}
\usebackgroundtemplate{%
\transparent{0.4}\includegraphics[width=\paperwidth,height=\paperheight]{example-image-A}
}
\begin{document}
\titlepage
\end{document}
到更改每一帧的背景你可以尝试这个代码:
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\title{YYYY}
\author{D.S.}
\institute{Some University}
\usepackage{transparent}
\begin{document}
{%
\usebackgroundtemplate{%
\transparent{0.4}\includegraphics[width=\paperwidth,height=\paperheight]{example-image-A}}
\begin{frame}
\titlepage
\end{frame}
}
{%
\usebackgroundtemplate{%
\transparent{0.4}\includegraphics[width=\paperwidth,height=\paperheight]{example-image-B}}
\begin{frame}
One
\end{frame}
}
{%
\usebackgroundtemplate{%
\transparent{0.4}\includegraphics[width=\paperwidth,height=\paperheight]{example-image-C}}
\begin{frame}
Two
\end{frame}
}
\end{document}