3

In my Beamer presentation, I want to use overlays to uncover the TOC in the following manner:

  1. Uncover all sections simultaneously

  2. Starting with the first element following the first section, uncover them one-by-one, like using [pausesubsections,pausesections],

  3. When arriving at an already uncovered section, do not pause on it (on the next slide, uncover the element following the section)

Is there a way I can do this?

Edit: Here is the output I'm looking for that corresponds to the MWE below. This shows how the TOC slide code should be translated into a series of real slides.

Slide 1    Slide 2    Slide 3    Slide 4    Slide 5    Slide 6    Slide 7   

TOC title  TOC title  TOC title  TOC title  TOC title  TOC title  TOC title 


           A          A          A          A          A          A         
                        A1         A1         A1         A1         A1      
                                   A2         A2         A2         A2      

           B          B          B          B          B          B         
                                              B1         B1         B1      

           C          C          C          C          C          C         
                                                         C1         C1      
                                                                    C2      

MWE:

\documentclass{beamer}
\begin{document}

\begin{frame} 
    \frametitle{Table of Contents} 
    \tableofcontents[pausesubsections, pausesections]
\end{frame} 

\section{A}

\begin{frame}
some content
\end{frame}

\subsection{A1}

\begin{frame}
some content
\end{frame}

\subsection{A2}

\begin{frame}
some content
\end{frame}

\section{B}

\begin{frame}
some content
\end{frame}

\subsection{B1}

\begin{frame}
some content
\end{frame}

\section{C}

\subsection{C1}

\begin{frame}
some content
\end{frame}

\subsection{C2} 

\begin{frame}
some content
\end{frame}

\end{document}
3

1 Answer 1

1

Based on the code from Manually creating a basic beamer toc you could fake a toc with such a behaviour:

\documentclass{beamer}
\setbeamercovered{transparent}
\usepackage{tikz}

\setbeamercolor{subsection in toc}{fg=black}

% total number of sections %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{totcount}
\newcounter{totalsection}
\regtotcounter{totalsection}
\AtBeginDocument{%
  \pretocmd{\section}{\refstepcounter{totalsection}}{}{}%
}%

% number of subsections per section %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{xcntperchap}
\RegisterCounters{section}{subsection}
\newcounter{totalsubsection}
\setcounter{totalsubsection}{0}

% creating automatic label %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% based on https://tex.stackexchange.com/a/386557/36296
\AtBeginSection[]{\label{sec:\thesection}}
\AtBeginSubsection[]{\label{subsec:\thesection:\thesubsection}}
\newcounter{currentsub}
\newcounter{totsection}

% custom toc
\newcommand{\mytoc}{%
        \pause%
        \only<+>{}%
    \begingroup%
        \usebeamerfont{section in toc}%
      \usebeamercolor[fg]{section in toc}%
    \setcounter{totsection}{\number\totvalue{totalsection}}%
    \foreach \i in {1,...,\thetotsection}{%
        \hyperlink{sec:\thesection}{\nameref{sec:\i}}%
            \setcounter{currentsub}{\ObtainTrackedValueExp[\i]{section}{subsection}}%
            \par%
            \begingroup
                \usebeamerfont{subsection in toc}%
                \usebeamercolor[fg]{subsection in toc}%
                \ifnum\thecurrentsub>0%
                    \foreach \j in {1,...,\thecurrentsub}{%
                        \hspace{0.5cm}\hyperlink{subsec:\i:\j}{\uncover<+->{\nameref{subsec:\i:\j}}}%
                        \par%
                    }%
                \fi%
            \endgroup
            \vfill
        }% loop over i
    \endgroup
}

% fix from https://topanswers.xyz/tex?q=1987#a2230
\ExplSyntaxOn
\cs_set_eq:NN \c_zero \c_zero_int
\ExplSyntaxOff


\begin{document}

\begin{frame}
    \mytoc
\end{frame}

\section{A}

\begin{frame}
some content
\end{frame}

\subsection{A1}

\begin{frame}
some content
\end{frame}

\subsection{A2}

\begin{frame}
some content
\end{frame}

\section{B}

\begin{frame}
some content
\end{frame}

\subsection{B1}

\begin{frame}
some content
\end{frame}

\section{C}

\subsection{C1}

\begin{frame}
some content
\end{frame}

\subsection{C2} 

\begin{frame}
some content
\end{frame}

\end{document}

enter image description here

You must log in to answer this question.

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