在 beamer 中,暂停在 \tableofcontents[pausesections] 之前不起作用

在 beamer 中,暂停在 \tableofcontents[pausesections] 之前不起作用

\pause\tableofcontents[pausesections]在 Beamer 中之前不起作用

请帮助我。谢谢

\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usetheme{default}
\begin{document}
\begin{frame}

\pause

\tableofcontents[pausesections]
\end{frame}
\section{test}
\begin{frame}

\end{frame}
\section{test}
\begin{frame}

\end{frame}
\section{test}
\begin{frame}

\end{frame}
\section{test}
\begin{frame}

\end{frame}
\section{test}
\begin{frame}

\end{frame}
\end{document}

答案1

方法如下:

\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usetheme{default}

\newcommand{\newpause}[1][+]{\onslide<#1->}

\begin{document}
\begin{frame}
\pause
\let\pause\newpause
\tableofcontents[pausesections]
\end{frame}
\section{test}
\begin{frame}
1
\end{frame}
\section{test}
\begin{frame}
2
\end{frame}
\section{test}
\begin{frame}
3
\end{frame}
\section{test}
\begin{frame}
4
\end{frame}
\section{test}
\begin{frame}
5
\end{frame}
\end{document}

更新日期:2019/10/02

\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usetheme{default}

\makeatletter
\def\beamer@tableofcontents[#1]{%
  \def\beamer@toc@cs{show}%
  \def\beamer@toc@os{show}%
  \def\beamer@toc@css{show}%
  \def\beamer@toc@oss{show}%
  \def\beamer@toc@ooss{show}%
  \def\beamer@toc@csss{show}%
  \def\beamer@toc@osss{show}%
  \def\beamer@toc@oosss{show}%
  \def\beamer@toc@ooosss{show}%
  \beamer@showpartnumber=\c@part%
  \beamer@pausesectionsfalse%
  \beamer@pausesubsectionsfalse%
  \def\beamer@tocsections{<*>}%
  \setkeys{beamertoc}{firstsection=1}%
  \setkeys{beamertoc}{#1}%
  \vspace*{-.5em}{\makeatletter%
    \pause[1]%
    \@input{\jobname.toc}%
    \vfill}%
  }
\makeatother

\begin{document}
\begin{frame}
%\pause
\tableofcontents[pausesections]
\end{frame}
\section{test}
\begin{frame}
1
\end{frame}
\section{test}
\begin{frame}
2
\end{frame}
\section{test}
\begin{frame}
3
\end{frame}
\section{test}
\begin{frame}
4
\end{frame}
\section{test}
\begin{frame}
5
\end{frame}
\end{document}

答案2

编辑上面的代码:

方法一:

\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usetheme{default}

\makeatletter
\def\beamer@tableofcontents[#1]{%
  \def\beamer@toc@cs{show}%
  \def\beamer@toc@os{show}%
  \def\beamer@toc@css{show}%
  \def\beamer@toc@oss{show}%
  \def\beamer@toc@ooss{show}%
  \def\beamer@toc@csss{show}%
  \def\beamer@toc@osss{show}%
  \def\beamer@toc@oosss{show}%
  \def\beamer@toc@ooosss{show}%
  \beamer@showpartnumber=\c@part%
  \beamer@pausesectionsfalse%
  \beamer@pausesubsectionsfalse%
  \def\beamer@tocsections{<*>}%
  \setkeys{beamertoc}{firstsection=1}%
  \setkeys{beamertoc}{#1}%
  \vspace*{-.5em}{\makeatletter%
   % \pause[0]%
    \@input{\jobname.toc}%
    \vfill}%
  }
\makeatother

\begin{document}

\begin{frame}
\addtocounter{beamerpauses}{-1}
\pause
\tableofcontents[pausesections]
\end{frame}
\section{test}
\begin{frame}
1
\end{frame}
\section{test}
\begin{frame}
2
\end{frame}
\section{test}
\begin{frame}
3
\end{frame}
\section{test}
\begin{frame}
4
\end{frame}
\section{test}
\begin{frame}
5
\end{frame}
\end{document}

编辑方法a:

\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usetheme{default}

\makeatletter
\def\beamer@tableofcontents[#1]{%
  \def\beamer@toc@cs{show}%
  \def\beamer@toc@os{show}%
  \def\beamer@toc@css{show}%
  \def\beamer@toc@oss{show}%
  \def\beamer@toc@ooss{show}%
  \def\beamer@toc@csss{show}%
  \def\beamer@toc@osss{show}%
  \def\beamer@toc@oosss{show}%
  \def\beamer@toc@ooosss{show}%
  \beamer@showpartnumber=\c@part%
  \beamer@pausesectionsfalse%
  \beamer@pausesubsectionsfalse%
  \def\beamer@tocsections{<*>}%
  \setkeys{beamertoc}{firstsection=1}%
  \setkeys{beamertoc}{#1}%
  \vspace*{-.5em}{\makeatletter%
  \addtocounter{beamerpauses}{-1}
   % \pause[0]%
    \@input{\jobname.toc}%
    \vfill}%
  }
\makeatother

\begin{document}

\begin{frame}
\pause
\tableofcontents[pausesections]
\end{frame}
\section{test}
\begin{frame}
1
\end{frame}
\section{test}
\begin{frame}
2
\end{frame}
\section{test}
\begin{frame}
3
\end{frame}
\section{test}
\begin{frame}
4
\end{frame}
\section{test}
\begin{frame}
5
\end{frame}
\end{document}

方法b:

\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usetheme{default}

\makeatletter
\def\beamer@tableofcontents[#1]{%
  \def\beamer@toc@cs{show}%
  \def\beamer@toc@os{show}%
  \def\beamer@toc@css{show}%
  \def\beamer@toc@oss{show}%
  \def\beamer@toc@ooss{show}%
  \def\beamer@toc@csss{show}%
  \def\beamer@toc@osss{show}%
  \def\beamer@toc@oosss{show}%
  \def\beamer@toc@ooosss{show}%
  \beamer@showpartnumber=\c@part%
  \beamer@pausesectionsfalse%
  \beamer@pausesubsectionsfalse%
  \def\beamer@tocsections{<*>}%
  \setkeys{beamertoc}{firstsection=1}%
  \setkeys{beamertoc}{#1}%
  \vspace*{-.5em}{\makeatletter%
   % \pause[0]%
    \@input{\jobname.toc}%
    \vfill}%
  }
\makeatother

\begin{document}

\begin{frame}
\addtocounter{beamerpauses}{0}
%\pause
\tableofcontents[pausesections]
\end{frame}
\section{test}
\begin{frame}
1
\end{frame}
\section{test}
\begin{frame}
2
\end{frame}
\section{test}
\begin{frame}
3
\end{frame}
\section{test}
\begin{frame}
4
\end{frame}
\section{test}
\begin{frame}
5
\end{frame}
\end{document}

相关内容