答案1
谢谢@AlexG
使用\setbeamertemplate{background canvas}{}
最小文件:
\documentclass{beamer}
\usepackage{tikz}
\setbeamertemplate{background canvas}{\begin{tikzpicture}
\useasboundingbox (0,0) rectangle (\paperwidth,\paperheight);
\fill [color=orange!80] (0.5\paperwidth,0) rectangle (\paperwidth,\paperheight);
\end{tikzpicture}}
\begin{document}
\begin{frame}
test
\end{frame}
\setbeamertemplate{background canvas}{}
\begin{frame}
Not background
\end{frame}
\end{document}
或者:
\documentclass{beamer}
\usepackage{tikz}
\setbeamertemplate{background canvas}{\begin{tikzpicture}[remember picture,overlay]
\fill[orange!80] (current page.north east) rectangle (current page.south);
\end{tikzpicture}}
\begin{document}
\begin{frame}
test
\end{frame}
\setbeamertemplate{background canvas}{}
\begin{frame}
Not background
\end{frame}
\end{document}
答案2
使用 TikZ 可以轻松完成:
\documentclass{beamer}
\usepackage{tikz}
\usepackage{xsavebox}
\setbeamertemplate{background}{\xusebox{graphics for bg}}
\begin{document}
\begin{xlrbox}{graphics for bg}
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle (\paperwidth,\paperheight);
\definecolor{bgcolor}{rgb}{1,0.753,0}
\fill [color=bgcolor] (0.5\paperwidth,0) rectangle (\paperwidth,\paperheight);
\end{tikzpicture}
\end{xlrbox}
\begin{frame}
Slide 1
\end{frame}
\begin{frame}
Slide 2
\end{frame}
\begin{frame}
Slide 3
\end{frame}
\end{document}