
プレゼンテーションの冒頭で、次のことをお見せしたいと思います。最初のスライドでは、セクションのみの目次を表示したいと思います。つまり、サブセクションは見えませんが、そこに存在する必要があります。その後のスライドでは、サブセクションが順に溶け込んでいきます。
オプションを使用するとpausesubsections
、\tableofcontents
最初のスライドに最初のセクションのみが表示されるという欠点があります。 オプションを使用すると、hidesubsections
サブセクションが完全に消去されるため、サブセクションを次々にブレンドすることは不可能になります。
enumerate
とitemize
を使用して偽の目次を設定しようとしました\pause
が、間隔が「実際の」目次と異なります。以下に MWE を示します。
\documentclass{beamer}
\begin{document}
\begin{frame}{Outline}
\tableofcontents[pausesubsections]
\end{frame}
\section{One}
\subsection{OneOne}
\begin{frame}
There is nothing here.
\end{frame}
\subsection{OneTwo}
\begin{frame}
There is nothing here.
\end{frame}
\section{Two}
\subsection{TwoOne}
\begin{frame}
There is nothing here.
\end{frame}
\subsection{TwoTwo}
\begin{frame}
There is nothing here.
\end{frame}
\end{document}
答え1
サブセクションを非表示にしながら、そのスペースを保持するには、背景色で色付けすると簡単に行えます。
\documentclass{beamer}
\begin{document}
{
\setbeamercolor{subsection in toc}{fg=bg}
\begin{frame}{Outline}
\tableofcontents
\end{frame}
}
\begin{frame}{Outline}
\tableofcontents[pausesubsections]
\end{frame}
\section{One}
\subsection{OneOne}
\begin{frame}
There is nothing here.
\end{frame}
\subsection{OneTwo}
\begin{frame}
There is nothing here.
\end{frame}
\section{Two}
\subsection{TwoOne}
\begin{frame}
There is nothing here.
\end{frame}
\subsection{TwoTwo}
\begin{frame}
There is nothing here.
\end{frame}
\end{document}
答え2
おそらく、次のようなコードを記述したいでしょう。これは、beamer 独自のコマンドで動作します。
最初のスライドには、セクション タイトルのみのアウトラインが表示されます。セクションを入力すると、サブセクションのタイトルが挿入され、強調表示された新しいアウトラインが表示されます。
\documentclass{beamer}
\mode<presentation>{%
%% At the begin of a section, insert a short outline
\AtBeginSection[]{%
\begin{frame}<beamer>%
\frametitle{Outline}
\tableofcontents[currentsection,subsectionstyle=show/shaded/hide]%
\end{frame}%
}%
%%
%% Same for Subsections
\AtBeginSubsection[]{%
\begin{frame}<beamer>%
\frametitle{Outline}
\tableofcontents[currentsection,subsectionstyle=show/shaded/hide]%
\end{frame}}%
}
\begin{document}
\begin{frame}{Outline}
\tableofcontents[currentsection,sectionstyle=show,hideothersubsections]
\end{frame}
\section{One}
\subsection{OneOne}
\begin{frame}
There is nothing here.
\end{frame}
\subsection{OneTwo}
\begin{frame}
There is nothing here.
\end{frame}
\section{Two}
\subsection{TwoOne}
\begin{frame}
There is nothing here.
\end{frame}
\subsection{TwoTwo}
\begin{frame}
There is nothing here.
\end{frame}
\end{document}