비머 슬라이드를 통해 콘텐츠 발전: '범위'를 사용하여 요소 그룹화

비머 슬라이드를 통해 콘텐츠 발전: '범위'를 사용하여 요소 그룹화

신청합니다https://tex.stackexchange.com/a/518585/114719scope여러 비머 슬라이드에 걸쳐 콘텐츠를 개발하는 동안 요소를 그룹화하는 데 사용합니다 .

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
  \begin{overlayarea}{\linewidth}{0.7\paperheight}
    \centering
    \begin{tikzpicture}
    \useasboundingbox(-5.5,-.5)rectangle(6,5.5);%                                                                                                                                                           
      \coordinate (O) at (0, 0);
      \coordinate (A) at (5, 5);
      \coordinate (B) at (-5, 5);
      \begin{scope}<1->
        \draw (O) -- (B);
      \end{scope}
      \begin{scope}<2->
        \draw (O) -- (A);
      \end{scope}
      \draw<3> (A) -- (B);
      % \begin{scope}<3>                                                                                                                                                                                   
      %   \draw (A) -- (B);                                                                                                                                                                                
      % \end{scope}                                                                                                                                                                                        
    \end{tikzpicture}
  \end{overlayarea}
\end{frame}
\end{document}

마지막 슬라이드의 요소도 그룹화하는 경우

      \draw<3> (A) -- (B);

~와 함께

      \begin{scope}<3>                                                                                                                                                                                   
         \draw (A) -- (B);                                                                                                                                                                                
      \end{scope}  

슬라이드 배열이 마지막 슬라이드로 축소됩니다. 이유는 무엇이며 를 사용하여 마지막 슬라이드에서도 요소를 그룹화하려면 어떻게 해야 합니까 scope?

답변1

로 래핑되는 범위 버전을 갖고 싶다면 \onslide다음과 같이 할 수 있습니다.

\newenvironment<>{Scope}[1][]{\onslide#2\begingroup\begin{scope}[#1]}{%
\end{scope}\endgroup}

그러면 당신이 말한 것처럼 약간 잘못되어 작동하지 않는 \begin{Scope}<3> ... \end{Scope}대신 사용할 수 있습니다 .\begin{scope}<3> ... \end{scope}

예:

\documentclass{beamer}
\usepackage{tikz}
\newenvironment<>{Scope}[1][]{\onslide#2\begingroup\begin{scope}[#1]}{%
\end{scope}\endgroup}
\begin{document}
\begin{frame}
  \begin{overlayarea}{\linewidth}{0.7\paperheight}
    \centering
    \begin{tikzpicture}
    \useasboundingbox(-5.5,-.5)rectangle(6,5.5);%  unnecessary                                                                                                                                                         
      \coordinate (O) at (0, 0);
      \coordinate (A) at (5, 5);
      \coordinate (B) at (-5, 5);
      \begin{Scope}<1->[blue]
        \draw (O) -- (B);
      \end{Scope}
      \begin{Scope}<2->
        \draw (O) -- (A);
      \end{Scope}
      \begin{Scope}<3>
         \draw (A) -- (B);
      \end{Scope}
    \end{tikzpicture}
  \end{overlayarea}
\end{frame}
\end{document}

여기에 이미지 설명을 입력하세요

파란색 선은 범위의 옵션을 추가하는 방법만 보여줍니다.

나는 개인적으로 여전히 그렇게 생각합니다 overlay-beamer-styles.이 답변그리고 Skillmon이 제안한 것은 장기적으로 상당한 도움이 될 것입니다. 적어도 저는 정확하게 그러한 응용 프로그램에 그것을 많이 사용하고 있습니다.

답변2

\uncover다음은 (예를 들어) 로 사용되는 를 사용하는 방법 \uncover<1->{..}이며 중괄호 안의 모든 내용은 슬라이드 2 슬라이드 1 이후에 {..}표시됩니다 . 코드는 다음과 같습니다.

\documentclass{beamer}
\usepackage{tikz}
\begin{document} \begin{frame} \begin{overlayarea}{\linewidth}{0.7\paperheight}
\centering

\begin{tikzpicture}
\useasboundingbox(-5.5,-.5)rectangle(6,5.5);
\coordinate (O) at (0, 0);
\coordinate (A) at (5, 5);
\coordinate (B) at (-5, 5);
\uncover<1->{\begin{scope}\draw (O) -- (B);\end{scope}}
\uncover<2->{\begin{scope}\draw (O) -- (A);\end{scope}}
\uncover<3>{\draw (A) -- (B);}
\end{tikzpicture}

\end{overlayarea} \end{frame} \end{document}

\uncover예를 들어 슬라이드 2 뒤에 범위를 표시하고 나중에 범위의 일부를 표시하려는 경우 명령을 중첩할 수 있습니다 . 귀하의 예에서 위 코드는 \uncover다음 줄로 시작하는 세 줄을 바꾸면 동일한 결과를 제공합니다 . 중첩을 보여주기 위해 들여쓰기를 추가했습니다.

\uncover<1->{
  \begin{scope}
  \draw (O) -- (B);
  \uncover<2->{
    \begin{scope}
    \draw (O) -- (A);
    \uncover<3>{
      \draw (A) -- (B);
    }
  \end{scope}}
\end{scope}}

관련 정보