Beamer 中另一张图片的上方

Beamer 中另一张图片的上方

我正在尝试将一张图片放在 Beamer 中另一张图片的上方。我正在使用

\documentclass[slidestop,compress,mathserif,12pt,xcolor=dvipsnames]{beamer}
\graphicspath{{images/}}
\definecolor{LHCblue}{RGB}{4, 114, 255}
\usecolortheme[named=LHCblue]{structure}
\usepackage[bars]{beamerthemetree} % Beamer theme v 2.2
\usepackage{kerkis}
\usepackage{multimedia}
\usepackage{subfigure}
\mode<presentation>
%frame
\newcommand*\oldmacro{}%
\let\oldmacro\insertshorttitle%
\renewcommand*\insertshorttitle{%
     \oldmacro\hfill%
  \insertframenumber\,}%/\,\inserttotalframenumber
\setbeamertemplate{footline}[frame number]
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\setbeamercovered{higly dynamic}
\usetheme[watermark=ntua-logo.jpg]{Ilmenau} % Beamer theme v 3.0
\useoutertheme[subsection=true]{smoothbars}%Beamer Outer Theme-circles on top

\useinnertheme{circles} %rectangle bullet points instead of circle ones
\usepackage{beamerthemebars}
\setbeamercolor{navigation symbols dimmed}{fg=red!80!black}
\setbeamercolor{navigation symbols}{fg=red!80!black}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\title[July 2012 H4 Test Beam\hspace{3cm} Stony Brook, NYC]{July 2012 H4 Test Beam}
\author[Stamatopoulos N. Athanasios\hspace{2.5cm}{[email protected]}]            {Stamatopoulos N. Athanasios}
\institute{NTUA/CERN}
\logo{%
  \makebox[0.99\paperwidth]{%
    \includegraphics[width=1cm,keepaspectratio]{cern_logo_white.jpg}%
    \hfill%
    \includegraphics[width=1cm,keepaspectratio]{ntua-logo.jpg}%
  }%
}

\usepackage{textpos}
\usepackage{tikz}
\usetikzlibrary{%
calc,%
fadings,%
shadings%
}

\usetikzlibrary{arrows,snakes,shapes}
%\usepackage{enumitem}
%\usepackage{paralist}

 \begin{document}

\begin{frame}
%\uncover<1->{\begin{figure}
%  \begin{center}
%    \includegraphics[width=10cm]{layers1}
%  \end{center} 
%\end{figure}}
%\hspace{-15cm}
%\uncover<2->{
%\begin{figure}
%  \begin{center}
%    \includegraphics[width=10cm]{layers}
%  \end{center} 
%\end{figure}}
\hspace{-15cm}
\begin{figure}
    \centering
    \uncover<1->{\includegraphics[width=10cm]{layers1}}%
    \llap{\raisebox{0cm}{%  move next graphics to top right corner
     \uncover<2->{ \includegraphics[width=10cm]{layers}}%
    }}
%    \caption{My overlay figure.}
  \end{figure}  
\end{frame}

\end{document}

我也尝试过只使用两个图像之间figure的环境\hspace{},但没有效果。{代码在注释中}

答案1

不要使用figure环境,它在投影仪中没有任何实际意义

\PassOptionsToPackage{demo}{graphics}%% Delete it later
\documentclass{beamer}
\usepackage{caption}
\begin{document}
\begin{frame}{Titel}{Subtitle}
\centering
\includegraphics[height=0.35\textheight]{foo}
\captionof{figure}{first image}
\includegraphics[height=0.35\textheight]{bar}
\captionof{figure}{second image}
\end{frame}

\end{document}

在此处输入图片描述

这里与覆盖层相同(彼此叠在一起)

\PassOptionsToPackage{demo}{graphics}
\documentclass{beamer}
\usepackage{caption}
\begin{document}
\begin{frame}{Titel}{Subtitle}
\centering
\only<1>{\includegraphics[height=0.7\textheight]{foo}
\captionof{figure}{first image}}
\only<2>{\includegraphics[height=0.7\textheight]{bar}
\captionof{figure}{second image}}
\end{frame}

\end{document}

在此处输入图片描述

相关内容