0

I already search for beamerand aspectratio. I have found How to automatically create 4:3 AND 16:9 versions of my LaTeX Beamer slides?, which comes near to my problem, but does not solve it.

I sometimes do have to switch back to an old device with 4:3 aspect ratio. It is no problem, to change the aspectratio switch in my document preamble and rerun LaTeX. While this gives me adequate slides in 98 % of the time, there are some slides, which get overfull \hbox errors.

Is there a way to get around this problem, by having two different LaTeX code blocks, one which is choosen, if the aspectratio is given as =169 and one, when it is defined as =43?

Something like

\ifx{aspectratio}{43}
   code special to\\
   this ratio
\else
   normal code with longer lines
\fi

would help a lot.

Jan
  • 5,293

1 Answers1

2

Maybe as a workaround:

\newcommand{\aspectratio}{43}
%\newcommand{\aspectratio}{169}
\documentclass[aspectratio=\aspectratio]{beamer}

\begin{document} test

\ifnum\aspectratio=169 % foo \else bar \fi

\end{document}


With the current beamer development version (which should be included in beamer v3.70 or newer), one can now use the \insertaspectratio macro to access the aspect ratio of the presentation:

\documentclass[
    aspectratio=169
%   aspectratio=43
]{beamer}

\begin{document}

\begin{frame}

\ifnum\insertaspectratio=169 do something \else something else \fi \end{frame}

\end{document}