9

I'm trying to create a LaTeX beamer theme to match the official PowerPoint template of Rutgers University. I've been able to create the title page, and this MWE

\documentclass{beamer}
    \usepackage{graphicx}
    \usetheme{NewBrunswick}

    \title{This Is A Long Descriptive Title Describing How Much Easier It Would Be To 
        Study \LaTeX{} And Not Hypersonics}
    \author{Someone Other Than Till Tantau}
    \institute[MAE]{Fake Degree Candidate \and Mechanical \& Aerospace Engineering}
    \date{A Long, Long, Time Ago}

\begin{document}
{
\usebackgroundtemplate{
    \includegraphics[width=\paperwidth, height=\paperheight]{rutgersTitle} }
    \begin{frame}[plain]
        \titlepage
    \end{frame} }
\end{document}

with this MWE beamerthemeNewBrunswick.sty file

\setbeamercolor{titlelike}{fg=white}
\setbeamercolor{title page}{fg=white}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{title page}{family=\rmfamily}
\addtobeamertemplate{title page}{\vspace{3\baselineskip}}{}

resembles it:

sampleTitlePage

Is there a way for me to take the background image code out of the document, and into a/the theme file? I would like to distribute this so users can just specify

\begin{frame}[plain]
    \titlepage
\end{frame}

and get the background image that I've stored with the theme files. I tried adding this to the theme file

\addtobeamertemplate{title page}{}{
    \usebackgroundtemplate{
        \includegraphics[width=\paperwidth, height=\paperheight]{rutgersTitle} } }

but it doesn't add the background image as I had hoped.

EDIT:

Trying textpos with

\documentclass{beamer}
    \usepackage{graphicx}
    \usetheme{NewBrunswick}

    \title{This Is A Long Descriptive Title Describing How Much Easier It Would Be To
        Study \LaTeX{} And Not Hypersonics}
    \author{Someone Other Than Till Tantau}
    \institute[MAE]{Fake Degree Candidate \and
                    Mechanical \& Aerospace Engineering}
    \date{A Long, Long, Time Ago}

\begin{document}
    \begin{frame}[plain]
        \titlepage
    \end{frame}
\end{document}

where beamerthemeNewBrunswick.sty now contains

\RequirePackage{textpos}

\setbeamercolor{titlelike}{fg=white}
\setbeamercolor{title page}{fg=white}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{title page}{family=\rmfamily}
\addtobeamertemplate{title page}{\vspace{3\baselineskip}}{}

\addtobeamertemplate{title page}{
    \begin{textblock*}{\paperwidth}(-2.6em, -1.6em)
        \includegraphics[width=\paperwidth, height=\paperheight]{rutgersTitle}
    \end{textblock*} }{}

produces newSample where you can see there's an additional white bar on the bottom. Did I use textpos incorrectly? Here is my background image: backgroundImage I guess I should be adding to the question instead of comments. Is textpos using a centering-like effect here? If I add something like

\addtobeamertemplate{title page}{\vspace{10\baselineskip}}{}

the background image moves up the slide and my text moves down the slide.

EDIT WITH SOLUTION: Using Tikz appeared to be the only way to avoid hard coding sizes, so I went with it despite increased compile time. My final code for the .sty file was:

\RequirePackage{tikz}

\setbeamercolor{titlelike}{fg=white}
\setbeamercolor{title page}{fg=white}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{title page}{family=\rmfamily}
\addtobeamertemplate{title page}{\vspace{3\baselineskip}}{}

