Beamer TOC 覆盖:仅从可见部分开始

Beamer TOC 覆盖:仅从可见部分开始

在我的 Beamer 演示文稿中,我想使用覆盖以以下方式揭示目录:

  1. section同时发现所有

  2. 从第一部分之后的第一个元素开始,逐一发现它们,例如使用[pausesubsections,pausesections]

  3. 当到达已经发现的 时section,不要在上面停留(在下一张幻灯片中,发现 后面的元素section

有什么办法可以做到这一点吗?

编辑:这是我正在寻找的与下面的 MWE 相对应的输出。这显示了 TOC 幻灯片代码应如何转换为一系列真实幻灯片。

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      

梅威瑟:

\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}

答案1

根据以下代码手动创建基本投影仪目录你可以用这样的行为来伪造一个目录:

\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
}


\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}

在此处输入图片描述

相关内容