I am designing a beamer theme which shall be available in 16:9 and 4:3. To distinguish between the aspect ratio I came across Pass beamer class options to beamer theme and Query beamer document class option aspectratio in a .sty file for solutions in general, applying the second one for a simple print of the current aspect ratio:
\documentclass[aspectratio=169]{beamer}
\usepackage{filecontents}
\begin{filecontents}{beamerinnerthemeissue.sty}
\mode<presentation>
\defbeamertemplate*{title page}{texsx}[1][]
{
\vskip5cm%
\begin{beamercolorbox}[wd=12cm,leftskip=3cm,#1]{date}
This presentation has the aspectratio=
\makeatletter
\ifdimcomp{\beamer@paperwidth}{=}{12.80cm}{43}{}
\ifdimcomp{\beamer@paperwidth}{=}{14.85cm}{141}{}
\ifdimcomp{\beamer@paperwidth}{=}{13.50cm}{32}{}
\ifdimcomp{\beamer@paperwidth}{=}{12.50cm}{54}{}
\ifdimcomp{\beamer@paperwidth}{=}{14.00cm}{149}{}
\ifdimcomp{\beamer@paperwidth}{=}{16.00cm}
{
\ifdimcomp{\beamer@paperheight}{=}{10.00cm}{1610}{}
\ifdimcomp{\beamer@paperheight}{=}{9.00cm}{169}{}
}{}
\makeatother
\end{beamercolorbox}
\vfill
}
\mode<all>
\end{filecontents}
\useinnertheme{issue}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}
However if one has to do this for multiple style elements (title page, part page, section page, ...), what is the neatest way of only making the comparison once and not in every single style element that is size dependent? I was thinking about storing the result in a simple \if43
and \if169
or a \is169or43{%16:9 code}{%4:3 code}
and can then use those later.
But where should I place a check in the theme in general to check that either 16:9 or 4:3 was selected, because all other sizes won't work and then prepare the commands as above to be used by the rest of the them? Is there an element which for sure is parsed and applied directly after \begin{document}
?