How can I define a new aspectratio for beamer?

As requested; to add a new geometry setting to beamer, first make sure you are changing a local copy of beamer.cls. You can see where the file is in your computer by looking at the beginning of log:

(c:/texlive/2019/texmf-dist/tex/latex/beamer/beamer.cls
Document Class: beamer 2019/09/29 v3.57 A class for typesetting presentations

then copy that file to the current directory. Rename it if you prefer. Then open the file and look for something like this:

\DeclareOptionBeamer{aspectratio}[43]{%
  \ifnum#1=1610 %
    \setlength\beamer@paperwidth{16.00cm}%
    \setlength\beamer@paperheight{10.00cm}%
  \else\ifnum#1=169 %
    \setlength\beamer@paperwidth{16.00cm}%
    \setlength\beamer@paperheight{9.00cm}%
  <...>
  \fi\fi<...>

Here the aspectratio is the option name and [43] is the default value. To add a new option, duplicate one block from one \else\ifnum to the next and change it as you want:

  \else\ifnum#1=916 %
    \setlength\beamer@paperwidth{9.00cm}%
    \setlength\beamer@paperheight{16.00cm}%

and then make sure to add an extra \fi to the end. The whole thing should look like this:

\DeclareOptionBeamer{aspectratio}[43]{%
  \ifnum#1=1610 %
    \setlength\beamer@paperwidth{16.00cm}%
    \setlength\beamer@paperheight{10.00cm}%
  \else\ifnum#1=169 %
    \setlength\beamer@paperwidth{16.00cm}%
    \setlength\beamer@paperheight{9.00cm}%
  \else\ifnum#1=149 %
    \setlength\beamer@paperwidth{14.00cm}%
    \setlength\beamer@paperheight{9.00cm}%
  \else\ifnum#1=54 %
    \setlength\beamer@paperwidth{12.50cm}%
    \setlength\beamer@paperheight{10.00cm}%
  \else\ifnum#1=43 %
    \setlength\beamer@paperwidth{12.80cm}%
    \setlength\beamer@paperheight{9.60cm}%
  \else\ifnum#1=32 %
    \setlength\beamer@paperwidth{13.50cm}%
    \setlength\beamer@paperheight{9.00cm}%
  \else\ifnum#1=141 %
    \setlength\beamer@paperwidth{14.85cm}%
    \setlength\beamer@paperheight{10.50cm}%
  \else\ifnum#1=916 %                        <
    \setlength\beamer@paperwidth{9.00cm}%     | One more option
    \setlength\beamer@paperheight{16.00cm}%  <
  \fi\fi\fi\fi\fi\fi\fi
  \fi % One more \fi
}

Then using it:

\documentclass[aspectratio=916]{beamer}
\usepackage{lipsum}
\begin{document}
\begin{frame}{Lorem Ipsum}
\lipsum[1]
\end{frame}
\end{document}

produces:

enter image description here


Internally, beamer uses the geometry package to set the page dimensions. So you can tell geometry to turn the page using the landscape option -- this option doesn't force landscape, what it does is swap the height and width of the page.

Because beamer loads the geometry package, you have to use the \PassOptionsToPackage method of getting the landscape option to the geometry package.

(This only works if your desired page size is simply a rotation of an existing one. If you want an entirely new page size, you'd need the solution from the answer of Phelype Oleinik.)

\PassOptionsToPackage{landscape}{geometry}
\documentclass{beamer}

\usetheme{Warsaw}

\begin{document}

\begin{frame}{A Portrait Presentation}
\begin{theorem}
Theorems are easier to prove in portrait orientation.
\end{theorem}
\begin{proof}
This frame is its own proof.
\end{proof}
\end{frame}
\end{document}

Beamer presentation in portrait orientation