- 我想要
beamer
绝对地放置/定位图像/图片/元素。 - 我使用众所周知的
remember picture
方法\node at (current page.xx)
。
在我的 MWE 中,我想将图片定位在右下角但有一个意想不到的剩余“填充”。
% Compile twice (--> 'remember picture' option)!
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
% Setting background to "not-white" in order to make the borders clearer.
\setbeamercolor{background canvas}{bg = green}
\begin{frame}[t]
\frametitle{Test}
Test
\begin{tikzpicture}[overlay, remember picture]
%
\node at (current page.south east) [anchor = south east] {
\includegraphics[width = 60mm]{example-image-a}
};
%
\end{tikzpicture}
\end{frame}
\end{document}
用户更新 1埃里克的评论
- 添加
inner sep = 0pt
几乎\node at (current page.south east) [anchor = south east, inner sep = 0pt]
可以解决问题。 - 还剩下一些填充,或者这是查看器的问题?
用户更新 2土拨鼠的评论
最终解决方案!
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
% Setting background to not white in order to make the borders clearer.
\setbeamercolor{background canvas}{bg = green}
\begin{frame}[t]
\frametitle{Test}
Test
\begin{tikzpicture}[overlay, remember picture]
%
\node at (current page.south east) [
anchor = south east,
inner sep = 0pt, % <-- Solution
outer sep = 0pt, % <-- Solution
] {
\includegraphics[width = 60mm]{example-image-a}
};
%
\end{tikzpicture}
\end{frame}
\end{document}
答案1
钛钾Z 会自动在节点周围添加一些空间。大部分空间是由于,但也inner sep
有非常小的空间(我认为类似于 CSS 中的填充和边距)。您可以通过设置和来删除它。outer sep
inner sep=0
outer sep=0
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
% Setting background to "not-white" in order to make the borders clearer.
\setbeamercolor{background canvas}{bg = green}
\begin{frame}[t]
\frametitle{Test}
Test
\begin{tikzpicture}[overlay, remember picture]
\node at (current page.south east) [anchor = south east,inner sep=0pt,outer sep=0pt] {
\includegraphics[width = 60mm]{example-image-a}
};
\end{tikzpicture}
\end{frame}
\end{document}