0

I used the code

\AtBeginSection[]
{
\begin{frame}
\frametitle{Table of Contents}
%\tableofcontents[currentsection,hideothersubsections]
\tableofcontents[sectionstyle=show/hide,subsectionstyle=show/show/hide]
\end{frame}
}

from How to explicitly split long TOC in beamer?

However, I have a

\section{1}
\subsection{1.1}
\subsubsection{1.1.1}
\subsubsection{1.1.2}
\subsection{1.2}
\subsubsection{1.2.1}
\subsubsection{1.2.2}
\section{2}
\section{3}
\section{4}
\section{5}

when I tried to compile the latex, the title of

\subsubsection{1.1.1}
\subsubsection{1.1.2}
\subsubsection{1.2.1}
\subsubsection{1.2.2}

showed up in the TOC of

\section{2}
\section{3}
\section{4}
\section{5}

Is there a fix for it?

  • Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for the users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – samcarter_is_at_topanswers.xyz Oct 09 '23 at 23:11

1 Answers1

1

If you only want to show the current section, I would use section={\thesection}:

\documentclass{beamer}

\AtBeginSection[] { \begin{frame} \frametitle{Table of Contents} %\tableofcontents[currentsection,hideothersubsections] \tableofcontents[sections={\thesection}] \end{frame} }

\begin{document}

\section{1} \subsection{1.1} \subsubsection{1.1.1} \subsubsection{1.1.2} \subsection{1.2} \subsubsection{1.2.1} \subsubsection{1.2.2} \section{2} \section{3} \section{4} \section{5}

\begin{frame} abc \end{frame}

\end{document}