2
  • I want to place/position images/pictures/elements in beamer absolutely.
  • I use the well known remember picture and \node at (current page.xx) appraoch.

In my MWE I want to position the picture in the lower right corner of the frame but there is a unexpected "padding" remaining.


% 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}

enter image description here


Update 1 after user erik's Comment

  • Adding inner sep = 0pt to \node at (current page.south east) [anchor = south east, inner sep = 0pt] almost solves the problem.
  • There is still a bit padding left, or is this a viewer problem?

enter image description here

Update 2 after user marmot's Comment

Final solution!

\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}
  • 2
    Add inner sep=0pt and outer sep=0pt to your tikzpicture options. – erik May 21 at 14:30
  • @erik Thanks! I updated the question. If you provide an answer, then I will at least upvote it and probably accept if there is nothing else to optimize. – Dr. Manuel Kuehner May 21 at 14:34
  • @marmot Thanks! I did not think of the inner/outer sep stuff in this context. I was unable to Google my problem before -- but I can't be the first one to encounter this "problem" :). – Dr. Manuel Kuehner May 21 at 14:37
  • @erik I am offline now -- I will accept your answer later if you provide one. – Dr. Manuel Kuehner May 21 at 14:41
  • @marmot I am offline now -- I will upvote your answer later if you provide one. – Dr. Manuel Kuehner May 21 at 14:41
3

TikZ automatically adds a bit of space around nodes. Most of the space is due to inner sep, but there's a very small outer sep as well (analogous to padding and margin in CSS, I think). You can remove this by setting inner sep=0 and 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}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.