5

Why does \pause do not work with \only in this code?

\documentclass[compress,red]{beamer}
\usepackage{etex}
\mode<presentation>
\usetheme{Warsaw}
\usepackage[applemac]{inputenc}%les accents pour mac
\usepackage{subfigure}
\usepackage{multicol}
\usepackage{animate}
\usepackage{amsmath}
\usepackage{epsfig}
\usepackage{graphicx}
\usepackage[all,knot]{xy}
\xyoption{arc}
\usepackage{url}
\usepackage{array,ragged2e}
\usepackage{multimedia}
\usepackage{hyperref}
\usepackage{setspace}
\usepackage{multirow} 
\begin{document}
\section{section1}
\frame{\frametitle{Titre de la fenetre}
\only<1>{
\begin{itemize}
  \item point1
    \pause
  \item point2
    \pause
  \item point3
    \pause
  \item point4
    \pause
  \item point5
\end{itemize}
}
\only<2>{
\begin{itemize}
  \item essai1
  \item essai2
  \item essai3
\end{itemize}

\begin{equation}
  a+b=c
\end{equation}
}
\only<3>{
\begin{equation}
  a+5=10
\end{equation}
}
\end{document}
8

Using \only means that the material is not printed on any slides you don't specify. At the same time, \pause automatically spreads material across slides. Thus trying to combine the two means that most of the input won't be printed: it's excluded from the \only list but is not on the 'correct' slide due to \pause.

In the example given, it looks like you really have three separate frames, rather than wanting to print stuff 'only' one slide of a frame. That suggests:

\documentclass{beamer}

\begin{document}

\section{section1}

\begin{frame}
  \frametitle{Titre de la fenetre}
  \begin{itemize}
    \item point1
    \pause
    \item point2
    \pause
    \item point3
    \pause
    \item point4
    \pause
    \item point5
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Titre de la fenetre}
  \begin{itemize}
    \item essai1
    \item essai2
    \item essai3
  \end{itemize}
  \begin{equation}
    a + b = c
  \end{equation}
\end{frame}

\begin{frame}
  \frametitle{Titre de la fenetre}
  \begin{equation}
    a + 5 = 10
  \end{equation}
\end{frame}

\end{document}

I'd caution that even then you're likely to be overdoing \pause: experience suggests you should use animation very sparingly.

| 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.