2

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

1 Answer 1

1

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

1
  • Nice , How can I add the section number before the image ?
    – robintux
    Dec 15, 2019 at 4:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .