4

Is it possible to change the half of the beamer frame background color perfectly (no margins), as shown in the picture: enter image description here without using the above image as background. Maybe by using tikz or something.

lRadha
  • 220
  • 1
  • 11

2 Answers2

6

Thanks to @AlexG

using \setbeamertemplate{background canvas}{}

The Minimal file:

\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}

enter image description here

OR:

\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}
M.Ahmadi
  • 1,477
4

With TikZ it is easily done:

\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}

enter image description here

AlexG
  • 54,894