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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

\setbeamertemplate{background canvas}{
         % Last frame

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
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
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:

  \setbeamertemplate{background canvas}{%

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


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.