0

I'm making a presentation with beamer.

Problem: my sections have a title and a subtitle.

I'm not going to put the subtitle in \section{} because it would end up in the top progress navigation bar.

I have the following fragment to make section slides:

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

How can I put another beamercolorbox below the one with the subtitle?

Of course different sections have different subtitles.

I though about an if/else statements but I don't know how to get the title (or the number) of the section.

Here is a MWE:

\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum}  

\usetheme{Frankfurt}

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

\begin{document}
    \author{John Doe}
    \title{Presentation}

    \begin{frame}[plain]
        \maketitle
    \end{frame}

    \section{Section 1}
    % in slide n.2, when there is the "section 1" box
    % I want another box below with "subsection 1"
    \begin{frame}
        \frametitle{Test}
        \lipsum[1]
    \end{frame}

    \section{Section 2} 
    \begin{frame}
        \frametitle{Test}
        \lipsum[1]
    \end{frame}
        
\end{document}
2
  • Please add a complete compilable example from \documentclass to \end{document}. beamer has many themes and options. Jun 19, 2022 at 21:11
  • @SimonDispa added Jun 19, 2022 at 21:38

1 Answer 1

1

Try this code. a

\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum}  

\usetheme{Frankfurt}

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


\begin{document}
    \author{John Doe}
    \title{Presentation}
    
    \begin{frame}[plain]
        \maketitle
    \end{frame}
    
    \section{Section 1}
    \subsection{Subsection 1.A}% added <<<<<<<<<<<<<<<<<<<<<<<
    % in slide n.2, when there is the "section 1" box
    % I want another box below with "subsection 1"
    \begin{frame}
        \frametitle{Test}
        \lipsum[1]
    \end{frame}
    
    \section{Section 2} 
    \subsection{Subsection 2.A}% added <<<<<<<<<<<<<<<<<<<<<<<
    \begin{frame}
        \frametitle{Test}
        \lipsum[1]
    \end{frame}
    
\end{document}
7
  • That is good enough. Thank you very much! Jun 19, 2022 at 22:08
  • Actually I need a third box below ... is there a way to customize the text without relaying on subsections? Maybe an if statement that checks the title? Jun 20, 2022 at 11:24
  • @robertspierre Three boxes in all sections? Jun 20, 2022 at 13:24
  • yes .. an if statement based on title will suffice for me .... Jun 20, 2022 at 18:12
  • @robertspierre I do not understand why you want an ifthen statement if there will always be three boxes. Jun 20, 2022 at 18:17

You must log in to answer this question.

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