如何调整投影仪中自定义背景的定位?

如何调整投影仪中自定义背景的定位?

我正在使用 beamer 的logo命令为我的演示文稿使用自定义背景(下面的 MWE)。虽然它似乎运行得非常完美,但使用的图像右侧有一点空白(橙色条应该填满整个框架的宽度;除非您在浏览器窗口外打开它,否则这在我的下图中并不明显)。

我该如何修复这个问题?我尝试在命令\hspace{}前插入\includegraphics{},但这似乎在 内不起作用\logo{}。我能以某种方式将图像“刷新”到右侧吗?非常感谢您的建议!

\documentclass{beamer}

\begin{document}
\logo{\includegraphics[height=\paperheight]{ebs.pdf}}

\begin{frame}{Frame title}{Frame subtitle}
Lorem ipsum...
\end{frame}

\end{document}

投影机输出

答案1

在这种情况下,由于您需要图片覆盖整个页面,因此TiKZ建议使用(尽管它需要运行两次)。然后您可以通过命令将此图片添加到您的模板中\addtobeamertemplate。请参阅以下实现:

\documentclass{beamer}
\usepackage{tikz}
\begin{document}

\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center) {\includegraphics[height=\paperheight,width=\paperwidth]{ebs.pdf}};
\end{tikzpicture}}
\begin{frame}{Frame title}{Frame subtitle}
Lorem ipsum...
\end{frame}

\begin{frame}{Frame title}{Frame subtitle}
Lorem ipsum...
\end{frame}
\end{document}

这给出了所需的结果(放大浏览器外部即可看到)。

在此处输入图片描述

另一种可能性是使用\usebackgroundtemplate序言中的命令使其全局化(甚至在标题页中,正如 OP 在其评论中所要求的那样)。请参阅以下 MWE:

\documentclass{beamer}
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{ebs.pdf}} 

\title{The title}
\author[The author]{The Author}
\institute[Inst.]{The Institute}
\date{\today}
\begin{document}
\begin{frame}
\maketitle
\end{frame}

\begin{frame}{Frame title}{Frame subtitle}
Lorem ipsum...
\end{frame}

\begin{frame}{Frame title}{Frame subtitle}
Lorem ipsum...
\end{frame}
\end{document}

现在的结果是:

在此处输入图片描述

相关内容