다음 코드로
\documentclass[beamer]{beamer}
\begin{document}
\begin{frame}
\[
\sqrt{\uncover<2->{a\uncover<3->{+b}}}
\]
\end{frame}
\end{document}
먼저 외부 요소를 표시한 다음 내부 요소를 표시하는 공식을 찾아낼 수 있습니다.
어떻게 대화를 얻을 수 있나요? 즉, 먼저 "+b"를 표시하고 그 앞에 "a"를 표시한 다음 합계 주위에 제곱근 기호를 표시합니까?
답변1
제곱근이 문제입니다.
\documentclass[beamer]{beamer}
\begin{document}
\begin{frame}
\[
\only<1>{\phantom{\sqrt{\vphantom{a+b}}}\hphantom{a}+b}
\only<2>{\phantom{\sqrt{\vphantom{a+b}}}a+b}
\only<3>{\sqrt{a+b}}
\]
\end{frame}
\end{document}
답변2
나는 내 예제를 조금 더 연구했고(다소 더 복잡한 공식을 위해 필요했습니다) 내부가 \textcolor
외부보다 우선순위가 높다는 것을 발견했습니다. 따라서 다음이 작동합니다.
\begin{frame}
\[
\textcolor<3>{black}{\textcolor<1-2>{white}{%
\sqrt{%
\textcolor<2>{black}{\textcolor<1>{white}{%
a%
\textcolor<1>{black}{%
\vphantom{a}+b%
}%
}}%
}%
}}%
\]
\end{frame}
내 경우에는 @egreg 제안보다 더 쉽게 일반화할 수 있습니다(어쨌든 매우 훌륭하고 "TeXnical"입니다). 더 정교한 예로서 다음을 고려하십시오.
\begin{frame}
\[
\textcolor<6>{black}{\textcolor<1-5>{white}{%
\textcolor<5->{black}{\textcolor<4>{red}{%
{\sqrt{%
\textcolor<3->{black}{\textcolor<2>{red}{%
{\left(%
\textcolor<2->{black}{\textcolor<1>{red}{%
{\frac{a}{2}}%
}}%
\right)^{2}}%
}}%
\textcolor<4->{black}{\textcolor<3>{red}{%
{\vphantom{1}+b}%
}}%
}}%
}}%
\textcolor<6->{black}{\textcolor<5>{red}{%
{\vphantom{1}+\frac{c}{2}}%
}}%
}}%
\]
\end{frame}