# beamer: column + [overlay, remember picture] --> additional white vertical space

• I use a column environment in beamer to shorten the text width.
• I addition, I add a picture to the frame using a typical tikz solution: [overlay, remember picture].
• When I have this tikz solution before the column environment then I get an additional vertical space (see MWE).
• I even masked all line breaks with % in the code.

\documentclass[t]{beamer}
\usepackage{tikz}

\begin{document}

% ------------------------------
\begin{frame}
\frametitle{This Works (\texttt{tikzpicture} after \texttt{columns})}

\begin{columns}[onlytextwidth]
\column{.60\textwidth}
Text
\end{columns}

\begin{tikzpicture}[overlay, remember picture]
\node at (current page.east)
[
anchor=east,
xshift=0mm,
yshift=0mm
]
{
\includegraphics[width=0.33\paperwidth]{example-image-a}
};
\end{tikzpicture}

\end{frame}

% ------------------------------
\begin{frame}
\frametitle{This Doesn't Works (\texttt{tikzpicture} before \texttt{columns})}
%
\begin{tikzpicture}[overlay, remember picture]%
\node at (current page.east) %
[%
anchor=east,%
xshift=0mm,%
yshift=0mm%
] %
{%
\includegraphics[width=0.33\paperwidth]{example-image-a}%
};%
\end{tikzpicture}%
%
\begin{columns}[onlytextwidth]
\column{.60\textwidth}
Text
\end{columns}

\end{frame}

% ------------------------------
\begin{frame}
\frametitle{This Works Again(\texttt{tikzpicture} inside \texttt{columns})}
\begin{columns}[onlytextwidth]
\column{.60\textwidth}
%
\begin{tikzpicture}[overlay, remember picture]%
\node at (current page.east) %
[%
anchor=east,%
xshift=0mm,%
yshift=0mm%
] %
{%
\includegraphics[width=0.33\paperwidth]{example-image-a}%
};%
\end{tikzpicture}%
%
Text
\end{columns}

\end{frame}

\end{document}


Can somebody explain why I get the additional space?

• I thought it worked if you put it after, so if that's what you want, what's the problem? – cfr Mar 27 '17 at 2:00
• @cfr I just realized my stupid mistake. The question remains the same. I deleted the mistake. I should go to bed. I need the tikz stuff before the column if I want the picture behind the text. – Dr. Manuel Kuehner Mar 27 '17 at 2:02
• This is an XY problem in that case and you'd be better asking how to Y than how to X, because Ying is easy, whereas Xing may be more difficult. – cfr Mar 27 '17 at 2:36

When remember picture is used, PGF make a marker so that it knows where to put the picture.

\ifpgfrememberpicturepositiononpage%
\hbox to0pt{\pgfsys@markposition{\pgfpictureid}}%
\fi%


This is an invisible box as it has zero width and it typesets nothing, but I assume it is sufficient to count as something so far as TeX is concerned.

The issue is not specific to Beamer. You can reproduce it with the article class.

\documentclass[]{article}
\usepackage{tikz}
\begin{document}

This Works (\texttt{tikzpicture} after text)

Text

\begin{tikzpicture}[overlay, remember picture]
\node at (current page.east)
[
anchor=east,
xshift=0mm,
yshift=0mm
]
{
\includegraphics[width=0.33\paperwidth]{example-image-a}
};
\end{tikzpicture}

This Doesn't Work (\texttt{tikzpicture} before text)

\begin{tikzpicture}[overlay, remember picture]%
\node at (current page.east) %
[%
anchor=east,%
xshift=0mm,%
yshift=0mm%
] %
{%
\includegraphics[width=0.33\paperwidth]{example-image-a}%
};%
\end{tikzpicture}

Text

\end{document}


However, in this case, eliminating the blank line does prevent the additional space.

This doesn't work in the case of Beamer's columns environment because the environment executes an explicit \par anyway.

\newenvironment<>{columns}[1][]{%
\begin{actionenv}#2%
...
\par%
...


But you don't need to typeset the picture first to put it behind the text. You can put it in the background using Beamer's own facilities e.g. by using the background template.

\documentclass[t]{beamer}
\usepackage{tikz}
\begin{document}
\setbeamertemplate{background}{%
\begin{tikzpicture}[overlay, remember picture]
\node at (current page.east)
[
anchor=east,
xshift=0mm,
yshift=0mm
]
{
\includegraphics[width=0.33\paperwidth]{example-image-a}
};
\end{tikzpicture}%
}

\begin{frame}
\frametitle{This Works (\texttt{tikzpicture} behind \texttt{columns})}

\begin{columns}[onlytextwidth]
\column{.60\textwidth}
Text
\end{columns}

\end{frame}

\end{document}


• Thanks for the detailed explanation including a new approach :). – Dr. Manuel Kuehner Mar 27 '17 at 6:20
• Do you think that it would be advisable to patch the column environment? – Dr. Manuel Kuehner Mar 27 '17 at 18:54
• @Dr.ManuelKuehner Ask Joseph. I assume that the \par is there for a reason, but Joseph could tell you. – cfr Mar 27 '17 at 21:10
• @Dr.ManuelKuehner I guess the question is partly: why? Beamer already provides methods for changing the background canvas and template. And I doubt this is specific to the columns environment. – cfr Mar 27 '17 at 21:12
• @Dr.ManuelKuehner Like I said: one for Joseph. – cfr Mar 27 '17 at 22:00