\addtobeamertemplate{title page}{
    \begin{tikzpicture}[remember picture,overlay]
        \node [xshift=0cm,yshift=0cm] at (current page.center) {
            \includegraphics[width=\paperwidth, height=\paperheight]{rutgersTitle}
        };
        \node [xshift=0cm,yshift=0cm] at (0.04\paperwidth,-0.01\paperheight) {
            \includegraphics[width=3cm]{tigre}
        };
    \end{tikzpicture}
}{}
7
  • @diabonas similar question, but duplicate? i'm trying to use different commands that have a different level of nesting. i also wouldn't call that resolution adequate, as it isn't tied to \titlepage at all. the title page might not, in theory, be on the first slide. or if i'm not using a title page, my first slide shouldn't have the background image. Apr 10, 2012 at 20:40
  • Your're right, I'm sorry I missed that difference.
    – diabonas
    Apr 10, 2012 at 21:13
  • @asia1281: I think the white bar is due to the plain option. Use simply \begin{frame}\titlepage\end{frame}; if this doesn't solve the problem, please upload the image file rutgersTitle somewhere, so I can do some tests. Apr 11, 2012 at 16:44
  • @GonzaloMedina i tried it without the plain option, and it still has the strange white bar at the bottom. i do need the plain option though, as this will need to work in presentations that have a footer defined. currently, this is how i'm keeping the footer off of the title page and questions page et cetera. Apr 11, 2012 at 17:02
  • @asia1281:I'll do some tests and get back to you. Apr 11, 2012 at 17:11

1 Answer 1

6

Try with this beamerthemeNewBrunswick.sty file; the idea is to use the TikZ package to add the background image at an absolute position; of course, using several nodes you can add several images; for example, defining beamerthemeNewBrunswick.sty in the following way:

\RequirePackage{tikz}

\setbeamercolor{titlelike}{fg=white}
\setbeamercolor{title page}{fg=white}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{title page}{family=\rmfamily}
\addtobeamertemplate{title page}{\vspace{3\baselineskip}}{}

\addtobeamertemplate{title page}{%
\begin{tikzpicture}[remember picture,overlay] 
  \node [xshift=0cm,yshift=0cm] at (current page.center)
  {\includegraphics[width=\paperwidth, height=\paperheight]{rutgersTitle}};             
  \node [xshift=0cm,yshift=0cm] at (1cm,-0.7\paperheight)
  {\includegraphics[width=3cm]{tigre}};             
\end{tikzpicture}%
}{}


\RequirePackage{textpos}

\setbeamercolor{title}{fg=white}
\setbeamercolor{subtitle}{fg=white}
\setbeamercolor{author}{fg=white}
\setbeamercolor{institute}{fg=white}
\setbeamercolor{date}{fg=white}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{title page}{family=\rmfamily}

\addtobeamertemplate{title page}{%
\begin{textblock*}{\paperwidth}(-2.6em,-1.6em)
\includegraphics[width=\paperwidth, height=\paperheight]{tigre} 
\end{textblock*}%
\begin{textblock*}{2cm}(0cm,6cm)
\includegraphics[width=2cm]{tigre} 
\end{textblock*}
}{}

and using the following .tex file:

\documentclass{beamer}
\usepackage{graphicx}
\usetheme{NewBrunswick}

\title{This Is A Long Descriptive Title Describing How Much Easier It Would Be To
        Study \LaTeX{} And Not Hypersonics}
\author{Someone Other Than Till Tantau}
\institute[MAE]{Fake Degree Candidate \and
                    Mechanical \& Aerospace Engineering}
\date{A Long, Long, Time Ago}

\begin{document}

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

\end{document}

you'll get

enter image description here

7
  • while i don't have any textpos experience, if this works it creates another problem. this is actually the first step in a two step process, and i had planned to use textpos or tikz to stick another image on top of (overlay) the background image for the template. would textpos be able to handle adding both images to the template? Apr 11, 2012 at 16:16
  • @asia1281: yes; I've added an example to my answer. Apr 11, 2012 at 16:40
  • oh sweet. i think it's funny that so many beamer examples have a tiger in them! Apr 11, 2012 at 17:00
  • 1
    fyi, it looks to be image dependent. i just tried it with another background image and i needed to use -1.55em to eliminate white space. Apr 11, 2012 at 18:47
  • 1
    @asia1281: I've changed from textpos to tikz; process the example code at least three times to get the correct positioning. Apr 11, 2012 at 19:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .