
다음 MWE를 고려하십시오.
\documentclass{beamer}
\AtBeginSection[]{%
\begin{frame}<beamer>
\frametitle{Outline}
\begin{minipage}{.25\textwidth}
\tableofcontents[currentsection, hideothersubsections] % removing hideothersubsections solves the problem
\end{minipage}
\hfill
\begin{minipage}{.55\textwidth}
\begin{centering}
\insertsectionhead
\end{centering}
\end{minipage}
\end{frame}
}
\begin{document}
\begin{frame}[shrink]{ToC}
\tableofcontents
\end{frame}
\section[aa]{AA}
\begin{frame}{A}
a
\end{frame}
\section[bb]{BB}
\begin{frame}{B}
b
\end{frame}
\section{CC}
\begin{frame}{C}
c
\end{frame}
\section{DD}
\begin{frame}{D}
d
\end{frame}
\section[ee]{EE}
\begin{frame}{E}
e
\end{frame}
\section[ff]{FF}
\begin{frame}{F}
f
\end{frame}
\section[gg]{GG}
\begin{frame}{G}
g
\end{frame}
\section[hh]{HH}
\begin{frame}{H}
h
\end{frame}
\section[ii]{II}
\subsection[iii]{III}
\subsection[iv]{IV}
\subsection[v]{V}
\begin{frame}{I}
i
\end{frame}
\end{document}
; 를 선택하여 ToC를 한 페이지에 맞출 수 있습니다 shrink
. 그러나 모든 섹션의 시작 부분에 있는 ToC는 한 페이지에 맞지 않습니다(한 가지 부분적인 해결 방법은 hideothersubsections
모든 하위 섹션이 확장되도록 제거하는 것입니다).
내가 원하는 것:
각 섹션의 시작 부분에서 현재 섹션은 페이지 중앙에 있고 모든 하위 섹션이 확장됩니다. 몇 개의 인접 섹션만 (부분적으로) 표시되며, 이 섹션의 하위 섹션은 확장되지 않습니다.
도움을 주시면 감사하겠습니다.
답변1
다음은 현재 섹션 주위에 +- 2 섹션을 표시합니다. 더 적은 섹션을 더 원할 경우 이 숫자를 조정할 수 있습니다.
\documentclass{beamer}
\newcounter{start}
\newcounter{stop}
\AtBeginSection[]{%
\setcounter{start}{\thesection}
\setcounter{stop}{\thesection}
\ifnum\value{section}>1
\ifnum\value{section}=2
\addtocounter{start}{-1}%
\else%
\addtocounter{start}{-2}%
\fi%
\fi%
\addtocounter{stop}{2}
\begin{frame}<beamer>
\frametitle{Outline}
\begin{columns}[c]
\begin{column}{.25\textwidth}
\tableofcontents[sections=\thestart-\thestop, subsectionstyle=show/show/hide] % removing hideothersubsections solves the problem
\end{column}
\hfill
\begin{column}{.55\textwidth}
\begin{centering}
\insertsectionhead
\end{centering}
\end{column}
\end{columns}
\end{frame}
}
\begin{document}
\begin{frame}[shrink]{ToC}
\tableofcontents
\end{frame}
\section[aa]{AA}
\begin{frame}{A}
a
\end{frame}
\section[bb]{BB}
\begin{frame}{B}
b
\end{frame}
\section{CC}
\begin{frame}{C}
c
\end{frame}
\section{DD}
\begin{frame}{D}
d
\end{frame}
\section[ee]{EE}
\begin{frame}{E}
e
\end{frame}
\section[ff]{FF}
\begin{frame}{F}
f
\end{frame}
\section[gg]{GG}
\begin{frame}{G}
g
\end{frame}
\section[hh]{HH}
\begin{frame}{H}
h
\end{frame}
\section[ii]{II}
\subsection[iii]{III}
\subsection[iv]{IV}
\subsection[v]{V}
\begin{frame}{I}
i
\end{frame}
\end{document}