[Tex/LaTex] How to change the aspect ratio in beamer without passing the aspectratio option

beamerthemes

I started to create a custom theme for beamer slides, and I want to change the default aspect ratio for this theme. Of course I can use \documentclass[aspectratio=169]{beamer} in every document, but I'd like to keep everything in *.sty files. In beamer.cls I found definitions of \beamer@paperwidth and \beamer@paperheight, but setting these lengths in bemerthemeMYTHEME.sty as follows has no effect on the result.

\mode<presentation>
\setlength\beamer@paperwidth{16.00cm}
\setlength\beamer@paperheight{10.00cm}

What would be a proper way to change the default aspect ratio in *.sty? Shell I use beamerouterthemeMYTHEME.sty or bemerthemeMYTHEME.sty for this?

Best Answer

A wrapper class beamer16x9.cls can be easily written:

\ProvidesClass{beamer16x9}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{beamer}}
\ProcessOptions\relax
\LoadClass[aspectratio=169]{beamer}
\endinput

Then starting a document with

\documentclass[<options>]{beamer16x9}

is equivalent to saying

\documentclass[aspectratio=169,<options>]{beamer}

The beamer16x9.cls file should be in one of the canonical places where TeX engines look for input.