我正在使用textpos
软件包将图像放置在投影仪幻灯片上。我的问题是,我想让这些图像在某些幻灯片中位于其他幻灯片的前面(软件包选项“覆盖”),而在其他幻灯片中位于投影仪演示文稿下方栏的后面。
是否可以更改文档中的包选项?
答案1
答案2
除了,还可以通过下面示例中定义的 textpos
便捷命令使用 TikZ 方式的绝对定位。使用起来很简单;\placetextbox
是-等级排版材料的使用顺序决定了它的使用顺序:
\documentclass{beamer}
\usepackage{mwe} % example images
\usepackage{lipsum} % example text
\usepackage{tikz}
\usetikzlibrary{calc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% absolute positioning of typeset material
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\placetextbox}[4][center]{%
% [#1]: box anchor: center (default) |
% south west | west | north west | north |
% north east | east | south east | south |
% mid west | mid | mid east |
% base west | base | base east
% #2: horizontal position (fraction of page width)
% #3: vertical position (fraction of page height)
% #4: content
%
\tikz[remember picture,overlay,x=\paperwidth,y=\paperheight]{%
\node[anchor=#1,inner sep=0pt]
at ($(current page.south west)+(#2,#3)$) {#4};
}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{frame}
\placetextbox[north west]{0}{1}{\includegraphics[width=0.6\paperwidth]{example-image-a}}
%normal text
\lipsum[1]
\placetextbox[south east]{1}{0}{\includegraphics[width=0.6\paperwidth]{example-image-b}}
\end{frame}
\end{document}