我需要用项目更改替换图形,我找到了如何做到这一点的方法。但我还需要在项目内重叠图像。这意味着图像应该在项目内重叠。随着项目的改变,应该显示一组新的图像,这些图像将相互重叠。我不知道该怎么做,因为我尝试插入代码,但这种方式不起作用。
\documentclass[aspectratio=169, 10pt]{beamer}
\def\Put(#1,#2)#3{\leavevmode\makebox(0,0){\put(#1,#2){#3}}}
\begin{document}
\begin{frame}{CFD}
\begin{itemize}
\item <1-> aaa
\item <2-> bbb
\item <3-> ccc
\item <4-> ddd
\end{itemize}
\includegraphics<1>[height=3cm]{air.png}\pause
\Put(10,50){\color{blue}\includegraphics<1>[height=3cm]{air1.jpg}}\pause
\Put(100,30){\color{red}\includegraphics<1>[height=3cm]{cabin2.png}}
\includegraphics<2>[height=3cm]{water.png}\pause
\end{frame}
\end{document}
答案1
可能有点过头了,但你可以使用 tikz:
\documentclass[aspectratio=169, 10pt]{beamer}
\usepackage{tikz}
% trick taken from https://topanswers.xyz/tex?q=1989
\tikzset{
use page relative coordinates/.style={
shift={(current page.south west)},
x={(current page.south east)},
y={(current page.north west)}
},
}
\begin{document}
\begin{frame}[t]{CFD}
\begin{itemize}
\item <1-> aaa
\item <4-> bbb
\item <6-> ccc
\item <7-> ddd
\end{itemize}
\begin{tikzpicture}[remember picture, overlay,use page relative coordinates]
\node<1-3> at (0.7,0.7) {\includegraphics[height=3cm]{example-image-duck}};
\node<2-3> at (0.8,0.8) {\includegraphics[height=3cm]{example-image-duck}};
\node<3> at (0.75,0.6) {\includegraphics[height=3cm]{example-image-duck}};
\node<4-5> at (0.75,0.45) {\includegraphics[height=3cm]{example-image-a}};
\node<5> at (0.7,0.5) {\includegraphics[height=3cm]{example-image-a}};
\end{tikzpicture}
\end{frame}
\end{document}