# setbackgroundtemplate on title page within custom theme file

I am working on a presentation theme for use with conference presentations. Most of our powerpoint themes use some type of background image on the first (title) slide, which I am trying to reproduce.

I can accomplish what I want by using

\usetheme{Mytheme}
\begin{document}
{
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{MyBackground.jpg}}
\frame{\titlepage}
}
% Etc etc
\end{document}


This appears as I expect, with the image behind the presentation title, and only on the title slide.

What I want to do is move the use of the backgroundtemplate command in to the beamerthemeMytheme.sty file so that someone else using the theme down the road doesn't need to figure that particular command out. However, no amount of tweaking of setbeamertemplate{titlepage} { ... } has gotten this command to work.

I've seen examples using pgfimage to accomplish this effect, but my attempts have not come out nearly as cleanly as usebackgroundtemplate. For example, either:

\setbeamertemplate{title page}{
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{MyBackground.jpg}}
}


nor

{
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{MyBackground.jpg}}
\setbeamertemplate{title page}{
% ...
}
}


have worked.

Is there a way to use usebackgroundtemplate (Or a similar command) from within a beamer style file?

Based on the fantastic answer https://tex.stackexchange.com/a/323638/36296 you could do the following little trick:

\documentclass{beamer}

\makeatletter
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{example-image-duck}}% <-- define here the specific footline for the titlepage
\makeatother

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
content...
\end{frame}

\end{document}


• This worked perfectly! I've seen similar styles of commands (I.E makeatletter) used for other TeX tricks - is there any explanation of what is going on here? – fergu Nov 9 '18 at 17:47
• @fergu See tex.stackexchange.com/questions/8351/… You don't need them in your .sty file, but because I working directly in the document, I had to add them to use @ – samcarter_is_at_topanswers.xyz Nov 9 '18 at 17:51
• Okay, I see. I'm trying to look up documentation on some of the other commands used (I.E \ps@navigation@titlepage or @nameuse), but my google searches are coming up short. Is there a document or page where these kinds of things are defined? – fergu Nov 9 '18 at 18:07
• @fergu I don't think you will find \ps@navigation@titlepage in any documentation, it is just defined in the above example. For @nameuse see tex.stackexchange.com/questions/126273/… – samcarter_is_at_topanswers.xyz Nov 9 '18 at 18:15
• @samcarter_is_at_topanswers.xyz What is the purpose of the \@nameuse{ps@navigation}? If I remove it, everything still works fine and I don't see it's function because ps@navigation is not referenced after. – TobiBS Jun 27 at 9:57