Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Apologies in advance if my question is very basic. I am still learning my beamer skills, so please bear with me.

I want to insert a background image in a beamer frame and use this "frame" as a beamer frame. I want to insert different background images on different frames. Towards this end, I tried

\usebackgroundtemplate{\includegraphics[width=\paperwidth]{../images/crayons.png}}

on a specific frame to insert a background image, but I was unsuccessful. Am I missing any package? Or is there a different way of doing this?

I found this question here about inserting image but not as a background. In addition to inserting a background image, I also want to add text to the frame. (It is highly likely that I could not understand the questions correctly)

As a side note, if any of you are an Emacs org-mode users, can you please tell me a way to do this in org-beamer. I will be very thankful.

Any pointers or help is highly appreciated.

Here is a sample slide code:

\documentclass[bigger]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{soul}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{hyperref}

\begin{frame} \frametitle{Models}
\label{sec-2_3}


\usebackgroundtemplate{\includegraphics[width=\paperwidth]{../images/crayons.png}}

\begin{itemize} 
\item choose training data set
\item choose test data set
\item choose model
\item fit on training data set
\end{itemize}

\end{frame}
share|improve this question
    
Please show me the minimal file. –  xport Dec 29 '10 at 13:19
    
Thank you @xport for your prompt reply. Please let me know if you need any more details. –  suncoolsu Dec 29 '10 at 13:34
    
Please show me the preamble too. :-) –  xport Dec 29 '10 at 13:34
    
I know most of you can are aware, but tug.org/pipermail/texhax/2007-March/008035.html is the link from where I got the idea. –  suncoolsu Dec 29 '10 at 13:35
    
sorry again! I am new to this forum, and still learning the rules. –  suncoolsu Dec 29 '10 at 13:37
show 4 more comments

2 Answers

up vote 23 down vote accepted

alt text

I used images Sir Isaac Newton (rename it as newton.jpg) and Kitten (rename it as kitten.jpg)

The code snippet below is self-explanatory and I compiled using pdflatex.exe because of .jpg format.

\documentclass[bigger]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{graphicx}


%Global Background must be put in preamble
\usebackgroundtemplate%
{%
    \includegraphics[width=\paperwidth,height=\paperheight]{newton.jpg}%
}




\begin{document}

\begin{frame}{Introduction}
\begin{itemize}
\item 1
\item 2
\item 3
\end{itemize}
\end{frame}


% Local background must be enclosed by curly braces for grouping.
{
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{kitten.jpg}}%
\begin{frame}{Kitten}
\begin{itemize}
\item 1
\item 2
\item 3
\end{itemize}
\end{frame}
}

\begin{frame}{Summary}
\begin{itemize}
\item 1
\item 2
\item 3
\end{itemize}
\end{frame}

\end{document}
share|improve this answer
    
. Since you responded the first, I am accepting your answer as correct. (I know Stefan came with the answer first, but my nuances delayed your reply. Thank you) –  suncoolsu Dec 29 '10 at 14:19
    
I takes time to produce more details answer. :-) –  xport Dec 29 '10 at 14:54
    
gosh \usebackgroundtemplate{}? that makes things so easy. man, i love beamer. –  asia1281 Mar 6 '12 at 23:00
add comment

Write \usebackgroundtemplate before the frame, not within:

\end{frame}
% Now we install the new template for the following frames:
\usebackgroundtemplate{%
  \includegraphics[width=\paperwidth,height=\paperheight]{crayons}} 
\begin{frame}
...
\end{frame}
% Now we install another template, effective from now on:
\usebackgroundtemplate{...}

Ensure that \includegraphics is able to find the image file, since you used ../images/crayons.png.

share|improve this answer
    
Works like a charm. Thank you @Stefan Kottwitz. Much appreciated. –  suncoolsu Dec 29 '10 at 13:52
    
I quick question. If I don't need a background, I use a file name which doesn't exist. I am sure there is a better way of doing this. Can you pls enlighten me again? –  suncoolsu Dec 29 '10 at 14:23
5  
@suncoolsu: Just use an empty argument: \usebackgroundtemplate{}. –  Stefan Kottwitz Dec 29 '10 at 14:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.