136

I would like to make a slide of only one image without any borders or any other beamer specific element.

I tried :

\begin{frame}[plain]
\includegraphics[keepaspectratio=true,width=1\paperwidth]{kernel-panic.png}
\end{frame}

But I still get a border on the left, top and bottom.

Later edit: width=1.2\paperwidth seems to remove top and bottom borders. I still have a left border and some navigation elements on bottom right.

Alexandru
  • 2,465
  • 4
  • 18
  • 10
  • My guess is that space on top and bottom come from the fact that your picture has other proportions than the beamer frame. For the left margin, you might want to check my answer to this same(?) question, where I claim it's the easiest way to achieve a full slide image in beamer. – benjamin Oct 19 '16 at 08:55
  • The name of the png file somewhat suggests the purpose of the questions ;) – Alessandro Cuttin Mar 17 '20 at 18:17

9 Answers9

114

This works:

\documentclass{beamer}
\title{test of full size graphic}
\usepackage{tikz}
\usetheme{AnnArbor}

\begin{document}

\begin{frame}
    \maketitle
    Notice the fancy presentation theme.
\end{frame}

{ % all template changes are local to this group.
    \setbeamertemplate{navigation symbols}{}
    \begin{frame}<article:0>[plain]
        \begin{tikzpicture}[remember picture,overlay]
            \node[at=(current page.center)] {
                \includegraphics[keepaspectratio,
                                 width=\paperwidth,
                                 height=\paperheight]{yourimage}
            };
        \end{tikzpicture}
     \end{frame}
}

\begin{frame}
    symbols should be back now
\end{frame}

\end{document}

You have to run beamer twice to get the image centered in the right place. But if you have any other aux-file tricks (e.g., table of contents) you need to do that anyway.

If you're not already using tikz, you can save your image as a pdf and then use \includepdf (part of the pdfpages package). This will get you into trouble if you want to print your slides as an article or handout, though.

If you use article mode with your slides, you'll get the image on a full page of the article PDF too. You probably don't want this. The <article:0> mode specification keeps this frame from being included in any article mode documents. You could also make a separate \includegraphics line for article mode that would format it properly.

Matthew Leingang
  • 44,937
  • 14
  • 131
  • 195
  • 1
    Note that this does not work with \multiinclude – Tim van Dalen Apr 02 '12 at 14:08
  • @TimvanDalen, it did for me. Replace \includegraphics... with \multiinclude[graphics={height=\paperheight}]{yourimage}. – fgregg May 30 '12 at 03:20
  • This did not center the animated graphic (aka video) I was trying to include using the animate package. It put it on the page but it was not centered (though the part overhanging the page was strangely still visible, just off the page). – Steven C. Howell Nov 10 '15 at 13:29
  • 1
    Depending on the aspect ratio of your image, you may need to replace \includegraphics[width=\paperwidth]{yourimage} with \includegraphics[height=\paperheight]{yourimage} – Digger Jan 24 '17 at 07:10
  • 2
    @Digger: right you are. In fact, I think you can get whichever is appropriate with (untested) \includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{yourimage} – Matthew Leingang Jan 24 '17 at 15:30
  • 1
    @MatthewLeingang: Great trick! Except that it didn't start working correctly for me until I put the keepaspectratio switch first (\includegraphics[keepaspectratio,width=\paperwidth,height=\paperheight]{yourimage}). – Digger Feb 08 '17 at 04:27
  • I've edited the answer to include the improvements suggested by the last three comments. – Matthew Leingang Jan 28 '19 at 15:21
  • @MatthewLeingang Your answer seems to flush out the headline and the footline. I tried changing height to height=\textheight, but to no avail. – Subhajit Paul Apr 07 '22 at 07:11
  • 1
    @SubhajitPaul yes, the plain option to the frame environment suppresses the headline and footline. I used this option because OP wanted “only one image _without any borders or any other beamer specific element_”. If sounds like you want something else, so ask a different question. – Matthew Leingang Apr 08 '22 at 18:36
37

The following strategy worked, but not when I had \mode* in operation.

{
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{figure}}
\begin{frame}[plain]
\end{frame}
}

The following seems to work when I have \mode* operating in the document.

\mode<all>
{
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{figure}}
\begin{frame}[plain]
\end{frame}
}
\mode<all>{\usebackgroundtemplate{}}
\mode*
Jeromy Anglim
  • 7,450
  • 6
  • 46
  • 63
  • 1
    You can simplify things by adding another group around your frame. Then you don't have to explicitly shut off the backgroundtemplate – Matthew Leingang Oct 11 '10 at 16:45
  • It still seems to leave a white strip at the top for me. I fixed it by setting \newgeometry. Funnily enough, if I set \newgeometry to 0, I got a white strip at the bottom. I had to trial and error to get the right margins. – craq Dec 03 '18 at 23:26
18

