Skip to content

Instantly share code, notes, and snippets.

@DenisKramer
Created January 7, 2021 09:35
Show Gist options
  • Select an option

  • Save DenisKramer/e2653a94bc50b49db91f460d99f7343f to your computer and use it in GitHub Desktop.

Select an option

Save DenisKramer/e2653a94bc50b49db91f460d99f7343f to your computer and use it in GitHub Desktop.
LaTeX Beamer frame environment with image background
% This beamer environment provides a simple way to make slides with full-size images
%
% Usage:
% \begin{imageframe}[keepaspectratio,width=\paperwidth]{bg_image.jpg}
Here comes my slide content
\end{imageframe}
%
% The environment scales the image to fit the slide by default in a way that ensures the
% entire picture is visible. That is usually not what you want. Use the optional parameter
% to scale it as needed. Some common options are:
%
% 1) Scale to width: keepaspectratio,width=\paperwidth
% 2) Scale to height: keepaspectratio,height=\paperheight
% 3) Squeeze to fit: width=\paperwidth,height=\paperheight
%
\newenvironment{imageframe}[2][keepaspectratio,width=\paperwidth,height=\paperheight]
{%
\begingroup%
\setbeamertemplate{navigation symbols}{}%
\usebackgroundtemplate{\includegraphics[#1]{#2}}%
\begin{frame}[plain]%
}{%
\end{frame}%
\endgroup%
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment