# Reusing slides from Beamer presentations

I give a good number of talks and find that I can share some slides but not others based on audience, topic, etc. Powerpoint and Keynote make it pretty easy to pull slides from a deck into another deck. I'm curious about how folks deal with this situation with beamer. I can think of a few possibilities.

1. Simply cut-and-paste text from one show to the next
2. Use an IDE to improve on 1
3. Make a "supershow" that contains most of what I would want to say, but build a menu system that allows me to customize on-the-fly.

Are there other options or ideas that I should consider?

• Did you consider putting each slide in a separate file and including them according to the actual requirement? I have not tested this with beamer but would not know any reason why this should not work; for some reports I prepare regularly, I have learned to like this method. It also allows you to keep your editing limited to each slide individually, rather than the whole set. – vaettchen Mar 4 '12 at 2:44
• I had not thought of that. Certainly for some of my most common slides, this idea makes a lot of sense. – seandavi Mar 4 '12 at 12:58

I have a mountain of beamer slides that I combine in all sorts of ways for a number of different courses and presentations that I make. Here's what I do, slightly simplified:

1. I use beamer templates as containers for series of slides (sometimes a series is just a single slide, sometimes it is 40 slides):

\newcommand{\defsection}[3]{
\setbeamertemplate{slide #1 #2}{{#3}}}


I.e. in my source I put everything in "sections" a la:

\defsection{intro}{string-to-describe-what-this-is}{
\begin{frame}...\end{frame}
...
\begin{frame}...\end{frame}
} % end of \defsection

2. I use the sections of slides with the macro \usesection:

\newcommand{\usesection}[2]{
\ifbeamertemplateempty{slide #1 #2}
{\errmessage empty section: {#1}{#2}}
{\opt{texdebug}{\message{
*** Using section: (#1)(#2) }}
\usebeamertemplate{slide #1 #2}}}

3. I use the optional package to be allow conditional inclusion of stuff:

\usepackage[advanced,use-foo,dont-use-bar,do-xyz,do-frotz]{optional}

4. I include ALL stuff in a master file (main.tex):

\begin{document}
\include{stuff.tex}
\include{more-stuff.tex}
\include{even-more-stuff.tex}

\usesection{intro}{intro}

}

\opt{use-foo}{
}

\opt{use-bar}{
}

\opt{dont-use-bar}{

5. Now each "version" or "course" or "subset of stuff" (or whatever) is basically just a matter of defining the right options and then include main.tex.
I realise this may seem a bit complicated at first go, but the key idea is to separate definition of some slides (\defsection) from the use of them (\usesection). Once that separation is made, all sorts of reuse, different selections based on options, etc, etc, becomes quite trivial.