The following minimal working example shows how you can include arbitrary background images on any frame within your presentation.
This code tells LaTeX to include the figure default.jpg
as the background for every frame except those for which you specify a different background. The below code produces a document of five slides with the following background images:
(1) picture1.jpg
; (2) default.jpg
; (3) default.jpg
; (4) picture2.jpg
; (5) no bckground image.
\documentclass{beamer}
\usepackage{graphicx}
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{default.jpg}}
\begin{document}
{
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{picture1.jpg}}
\begin{frame}
[...]
\end{frame}
}
\begin{frame}
[...]
\end{frame}
\begin{frame}
[...]
\end{frame}
{
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{picture2.jpg}}
\begin{frame}
[...]
\end{frame}
}
{
\usebackgroundtemplate{}
\begin{frame}
[...]
\end{frame}
}
\end{document}
Replace the [...]
with whatever content you want on the frame and LaTeX will simply overlay that content on top of the background image. Alternatively, if you want to produce a slide with only the background image and no other content, you can simply make an empty frame:
{
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{picture.jpg}}
\begin{frame}
\end{frame}
}
You can declare the background just before the slide, and un-declare it just after it.:
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
Background transparent image, not here
\end{frame}
\usebackgroundtemplate{% declare it
\tikz[overlay,remember picture] \node[opacity=0.3, at=(current page.center)] {
\includegraphics[height=\paperheight,width=\paperwidth]{example-image-a}};
}
\begin{frame}
Background transparent image, centered on slide
\end{frame}
\usebackgroundtemplate{ } %% undeclare it
\begin{frame}
Background transparent image, not here
\end{frame}
\end{document}
You can also use a group on the other hand:
\bgroup
\usebackgroundtemplate{%
\tikz[overlay,remember picture] \node[opacity=0.3, at=(current page.center)] {
\includegraphics[height=\paperheight,width=\paperwidth]{example-image-a}};
}
\begin{frame}
Background transparent image, centered on slide
\end{frame}
\egroup
Best Answer
One possibility is to redefine
\beamer@section
and\beamer@subsection
as defined inbeamerbasesection.sty
to include the corresponding page number; here's an example showing the necessary redefinition in action:And an image of the resulting ToC:
Here's a variation producing the frame number in the ToC: