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 use the gb4e package to set numbered examples. I want to put these on slides made with beamer. According to the beamer userguide I can make any command overlay specification aware using this in my preamble:

\renewcommand<>{⟨existing command name⟩}[⟨argument number⟩][⟨default optional value⟩]{⟨text⟩}

I tried to do this with gb4e's \ex command. I tried the following:

\newcommand<>{\ex}[][]{\@ifnextchar [{\@ex}{\item}}

I thought that would be right, because gb4e defines \ex as follows:

\def\ex{\@ifnextchar [{\@ex}{\item}}

With that in my preamble my document doesn't compile. Am I misunderstanding something about how this works?

share|improve this question
You need to surround the \renewcommand with \makeatletter/\makeatother. If you haven't done that in your document, it will fail to compile. – Aaron May 5 '11 at 18:41
That was silly of me. Now it compiles, but hasn't made the commands overlay aware. – Tom May 7 '11 at 17:15

Unfortunately, gb4e's example commands are more complicated than this, and are defined with delimited arguments using \def. I'm not sure that they can be made overlay aware so easily. The easiest way to uncover example items line by line is simply to use the \pause command.


\begin{frame}{A frame}
     \ex[]{ This is an example}
     \ex[*]{This example ungrammatical is.}
     \ex[]{Another one.}
share|improve this answer
Maybe I can't do it then. I'll just design my slides around the problem. – Tom May 7 '11 at 17:17

The \@ifnextchar is just to define a command with optional argument. Try


Can you add a minimal example of what you're trying to do?

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.