1

Suppose I have the following

\documentclass{beamer}

\newcommand*{\something}{
  \onslide<+-> this \onslide<+-> that
}

\newcommand*{\morething}{
  \onslide<+-> more
}

\begin{document}

\begin{frame}
  \something

  \morething
\end{frame}
\end{document}

This will produce a bunch of slides in which this, that, and more appear consecutively. I would like to create a new command, or environment that temporarily disables animation. Let me call the hypothetical command \disableanim. Then, the following code would produce slides where this and that just appear simultaneously (i.e. no animation) but the animation in \morething is still preserved. Ideally, \disableanim should be effective for other overlay-aware commands as well.

\documentclass{beamer}

\newcommand*{\disableanim}{???}

\newcommand*{\something}{
  \onslide<+-> this \onslide<+-> that
}

\newcommand*{\morething}{
  \onslide<+-> more
}

\begin{document}

\begin{frame}
  \disableanim{\something}

  \morething
\end{frame}
\end{document}

Thank you!

2

You can temporarily replace \onslide<.> with a no-op in this:

\newcommand*{\disableanim}[1]{{%
  \RenewDocumentCommand{\onslide}{ R<>{} }{}%
  #1%
}}

Note the additional grouping {...} inside the macro that limits the scope of the redefinition. Similar redefinitions for other overlay-aware commands can be inserted as well.

1
  • Thank you! I was thinking about doing this as well. But I was hoping for a way to disable the overlay specification altogether since there are just too many overlay-aware commands to override. – QcH Mar 5 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.