중괄호를 사용할 때 이미지에 중복 인쇄가 작동하지 않음

중괄호를 사용할 때 이미지에 중복 인쇄가 작동하지 않음

다음 코드는 예상대로 작동합니다. 여기서 두 이미지는 동일한 위치에 있는 두 개의 서로 다른 슬라이드에 나타납니다.

\documentclass[aspectratio=169]{beamer}
\begin{document}

\begin{frame}[t]
  \frametitle{Test}
    \begin{overprint}
      \onslide<1>\includegraphics{pictures/test1.png}
      \onslide<2>\includegraphics{pictures/test2.png}
    \end{overprint}
\end{frame}
\end{document}

그러나 명령 뒤에 중괄호를 추가하면 onslide더 이상 작동하지 않습니다.

\documentclass[aspectratio=169]{beamer}
\begin{document}

\begin{frame}[t]
  \frametitle{Test}
    \begin{overprint}
      \onslide<1>{\includegraphics{pictures/test1.png}}
      \onslide<2>{\includegraphics{pictures/test2.png}}
    \end{overprint}
\end{frame}
\end{document}

왜 이런거야? 상황에 따라 환경 \onslide외부에서 명령을 사용할 수 있기를 원하기 때문에 중괄호를 포함합니다 overprint. 내 궁극적인 목표의 MWE는 다음과 같습니다.

\documentclass[aspectratio=169]{beamer}
\begin{document}

\begin{frame}[t]
  \frametitle{Test}
  \begin{itemize}
  \onslide<1> {\item Slide 1}
  \onslide<2> {\item Slide 2}
  \end{itemize}
    \begin{overprint}
      \onslide<1>{\includegraphics{pictures/test1.png}}
      \onslide<2>{\includegraphics{pictures/test2.png}}
    \end{overprint}
\end{frame}
\end{document}

중괄호를 포함하지 않으면 두 개의 개별 인스턴스가 onslide작동하지 않는 것 같지만 그렇게 하면 overprint작동이 중단됩니다.

답변1

\onslide논쟁이 있든 없든 의 행동은 다릅니다. 비머 사용자 가이드를 인용하려면:

이 명령의 동작은 선택적 인수 ⟨text⟩ 가 제공되는지 여부에 따라 달라집니다(선택적 인수는 대괄호가 아닌 일반 중괄호로 표시됩니다). 존재하는 경우 ⟨수정자⟩는 a+ 또는 a*일 수 있습니다.

[...]

⟨text⟩ 인수가 있으면 \onslide(⟨수정자⟩ 제외)는 \uncover로 매핑되고, \onslide+는 \visible로 매핑되고, \onslide*는 \only로 매핑됩니다.

즉, 인수를 사용하려는 경우그리고인수가 공간을 차지하지 않도록 하려면 를 사용해야 합니다 \onslide*.

(개인적으로는 등을 직접 사용하는 것이 훨씬 쉽다고 생각합니다 \only{}. \uncover{}그러면 이름에서 그 기능을 직접 알 수 있습니다.)

\documentclass[aspectratio=169]{beamer}
\begin{document}

\begin{frame}[t]
  \frametitle{Test}
  \begin{itemize}[<only@+>]
  \item Slide 1
  \item Slide 2
  \end{itemize}
    \begin{overprint}
      \onslide*<1>{\includegraphics[page=1]{example-image-duck}}
      \onslide*<2>{\includegraphics[page=2]{example-image-duck}}
    \end{overprint}
\end{frame}
\end{document}

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

관련 정보