Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have set in my .sty file as follows (to have a predefined background in my last slide):

\setbeamertemplate{background canvas}{
 \ifnumequal{\c@framenumber}{\inserttotalframenumber}{
         % Last frame
        \includegraphics[width=\paperwidth,height=\paperheight]{img/bg-last.pdf}
      }
}

The issue is the last frame in the .tex file overlaps on the above background. I want my last frame in the .tex file to be n-1 slide.

share|improve this question
1  
Maybe I didn't understand you correctly, but why can't you just add another (empty) frame (\frame{}) at the end of your presentation? –  diabonas Mar 5 '12 at 16:51
    
Yes, thats an idea. But it's not so clean. –  sandoche Mar 6 '12 at 7:45
    
BTW: The given code doesn't work out of the box: You need to load etoolbox, and \ifnumequal has four arguments, so a {} is missing after the closing brace in l. 5. The full working code can be found in the question How to add background only to title frame and an other only to the last frame?. –  diabonas Mar 6 '12 at 11:28

1 Answer 1

up vote 0 down vote accepted

I still don't fully understand why this should be done automatically, but you can simply add the final frame with \AtEndDocument. Like this, you don't have to check for the last frame with \ifnumequal{\c@framenumber}{\inserttotalframenumber}{...}{...} either, instead you can use \setbeamertemplate{background canvas}{...} in a group to define a custom background for the last (otherwise empty) slide.

Example code:

\documentclass{beamer}
\AtEndDocument{%
{%
  \setbeamertemplate{background canvas}{%
    \includegraphics[width=\paperwidth,height=\paperheight]{img/bg-last.pdf}%
  }%
  \frame{}%
}}
\begin{document}
\begin{frame}
Content
\end{frame}
\end{document}

To incorporate this into your .sty file, just use the \AtEndDocument call (ll. 2-8).

share|improve this answer
    
You got it right. This is what i wanted. –  sandoche Mar 6 '12 at 13:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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