The definitive full-frame graphic command for beamer in LaTeX

2018-06-02: This content has been superseded by this newer post: Finally the definitive full-frame graphic commands for beamer in LaTeX. Look there for an updated version.

After my previous post on the same topic, I have improved upon the command considerably. This time, it is based on Matthew Leingang’s answer on the question Image on full slide in beamer package.

Usage:

[code lang=”latex” light=”1″]
\fullframegraphic[optional credits]{path/to/image}
[/code]

To use, copy this definition in your preamble. Requires package tikz.

[code lang=”latex”]
\newcommand{\fullframegraphic}[2][]{%
\begin{frame}[plain]%
\begin{tikzpicture}[remember picture,overlay]%
\node[at=(current page.center)] {%
\includegraphics[height=\paperheight,width=\paperwidth,keepaspectratio]{#2}%
};%
% optional argument: credits on lower-right corner
\ifx\relax#1\relax\else%
\node[at=(current page.south east), anchor=south east,font=\tiny,text=white,fill=black,fill opacity=.5,text opacity=1,inner sep=2pt,text height=1ex,text depth=.25ex] {#1};%
\fi%
\end{tikzpicture}%
\end{frame}}
[/code]

Visual example (for the credits overlay):

fullframegraphic-DA_Cambridge_c1937

Source: File:DA_Cambridge_c1937.jpg on Wikimedia Commons


Posted

in

,

by

Tags: