I was customizing a beamer theme that have to be used by many people at my workplace. I want to show an error whenever frame-title takes more than two lines. Please don't ask why title is so long. So I thought that by defining a custom length and setting it to the width of frame-title, I can compare this custom length to a threshold value and show the error. However I am not able to set the width of my custom length to frame-title. The error I am getting is undefined control sequence. An MWE is as following:
\documentclass{beamer}
\makeatletter
\newlength \myl
\def \cm {\beamer@frametitle}
\settowidth{\myl}{\cm} %error ! Undefined control sequence.
%\settowidth{\myl}{Example frame} %68.2551pt
\makeatother
\begin{document}
\begin{frame}{Example frame}
\the \myl
\end{frame}
\end{document}
I am new to custom themes. So If anyone can help me for if construct of lengths with a greater than comparison. It will be grate for me. I already tried using \if and \ifx available on wikibooks which both did not work.



allowframebreaksoption). So thinking about it again,\beamer@frametitleand also Werners solution will result in a wrong width in these cases. So you really should use\insertframetitle. – Benjamin May 03 '16 at 08:52\insertframetitle. – Benjamin May 03 '16 at 09:32