Image beamer中的变换图像正在向右移动

Image beamer中的变换图像正在向右移动,image,latex,beamer,Image,Latex,Beamer,当我尝试在beamer中使用\only和overlayarea交替成像时,如下所示: \begin{frame} \frametitle{Tasks} \begin{overlayarea}{\textwidth}{\textheight} \begin{figure} \centering \only<1> { \includeg

当我尝试在beamer中使用\onlyoverlayarea交替成像时,如下所示:

\begin{frame}
    \frametitle{Tasks}

    \begin{overlayarea}{\textwidth}{\textheight}
        \begin{figure}
            \centering
            \only<1>
                {
                    \includegraphics[width=0.3\textwidth]{img/noise_detail_2.png}
                }
            \only<2>
                {
                    \includegraphics[width=0.3\textwidth]{img/noise_detail_2.png}
                }
            \only<3>
                {
                    \includegraphics[width=0.3\textwidth]{img/noise_detail_2.png}
                }
            \only<4>
                {
                    \includegraphics[width=0.3\textwidth]{img/noise_detail_2.png}
                }
        \end{figure}
    \end{overlayarea}      
\end{frame}
\begin{frame}
\框架标题{Tasks}
\开始{overlayarea}{\textwidth}{\textwidth}
\开始{图}
\定心
\只有
{
\includegraphics[width=0.3\textwidth]{img/noise\u detail\u 2.png}
}
\只有
{
\includegraphics[width=0.3\textwidth]{img/noise\u detail\u 2.png}
}
\只有
{
\includegraphics[width=0.3\textwidth]{img/noise\u detail\u 2.png}
}
\只有
{
\includegraphics[width=0.3\textwidth]{img/noise\u detail\u 2.png}
}
\结束{图}
\结束{overlayarea}
\结束{帧}
每张幻灯片上的图像越来越向右移动。比如说,在1。滑块位于位置x,第二个滑块位于位置x+5,第三个滑块位于位置x+10


为什么??如何修复它?

您在
\仅
的使用之间存在所谓的虚假空间。为了可读性的目的分散代码可能会很好,但有时这些空格会在生成的PDF中导致不必要的输出:

\documentclass{beamer}
\开始{document}
\开始{frame}
\框架标题{Tasks}
\开始{overlayarea}{\textwidth}{\textwidth}
\开始{图}
\定心
\只有
{%
\includegraphics[width=.8\textwidth]{example-image-a}%
}%
\只有
{%
\includegraphics[width=.8\textwidth]{example-image-b}%
}%
\只有
{%
\includegraphics[width=.8\textwidth]{example-image-c}%
}%
\结束{图}
\结束{overlayarea}
\结束{帧}
\结束{document}

非常感谢!我不知道这个问题作品
\documentclass{beamer}
\begin{document}

\begin{frame}
  \frametitle{Tasks}

  \begin{overlayarea}{\textwidth}{\textheight}
    \begin{figure}
      \centering
      \only<1>
        {%
          \includegraphics[width=.8\textwidth]{example-image-a}%
        }%
      \only<2>
        {%
          \includegraphics[width=.8\textwidth]{example-image-b}%
        }%
      \only<3>
        {%
          \includegraphics[width=.8\textwidth]{example-image-c}%
        }%
    \end{figure}
  \end{overlayarea}      
\end{frame}

\end{document}