I'm making a presentation on beamer and I was able to create a frame with the section title with the code: (I'm sorry for the code, didn't quite understand how to insert it correctly)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Section title frame 
\AtBeginSection[]{
  \begin{frame}
     \vfill
     \centering
     \begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}
        \usebeamerfont{title}\insertsectionhead\par%
     \end{beamercolorbox}
     \vfill 
  \end{frame}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Section title frame

but now I would like to include an image on the page as well, not the same one for every section, but a particular one for each section.

Thank you

up vote 1 down vote accepted

An easy solution would be to store the image name in a macro and redefine it where needed.

\documentclass{beamer}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Section title frame 
\AtBeginSection[]{
  \begin{frame}
     \vfill
     \centering
     \includegraphics[width=4cm]{\secimage}

     \begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}
        \usebeamerfont{title}\insertsectionhead\par%
     \end{beamercolorbox}
     \vfill 
  \end{frame}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Section title frame

\newcommand{\secimage}{example-image-a}

\begin{document}

  \section{A}

  {
    \renewcommand{\secimage}{example-image-b}
  \section{B}
    }

  \section{C}

\end{document} 

enter image description here

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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