I wanted to add a logo at the top right corner of my frames so I edited the frametitle
with \addtobeamertemplate{frametitle}
and added the logo using a TikZ \node
(as explained in this answer), like this:
\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north east,yshift=2pt] at (current page.north east) {\includegraphics[height=0.8cm]{example-image}};
\end{tikzpicture}}
The problem is that this modification adds an additional space between the frametitle
and the body of the frame, thus wasting very valuable space.
This is how my frame looks before adding the \addtobeamertemplate{frametitle}
block:
And this is how it looks after adding it (notice the wider gap):
How can I remove that gap?
Here is my MWE:
\documentclass{beamer}
\usetheme{Madrid}
\usepackage{tikz}
\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north east,yshift=2pt] at (current page.north east) {\includegraphics[height=0.8cm]{example-image}};
\end{tikzpicture}}
\begin{document}
\begin{frame}
\frametitle{Frame title}
\includegraphics[height=\textheight]{example-image}
\end{frame}
\end{document}