0

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.

  • 3
    \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
  • 2
    Instead of obfuscating your code with such macros, maybe use an editor which supports code snippets to quickly add the real syntax? – samcarter_is_at_topanswers.xyz Sep 14 '23 at 13:42
  • I'd rather not, no editor support can ever beat superior syntax (by superior I mean superior for my particular application), especially if very intensive rewritings/refactorings take place very frequently. – Łukasz Grabowski Sep 14 '23 at 13:45
  • 2
    if you implement such a syntax you are making it much harder to communicate code with other people, so do it only if you think that you never will have to ask a question about beamer on tex.sx or similar in the future. – Ulrike Fischer Sep 14 '23 at 16:45

0 Answers0