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}}
I would like to adjust the height of the logo so that it matches exactly the height of the frametitle box.
Currently I can only do this by trial and error, changing the image height and the yshift value of the \node. This makes getting the desired result tricky and very time consuming.
As far as I know, the frametitle box is created with the beamercolorbox environment (e.g. here and here). I would like to know if there is a command that gets the height of the frametitle box, so that I can assign it to the logo height like this:
\includegraphics[height=\frametitleheight]{example-image}
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}
Hello world!
\end{frame}
\end{document}



\setbeamertemplate{frametitle}? – codeaviator Nov 15 '17 at 13:43yshiftvalue of the TikZ\nodeautomatically? Thank you. – codeaviator Nov 16 '17 at 14:50