[Tex/LaTex] simple command for the available height in a beamer slide

beamerfloatsheight

I would like to add two figures figures to a beamer slide, one on top of the other. Is there a simple command, similar to \linewidth or \textwidth for the height? The figures have dimensions roughly twice as wide as they are tall. I would like them to use the full vertical space without encroaching on the title/controls. If their dimensions were reverse, I would put them side by side using width=0.5\linewidth. I am not sure the height analog.

Here is what I am using now. As an alternative, I use the \paperhieght but then have to visually check that the chosen scale factor left enough room for the title and controls at the bottom.

 \begin{frame}{4$\times$167 gH5 in 10 mM K$^{+}$: Comparison}
  \begin{center}
    \includegraphics[height=0.4\paperheight]{figures/array_models/i1_r_c000_4x167_h5_k010_33_fit}\\
    \onslide<2>{
      \includegraphics[height=0.4\paperheight]{figures/array_models/i1_r_best1000_c000_4x167_h5_k010_33_fit}
    }
  \end{center}
\end{frame}

In addition to having to check the scale factor, this also has the disadvantage that it must be changed if I add/remove the frame title or switch to a different theme. If there I instead used the available slide height, it may not need to be updated.

Best Answer

@cfr is right. The dimension \beamer@frametextheight is calculated very lately. In fact, this dimension is used at only two places: \framezoom and shrink. Thus one has two ways to utilize the full vertical space.

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\frame{{use \tt\string\framezoom}
    \framezoom<1><2>(0cm,0cm)(5cm,5cm)
    \tikz\draw(0,0)grid(5,5);
}
\frame{{use \tt shrink}
    \centering
    \tikz\draw(0,0)grid(20,20);
}
\frame[shrink]{{use \tt shrink}
    \centering
    \tikz\draw(0,0)grid(20,20);
}
\end{document}

However it is annoying that the contents are not centered. One might want to check beamerbaseframesize.sty and modify the calculation by themselves.

One might use the hook used by shrink but, instead, fill in the content they want.

\makeatletter
\frame{{use hook from \tt shrink}
    \global\beamer@shrinktrue
    \gdef\beamer@shrinkframebox{
        \setbox\beamer@framebox=\vbox to\beamer@frametextheight{
            \centering
            \tikz[font={\tt}]\draw(0,0)node[above left]{(0,0)}rectangle(4,\beamer@frametextheight)node[below right]{(4,\string\beamer@frametextheight)}(2,.5\beamer@frametextheight)circle(.05)node[right]{(2,.5\string\beamer@frametextheight)};
        }
    }
}