TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

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

How can I do this?

share|improve this question
up vote 16 down vote accepted

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


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



share|improve this answer

Related to Detect value of option given to documentclass:

  {\newcommand{\printmode}{Handout mode.}}
  {\newcommand{\printmode}{Not-handout mode.}}


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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