
\documentclass{beamer}
\mode<presentation>
\usepackage{amsfonts,amsmath,amssymb,graphicx,xcolor}
\newtheorem{thm}{Theorem}
\begin{document}
\title{...}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\begin{thm}
$\sqrt{2}$ is irrational.
\end{thm}\pause
\begin{proof}
The proof is by contradiction.\pause
\begin{itemize}
\item\only<3>{\textcolor{red}{Suppose, for a contradiction, that $\sqrt{2}$ is rational.
That is, there are coprime integers $a$ and $b$ such that $\sqrt{2}=\frac{a}{b}.$}}\pause
\item\only<4>{\textcolor{red}{$\sqrt{2}$}}
\end{itemize}
\end{proof}
\end{frame}
\end{document}
estoy tratando de hacer
Suppose, for a contradiction, that $\sqrt{2}$ is rational.
That is, there are coprime integers $a$ and $b$ such that \sqrt{2}=\frac{a}{b}.
Rojo en la tercera diapositiva de la superposición y negro normal en la cuarta; sin embargo, en la cuarta simplemente desapareció por completo. ¿Por qué es esto?
Respuesta1
El \only
comando imprimirá el siguiente contenidosoloen esas diapositivas, tú defines. Por lo tanto, \only<3>
imprimirá la oración solo en la superposición 3. Es invisible en la superposición 4 y en las siguientes. De ahí tu problema, de no ver el texto.
Si desea tener una preparación especial en la superposición 3 pero una apariencia normal en cualquier otra superposición, use el \alt
comando. Si toma el conjunto de superposiciones (en su caso <3>
y en el primer par de llaves, puede definir lo que debe suceder en esa superposición. En cualquier otra superposición, se usa el contenido del segundo par de llaves.
Ver elmanual del proyectorpara más comandos como \uncover
, \invisible
, \visible
, ...
En su caso, es suficiente con llamar \color{red}
a la superposición 3. Como \color
es un comando, todo lo siguiente estará en color rojo. La coloración finalizará automáticamente en el entorno circundante (aquí: itemize
).
(Agregué una quinta superposición, para probar, que \color{green}
no afecta nada fuera del entorno. Si desea tener más control sobre los comandos, por supuesto, puede usar \textcolor{}
o copiar y pegar el texto, como se muestra aquí \alt<3>{\color{red} text}{pure uncolored text}
:)
MWE:
\documentclass{beamer}
\mode<presentation>
\usepackage{amsfonts,amsmath,amssymb,graphicx,xcolor}
\newtheorem{thm}{Theorem}
\begin{document}
\title{...}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\begin{thm}
$\sqrt{2}$ is irrational.
\end{thm}\pause
\begin{proof}
The proof is by contradiction.\pause
\begin{itemize}
\item\alt<3>{\color{red}}{} Suppose, for a contradiction, that
$\sqrt{2}$ is rational. That is, there are coprime integers
$a$ and $b$ such that $\sqrt{2}=\frac{a}{b}.$\pause
\item\alt<4>{\color{red}}{\color{green}}$\sqrt{2}$
\end{itemize}
\only<5>{Easy Peasy!}
\end{proof}
\end{frame}
\end{document}
Resultado:
Respuesta2
Es posible que desee utilizar el comando \alert
\documentclass{beamer}
\mode<presentation>
\usepackage{amsfonts,amsmath,amssymb,graphicx,xcolor}
\newtheorem{thm}{Theorem}
\begin{document}
\title{...}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\begin{thm}
$\sqrt{2}$ is irrational.
\end{thm}\pause
\begin{proof}
The proof is by contradiction.\pause
\begin{itemize}
\item\alert<3>{Suppose, for a contradiction, that $\sqrt{2}$ is rational. That is, there are coprime integers $a$ and $b$ such that $\sqrt{2}=\frac{a}{b}.$}\pause
\item\alert<4>{$\sqrt{2}$}
\end{itemize}
\end{proof}
\end{frame}
\end{document}