15

I'm defining a command that should behave differently in handouts vs presentation. Is there a simple way to check that?

Ideally, it should be something like this:

\newcommand{\mycom}{
\ifthenelse{[check if handout mode]}{[Behave accordingly]}{[Behave otherwise]}
}

How can I do this?

19

Without additional packages, you can use \mode to accordingly define the command:

\documentclass[handout]{beamer}

\mode<beamer|second|trans|article>{\newcommand\mycmd{No H mode}}
\mode<handout>{\newcommand\mycmd{H mode}}

\begin{document}

\begin{frame}
\mycmd
\end{frame}

\end{document}
|improve this answer|||||
4

Related to Detect value of option given to documentclass:

\documentclass[handout]{beamer}
\usepackage{xstring}
\makeatletter
\IfSubStr{\@classoptionslist}{handout}
  {\newcommand{\printmode}{Handout mode.}}
  {\newcommand{\printmode}{Not-handout mode.}}
\makeatother
\begin{document}

\begin{frame}
\printmode
\end{frame}

\end{document}
|improve this answer|||||

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.