[Tex/LaTex] Remove all frame content from article mode in beamer

beamerbeamerarticle

What is the best way to remove all frame content from a beamer presentation when the article mode is being used? Below is a MWE:

\documentclass[ignorenonframetext]{beamer}
%\documentclass{article}\usepackage{beamerarticle}

\begin{document}

\begin{frame}{This is frame 1}
Content of frame 1, but shouldn't be in the article
\end{frame}

This text should appear in the article, but not within the presentation.

\begin{frame}{This is frame 2}
Content of frame 2, but shouldn't be in the article
\end{frame}

This text should appear in the article, but not within the presentation.

\end{document}

The idea is that the beamer presentation is the lecture, whereas the inter-frame text will be homework questions that will be typeset separately.

EDIT

I searched under global frame options and ideally I would like to have something like the solution to this question:

\documentclass[presentation]{beamer}

except the option somehow needs to be within the article class!

Best Answer

You can specify as overlay option if something is only meant to be in the presentation with <presentation>. In the same manner you can use <article>.

Some examples where you can use these overlay options are

\begin{frame}<presentation>

or

 \mode<article>{This text should appear in the article, but not within the presentation.}

%\documentclass[ignorenonframetext]{beamer}
\documentclass{article}\usepackage{beamerarticle}

\begin{document}

\begin{frame}<presentation>{This is frame 1}
Content of frame 1, but shouldn't be in the article
\end{frame}

This text should appear in the article, but not within the presentation.

\begin{frame}<presentation>{This is frame 2}
Content of frame 2, but shouldn't be in the article
\end{frame}

This text should appear in the article, but not within the presentation.

\end{document}