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 have a beamer main document which is called by various wrappers and I want to make all \mode-switching dependent from commands defined in the preamble of this wrappers. For normal modes like \mode<presentation> this works fine, but the only way I found to include \mode* in this system was to hack an internal command.

Has someone a better idea to achieve the same goal? And do someone some danger in my redefinition (apart from the general danger to redefine internal commands)?

some text outside a frame in main mode
test in frame in main mode


some text outside a frame in second mode

second mode in a frame


some text outside a frame

share|improve this question

I don't know beamer well enough to be able to say whether a completely different technique should be used but at least I think you want to change



as otherwise if the first two letters of the mode name are the same it will expand to true and typeset the remaining letters followed by a *.

In the MWE it is testing the p and r of presentation so it happens to take the right branch, but compare with:

share|improve this answer
Good point. It doesn't matter currently but is naturally cleaner. – Ulrike Fischer Feb 23 '13 at 9:47

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.