Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

2 Answers 2

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.

\documentclass{beamer}
\usepackage{gb4e}
\resetcounteronoverlays{exx}


\begin{document}
\begin{frame}{A frame}
  \begin{exe}
  \ex\label{Ex1}
  \begin{xlist}
     \ex[]{ This is an example}
     \pause
     \ex[*]{This example ungrammatical is.}
     \pause
     \ex[]{Another one.}
  \end{xlist}
  \end{exe}
\end{frame}
\end{document}
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

\makeatletter
\renewcommand<>{\ex}{\@ifnextchar[{\@ex}{\item}}
\makeatother

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

share|improve this answer

Your Answer

 
discard

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.