EDIT: I should have tested this in more detail before posting. It seems that the following frames have their geometry/layout modified... So please be aware that there might be some issues.
After looking at different answers and comments from different questions around this problem of beamer still having a left margin in plain frames, let me post the solution I just found, to get a really empty plain frame, no margins etc. in an easy automated generic way. In such a frame, one can do as wished, for example put a graphic that exactly takes the whole width of the frame, or center it with exactly the same left and right spaces, without having to cheat with horizontal offsets or whatever.
The problem I had was that \setbeamersize{text margin left=0pt}
or the likes can't be used in a local way, it has to be in the preamble, it can't be in the body and also not in command or environment definitions.
The solution was to use \newgeometry
, as used in the OPs question, from the geometry
package, loaded by beamer
, and restrain it locally as suggested in the comment above. And it needs no fancy stuff, no ad hoc lengths, etc.
It seems that it hasn't been posted like I am about to do, and I think it could be interesting to a wide audience (I looked long before finding it). And the only other answer I know of that needs no ad hoc ajustments, namely this one, uses little more beamer
-hacking knowledge.
Solution for one isolated frame:
{\newgeometry{margin=0pt} %locally set margins to zero
\setbeamertemplate{background canvas}[default] %not too sure, but may be needed if you have a background image
\begin{frame}[plain]
%frame content that can really fill the whole page
\end{frame}
}
And if you need this on a regular basis, define it as a new environment, e.g. emptyframe
, in the preamble:
\newenvironment{emptyframe}
{
% not too sure, but may be needed if you have a background image
% that should not appear on this kind of frame:
\setbeamertemplate{background canvas}[default]
% locally set margins to zero: (notice the use of \bgroup ... \egroup
% to limit the scope of the geometry restriction
% where curly brackets {} aren't possible)
\bgroup \newgeometry{margin=0cm}
\begin{frame}[plain]
}
{
\end{frame}
\egroup
}
After that, in the body of the document, use it alternatively to a frame
environment:
\begin{emptyframe}
% frame content that can really fill the whole page
\end{emptyframe}
Note 1: you might also need to turn off navigation symbols. To this effect, add \setbeamertemplate{navigation symbols}{}
next to \setbeamertemplate{background canvas}[default]
.
Note 2: this solution is not limited to getting empty frames, it is (I think, didn't test) customizable up to the limits of \newgeometry
.