1

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?

2

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

\documentclass{beamer}

\makeatletter
\def\ps@navigation@titlepage{%
  \usebackgroundtemplate{\includegraphics[width=\paperwidth]{example-image-duck}}% <-- define here the specific footline for the titlepage 
  \@nameuse{ps@navigation}}
\addtobeamertemplate{title page}{\thispagestyle{navigation@titlepage}}{}
\makeatother

\begin{document}

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

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

\end{document}

enter image description here

  • 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 @ – user36296 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/… – user36296 Nov 9 '18 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.