I'm doing my slides with beamer
. At the moment I am not sure about the aspect ratio that will be used at the presentation. I know I can change the ratio with class options of beamer
.
The problem is that changing the aspect ratio changes the document dimension, so I have to adjust some parameters (figure height) in my presentation. I will like to design the presentation for 4:3 and 16:9 ration.
Is it possible to have something like
\ifratio{34}{do somthing}
\ifratio{169}{do ohters}
or
\ifratio{34}{do this}{else this}
Best Answer
The
aspectratio
option doesn't set any useful flag, apart from the page dimensions. One could check for these dimension pairs or else doing a direct check from the options list; here are two macros defined with the help ofexpl3
according to the latter strategy.The macro
\ifaspectratio
takes three arguments, the ratio which we want to test, the true text and the false text.The macro
\xifaspectratio
is more flexible: it takes one mandatory argument, which is a list of pairs{<ratio>}{<text>}
and an optional argument for a "none of the above" case.By adding to
\keys_define:nn { zunbeltz/beameroptions }
one could define similar macros for checking other options.