I would like to have a switch that detects whether I'm compiling a file as a beamer presentation or as an article, adjusting specific commands for both classes, but having the same content for the single page/slide. Unfortunately, the following code does not work for beamer.
%\documentclass{article}
\documentclass{beamer}
\usepackage{ifthen}
\newif\ifbeamer
\beamertrue
\begin{document}
\ifbeamer
\begin{frame}
\else % article
\newpage
\fi
% common code for both beamer and article
blah blah
\ifbeamer
\end{frame}
\fi
\end{document}
It seems that beamer only accepts to have \begin{frame} and \end{frame} inside single "if" statement. How can I handle this limitation?
beamersupports handouts, and, in particular, thebeamerarticleclass? It appears to me that you try to achieve a variant thereof, but there are already quite advanced options. – Jun 16 '20 at 23:00