6

How can I make a TOC and section mini TOCs such that TOC at the beginning of the whole document shows sections and subsections, mini TOCs at the beginning of each subsection show only the very section that I'm showing now and subsections and subsubsections that belong to the subsection?

I started from the template included in TexWorks for Mac. What I tried is minitoc package and \secttoc command. I got correct the whole TOC. But miniTOCs which should contain only that section and sub- and sub subsections is just the same as the entire TOC.

I tried various combinations of the two numbers in the below \setcounter command, but the result only depends on 'tocdepth'.

The part of the code I used and exemplary result I want to get is as follows.

\documentclass{beamer}
\mode<presentation>

\setcounter{secttocdepth}{2}
\AtBeginSubsection[]
{
\begin{frame}<beamer>{Outline}
\secttoc
\tableofcontents
\end{frame}
}

\setcounter{tocdepth}{2}
\dosecttoc
\tableofcontents

TOC I want to get is

Section 1
 Subsection 1.1
 Subsection 1.2
Section 2
 Subsection 2.1
 Subsection 2.2

sectTOCs I want to have at the beginning of Section 2.1 and Section 2.2.

Section 2
 Subsection 2.1
   Subsubsection 2.1.1
   Subsubsection 2.1.2
 Subsection 2.2
   Subsubsection 2.2.1
   Subsubsection 2.2.2 
10

You can use the following settings:

\documentclass{beamer}

\AtBeginSection[]
{
\begin{frame}<beamer>
\frametitle{Outline}
\tableofcontents[currentsection,sectionstyle=show/hide,subsectionstyle=show/show/hide]
\end{frame}
}

\begin{document}

\begin{frame}
\tableofcontents[subsubsectionstyle=hide/hide]
\end{frame}

\section{Test Section One}
\begin{frame} test \end{frame}
\subsection{Test Subsection One One}
\begin{frame} test \end{frame}
\subsubsection{Test Subsubsection One One One}
\begin{frame} test \end{frame}
\subsubsection{Test Subsubsection One One Two}
\begin{frame} test \end{frame}
\subsection{Test Subsection One Two}
\begin{frame} test \end{frame}
\subsubsection{Test Subsubsection  One Two One}
\begin{frame} test \end{frame}

\section{Test Section Two}
\begin{frame} test \end{frame}
\subsection{Test Subsection Two One}
\begin{frame} test \end{frame}
\subsection{Test Subsection Two Two}
\begin{frame} test \end{frame}
\subsubsection{Test Subsubsection  Two Two One}
\begin{frame} test \end{frame}

\end{document}

The general ToC:

enter image description here

The partial ToC for the first section:

enter image description here

The partial ToC for the second section:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.