# How extend beamertemplate{background}?

I am writing a custom beamer theme. In one of my theme .sty files I am using:

\setbeamertemplate{background}{
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\fill[color=greenCiti] (0,0) rectangle(\the\paperwidth,0.75);
\node at (0.7,9.2) {\includegraphics{logo-citi-small.png}};
\node at (1.0,0.375) {\includegraphics[width=1.5cm]{logo-univ.png}};
\node at (3.5,0.375) {\includegraphics[width=3.2cm]{logo-ra.png}};
\node at (11.6,0.36) {\includegraphics[width=2.5cm]{logo-insa.png}};
\end{tikzpicture}
}


Now I need to extend this property, in order to add a fourth image in the top right corner of my slides but only for one document using the theme and thus not in the theme file itself.

I.e I want to add a fourth line such as:

\node at (6.6,5.2) {\includegraphics[width=2cm]{fig/logo-bull.png}};


How should I achieve this?

-

You can use \setbeamertemplate{background}...} in the document itself. Here I have used a background picture.

\setbeamertemplate{background}{%
\tikz[remember picture]\node[inner sep=0pt,outer sep=0pt,opacity=0.4] at (current page.center) {\includegraphics[width=\paperwidth,height=\paperheight]{background1}};
}


Replace the contents of setbeamertemplate above with relevant code for the background and replace the theme in the below code with yours.

Full code:

\documentclass[compress]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}

\title{There Is No Largest Prime Number}
\date[ISPN ’80]{27th International Symposium of Prime Numbers}
\author[Euclid]{Euclid of Alexandria \texttt{euclid@alexandria.edu}}

\setbeamertemplate{background}{%
\tikz[remember picture]\node[inner sep=0pt,outer sep=0pt,opacity=0.4] at (current page.center) {\includegraphics[width=\paperwidth,height=\paperheight]{background1}};
}

\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{First section}
\subsection{1}

\begin{frame}
\frametitle{There Is No Largest Prime Number}
\framesubtitle{The proof uses \textit{reductio ad absurdum}.}
\begin{theorem}
There is no largest prime number. \end{theorem}
\end{frame}

\end{document}


-
Thanks for you answer, but what I need is a way to add a picture on top of the existing background and not to replace it –  Manuel Selva Mar 21 '14 at 8:22
@ManuelSelva This did not replace any thing. If you show your code for \setbeamertemplate{background}{, it will be easy for answering specifically. Can you please add it to the question? –  Harish Kumar Mar 21 '14 at 22:36
Sorry for vague question, I updated it –  Manuel Selva Mar 22 '14 at 16:44
did you saw my question's update ? –  Manuel Selva Mar 24 '14 at 10:13