I've created a beamer environment based on this discussion: Is there a simple command for the available height in a beamer slide? The only issue is that it doesn't work with the overlays. Here is the MWE (to see the error, uncomment the line starting with \only):
\documentclass{beamer}
\usepackage{tikz,environ}
\makeatletter
\NewEnviron{tikzframe}[2][c]{%
\begin{frame}[#1]{#2}
\global\beamer@shrinktrue
\gdef\beamer@shrinkframebox{\setbox\beamer@framebox=\vbox to\beamer@frametextheight{
\begin{tikzpicture}[x=.5\linewidth,y=0.5\beamer@frametextheight]
\path[use as bounding box] (-1,-1) rectangle (1,1);
\BODY
\end{tikzpicture}}}
\end{frame}}
%\NewEnviron{tikzframe}[2][c]{%
%\begin{frame}[#1]{#2}%
% \begin{tikzpicture}[x=.5\linewidth,y=0.4\paperheight]
% \path[use as bounding box] (-1,-1) rectangle (1,1);
% \BODY
% \end{tikzpicture}
%\end{frame}}
\begin{document}
\begin{tikzframe}{Title}
\node at (-.5,0) {A};
\node at (.5,0) {B};
% \only<2>{\node at (.5,0) {B};}
\end{tikzframe}
\end{document}
do you have ideas what is wrong?
\begin,\end{frame}but can't find it since it is buried in the new environment. I doubt there is a solution but who knows. – percusse Oct 22 '17 at 18:11[shrink]will initialize some macros. In your case you try to apply the third method without the initialization so it fails. I will try to dig out details. – Symbol 1 Oct 22 '17 at 20:52\def\beamer@shrinkfactorinv{1}at the beginning of your document then everything works fine. It is not clear to me what is the meaning of\beamer@shrinkfactorinvwhile there is another macro called\beamer@shrinkfactor. – Symbol 1 Oct 22 '17 at 21:06