JeT
I need to create a half frame (`hframe`) environment so that text only covers horizontally half a frame.
![halfFrame.png](/image?hash=272afc9d3f28bae034174320ac2dcbda13979f985d2efcae3f104a5132f8c416)
For that I use
![setbeamersize2.png](/image?hash=d7f6feeffde92aa884f797ed9ab731c3b0a09c03a8f4148b8191b66cc1365b01)
However, I get an error trying to apply it to my `hframe` environment.
What am I missing ?
MWE
```
\documentclass[aspectratio=169]{beamer}
\usepackage{showframe}
%\usepackage{layout}
%Here it, of course, applies to all frames...
\setbeamersize{text margin right=8cm}
% I put 8 cm but you must have a way to get the exact half size of the frame.
\newenvironment{hframe}[1]{%
\setbeamercolor{background canvas}{bg=yellow}
%\setbeamersize{text margin right=8cm}
% if I add this here, it generates an error
\begin{frame}[environment=hframe]{#1}
}{
\end{frame}
}
\begin{document}
%\begin{frame}
%\layout
%\end{frame}
\begin{frame}
\frametitle{first slide}
regular
\end{frame}
\begin{hframe}{some title}
hframe so that I can leave my slide half empty.
\end{hframe}
\begin{frame}
\frametitle{Other}
regular again
\end{frame}
\end{document}
```
Top Answer
samcarter
`\setbeamersize` is meant to be used to globally change the layout of the whole presentation and, as the error message says, it has to be used before the start of the document in the preamble.
If you only want to change the layout of some of your frames, I would use a `minipage` instead:
```
\documentclass[aspectratio=169]{beamer}
\usepackage{showframe}
%\usepackage{layout}
%Here it, of course, applies to all frames...
%\setbeamersize{text margin right=8cm}
% I put 8 cm but you must have a way to get the exact half size of the frame.
\usepackage{environ}
\NewEnviron{hframe}[1]{%
\setbeamercolor{background canvas}{bg=yellow}
% if I add this here, it generates an error
\begin{frame}[environment=hframe]{#1}
\begin{minipage}{.5\textwidth}
\BODY
\end{minipage}
\end{frame}
}
\begin{document}
%\begin{frame}
%\layout
%\end{frame}
\begin{frame}
\frametitle{first slide}
regular
\end{frame}
\begin{hframe}{some title}
hframe so that I can leave my slide half empty.
\end{hframe}
\begin{frame}
\frametitle{Other}
regular again
\end{frame}
\end{document}
```