Because of how I use beamer, I would ideally like not to use \begin{frame} and \end{frame} but rather just the command \fr for whenever I start a new frame.
Using this answer, what I have right now is a combination of \fr and \nofr like so:
\newcommand{\fr}[1][]{%
\if\relax\detokenize{#1}\relax
\def\startfrm{\begin{frame}}%
\else
\def\startfrm{\begin{frame}[#1]}%
\fi
\innerbfrm
}
\long\def\innerbfrm#1\nofr{\startfrm#1\end{frame}}
I would ideally like to add the following at the beginning of the definition of \fr:
\ifthenelse{\boolean{no_frame}}{}{\nofr}
\setboolean{no_frame}{false}
where no_frame is a boolean which gets set to true at the beginning of the document. This way I should be able to use only \fr instead of \nofr\fr. (One would still need to use one \nofr at the end of document or add it to a suitable hook.)
But whatever I do beamer/latex complain. I have it set up this way for example for quick items with \qitem instead of \begin{enumerate}\item\end{enumerate} so it seems likely it's a beamer issue.
\begin{frame}wants to explicitly see\end{frame}in order to determine the frame's content. Hiding it in a macro will not work. – egreg Sep 14 '23 at 13:35