An more light-weight approach (no extra packages, no necessity to compile twice) is to set the page-filling image as background template via \usebackgroundtemplate and then insert an empty [plain] frame.

To restrict the effect of the background changing to a single slide only, we do this inside a TeX group:

\documentclass{beamer}
\usetheme{Madrid}
\begin{document}
    \begin{frame}{Title}
        First frame
    \end{frame}
    {
    \usebackgroundtemplate{\includegraphics[height=\paperheight,width=\paperwidth]{background.jpg}}
    \setbeamertemplate{navigation symbols}{}
    \begin{frame}[plain]
    \end{frame}
    }
    \begin{frame}{Title}
        Third frame
    \end{frame}
\end{document}
Daniel
  • 37,517
Say OL
  • 1,793
16

The following also seems to be working:

{
\setbeamertemplate{navigation symbols}{}
\begin{frame}[plain]
    \makebox[\linewidth]{\includegraphics[width=\paperwidth]{kernel-panic.png}}
\end{frame}
}

Based on a latex-community post.

Sussch
  • 261
  • 2
    Simple and powerful. Unlike many other answers, this keep code minimal when overlaying several images on a single frame. – luchonacho Mar 04 '20 at 13:12
10

I have been using something like this:

\newcommand<>{\fullsizegraphic}[1]{
  \begin{textblock*}{0cm}(-1cm,-3.78cm)
  \includegraphics[width=\paperwidth]{#1}
  \end{textblock*}
}

in the preamble and then just:

\begin{frame}
  \fullsizegraphic{monogram.jpg}
\end{frame}

But I am not totally satisfied - I still have to fiddle with the numbers to get it right.

Unfortunately I have forgotten where I stole the fullsizegraphic-snippet.

asjo
  • 201
7

I ended up using following solution:

\usepackage{tikz}

\usepackage[absolute,overlay]{textpos}
% absolute - no need to move block into position
% overlay - remove footer

% Setting default units for textpos simplifies coding a little bit
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}

% Place a picture over the slide
\newcommand<>{\fullsizegraphic}[1]{%
  \begin{textblock}{0}(0,0)%
    \only#2{%
      \begin{tikzpicture}%
        \fill [black] (current page.north west) rectangle (current page.south east);
        \node[overlay] at (current page.center)
          {\includegraphics[keepaspectratio,width=\paperwidth,height=\paperheight]{#1}};
      \end{tikzpicture}%
    }%
  \end{textblock}%
}

And then using it

\begin{frame}{My cool three points}
  \begin{itemize}
    \item<1-|alert@1> Point 1
    \item<3-|alert@3> Point 2
    \item<5-|alert@5> Point 3
  \end{itemize}
  \fullsizegraphic<2>{pictures/point1}
  \fullsizegraphic<4>{pictures/point2}
  \fullsizegraphic<6>{pictures/point3}
\end{frame}

Setting keepaspectratio, width and height in \includegraphics scales your image up to the frame border.

Not used space get filled with black using TiKZ \fill [black] (...)

7

Personally, I use

{
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{background canvas}{\includegraphics[height = \paperheight, 
                                      width = \paperwidth]{image.jpg}}
\begin{frame}[plain]
\end{frame}
}

I find it more intuitive, easier and it does not require any extra packages or runs.

Santiago
  • 125
  • Welcome to TeX.SX! Please elaborate on your answer, not just posting fragments. Please add a screen shot of the result as well –  Jun 02 '15 at 17:19
  • @Santiago Seems similar to http://tex.stackexchange.com/a/3994/36296 – samcarter_is_at_topanswers.xyz Jun 02 '15 at 22:12
  • I am not exactly sure, but I think I read that using \setbeamertemplate is better than `usebackgroundtemplate`, due to a beamer package update. TeXstudio, for example, highlights it as a warning. – Santiago Jun 02 '15 at 23:25
  • And this enables one to write captions onto the picture. – Gergely May 18 '22 at 12:46
  • 1
    @Santiago Beamer defines \usebackgroundtemplate as \def\usebackgroundtemplate{\setbeamertemplate{background canvas}}, so internally it is the same. The code highlighting of texstudio is inconsequential for the tex code. – samcarter_is_at_topanswers.xyz Jul 23 '23 at 12:31
6

Is the aspect ratio of your image the same as that of your slides? If not then you'll always get either borders or clipping of the image if you include it without changing its aspect ratio.

You can put \hspace{-1.2cm} before your \includegraphics command to place the image 1.2 cm to the left of where it would be by default. Playing with the distance should let you place it right on the edge of the slide.

Michael Underwood
  • 21,356
  • 13
  • 52
  • 41
2

One could use the fact that beamer columns remove the normal text margins:

\documentclass{beamer}

\begin{document}

\begin{frame}[plain] \begin{columns} \begin{column}{\paperwidth} \includegraphics[height=\paperheight,width=\paperwidth]{example-image-duck} \end{column} \end{columns} \end{frame}

\end{document}