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 am asking a very similar question to that posed here Reusing slides from Beamer presentations but may be slightly different. I teach a number of very similar modules with differences mainly being in the quantity and detail of topic. I know I could use a main-file and just include the slides as individual files as the case may require.

I was thinking more along the line of the following pseudocode...

\begin{frame}{Grignard Reagents}[]
This frame appears for all modules
\begin{frame}{Grignard Reagents-General reaction mechanisms}[CHEM7002, CHEM8005]
This frame only appears for modules CHEM7002 and CHEM8005 when compiled
\begin{frame}{Grignard Reagents-Aldehydes and Ketones}[]
This frame appears for all modules
\begin{frame}{Grignard Reagents-Esters}[CHEM8005]
This frame appears for module CHEM8005 only when compiled

When the document is compiled (without having to manually comment out frames etc), it outputs in the above case, three different files, lecture-chem6005.pdf, lecture-chem7002.pdf and lecture-chem8005.pdf which have the requisite depth and detail as required by the module...

share|improve this question
Have a look at \includeonlyframes in the beamer manual. You can add a label=<text> to every frame and then only include certain ones. –  Martin Scharrer Apr 19 '12 at 13:36
Howdy you may take a look at beameraudience. This package is made to reassemble beamer frames. I never worked with it so i neither have a example ready nor any experience but from its description it seems to be handy. –  bloodworks Apr 19 '12 at 13:55
@bloodworks I had a quick look at the description and it seems almost exactly what I want to do..it is very new, released in August2011, I must give it a try... –  Leeser Apr 19 '12 at 17:22
@Leeser If beameraudience works for you, please post an answer to your question so the rest of us can get an idea of what it can do. –  Andrew Stacey Apr 20 '12 at 8:44
@AndrewStacey I haven't attempted to use it yet and the documentation is minimal but when I have I will let you all know –  Leeser Apr 21 '12 at 18:21
add comment

1 Answer

up vote 6 down vote accepted

I have given an example below of the beameraudience package. It is fairly minimal and not very exciting. Although it doesn't answer exactly the question that I asked it comes very close to it. All I need to do is comment out the modules I don't want and then compile.

The three macros \framefor{}{} \justfor{}{} \showcontentfor{}{} are used below. \framefor{audience}{frame contents} basically selects the whole frame for a the [audience]. As \begin{frame} and \end{frame} are defined in the macro they are not needed but the frame title is. \justfor{audience}{contents} can include full frame contents (requires use of \begin{frame}...\end{frame} or just in-frame content. \showcontentfor{audience}{content} is a slightly more subtle usage of \justfor{}{}

Looking at the beameraudience style file, one can only define one audience. If it was possible to define a list of audiences using the ifthenelsecommand allowing more than one audience type to be selected that would be ideal. By this I mean that I don't have to repeat the content for say two of three audience types, I can include the two in the option [audience=intermediate,expert].


]{beameraudience}% comment in the audience you are reaching out to...


\begin{frame}{Grignard Reagents}
This frame appears for all modules as we do not use any of the beameraudience commands.


{Grignard Reagents-General reaction mechanisms}% definition of \framefor{audience}     {\begin{Frame}  Frame contents\end{frame}} hence the frame title being in parentheses and no \begin{frame} \end{frame} environment 
This frame only appears for module CHEM8005 when compiled...

\begin{frame}{Grignard Reagents-Aldehydes and Ketones}
This frame appears for all modules as does this line.\\
\justfor{CHEM6005}{But this line only appears for module CHEM6005.}
\justfor{CHEM7002}{This line only appears for module CHEM7002.}
\justfor{CHEM8005}{This line only appears for CHEM8005.}


\begin{frame}{Grignard Reagents-Esters}%[CHEM8005]
This frame appears for all modules.
\showcontentfor{CHEM6005}{CHEM6005. Only the barest details are necessary.}\showcontentfor{CHEM7002}{CHEM7002. A little bit more information is given.}\showcontentfor{CHEM8005}{CHEM8005. A lot more information and maybe a few diagrams are given for this module.}\end{frame}

Only content for CHEM7002

share|improve this answer
Can I accept my own answer so the questions "Answered" for future searches on this topic? –  Leeser Apr 23 '12 at 8:33
add comment

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.