# How to hide other SubSubsections in sidebar of beamerclass?

I make a translation of a 600 pages Book with the beamer class in Latex, so I have lots of Subsections and SubSubsections. I want to show all subsections of the current Section in the sidebar along with all the subsubsections of the CURRENT subsection. I came across a hint and made

\setbeamertemplate{subsubsection in sidebar shaded}
{\vspace*{-\baselineskip}}


But that just hides all subsubsections but the current one. The best solution would be something like

\setbeamertemplate{subsubsection in sidebar shaded}[subsubsectionstyle=show/shaded/hide]


or any other way i can change the subsubsectionstyle. The best idea I had was

\setbeamertemplate{subsubsection in sidebar shaded}


But that just creates over 3000 errors and didn't solved my problem . Is there anybody who has an idea to solve this Problem ?

Here is a MWE to show what i mean:

    \documentclass[9pt]{beamer}

\usetheme[hideothersubsections]{Goettingen}

\begin{document}

\section{Section 1}
\begin{frame}
\frametitle{Section 1}
\end{frame}

\subsection{Subsection 1.1}
\subsubsection{SubSubsection1.1.1}
\begin{frame}
bla
\end{frame}
\subsubsection{SubSubsection 1.1.2}
\begin{frame}
bla
\end{frame}

\subsection{Subsection 1.2}
\subsubsection{SubSubsection1.2.1}
\begin{frame}
bla
\end{frame}
\subsubsection{SubSubsection 1.2.2}
\begin{frame}
bla
\end{frame}

\section{Section 2}
\begin{frame}
\frametitle{Section 2}
\end{frame}

\subsection{Subsection 2.1}
\subsubsection{SubSubsection2.1.1}
\begin{frame}
bla
\end{frame}
\subsubsection{SubSubsection 2.1.2}
\begin{frame}
bla
\end{frame}

\subsection{Subsection 2.2}
\subsubsection{SubSubsection2.2.1}
\begin{frame}
bla
\end{frame}
\subsubsection{SubSubsection 2.2.2}
\begin{frame}
bla
\end{frame}
\end{document}


And one page of the output is:

As you can see, with the option [hideothersubsections] in \usetheme[hideothersubsections]{Goettingen} subsections outside the current section are not shown in the sidebar. I want the same effect for the subsubsections with regard to subsections. So Subsubsection1.2.1 and SubSubsection1.2.2 should not be seen in the sidebar, because im in subsection 1.1

Therefore it should looks like this:

And when my slides move on and the subsections changes (from subec 1.1 to subsec 1.2), then the displayed subsubsection shall also change. It then should looks like this:

Of course the space between subsec 1.1 and subsec 1.2 should disappear.

• Apr 14, 2012 at 12:43
• Theres one hitch. Subsubsection which are declared with \subsubsection[]{...} would never be shown in my sidebar. But the point is, the list of subsubsections shall change with the current subsection. Apr 14, 2012 at 18:49
• Can you provide the simplest example with dummy 2 sections and 2 subsections, subsubsections each etc? It would demonstrate the problem much clearer and would give us a chance to work on it right away. Apr 15, 2012 at 9:35
• done, I hope this helps. Apr 16, 2012 at 12:30
• Apr 17, 2012 at 16:55

I guess it's enough to use the hideothersubsections option of \usetheme command:

\documentclass{beamer}
\usepackage{multido}

\usetheme[hideothersubsections]{PaloAlto}

\begin{document}
\multido{\i=1+1}{2}{%
\section{Section}
\multido{\i=1+1}{5}{%
\subsection{Subsection}
\multido{\i=1+1}{3}{%
\subsubsection{Subsubsection}
\begin{frame}
\frametitle{Foo}
Bar.
\end{frame}
}
}
}
\end{document}

• This does also work with (some) other theme commands. For example, for the sidebar I am using \useoutertheme[height=0pt,width=2cm,right,hideothersubsections]{sidebar} to only show the current subsections. Nov 3, 2020 at 10:44

I've bumped into the same problem. Here's how I solved it. (an ugly hack, but works quite well for me.)

Locate 'beamerbasenavigation.sty' in the beamer package. Search for the definition of the \insertverticalnavigation command. Copy this code into the preempt part of your document.

Inside the function, change

\def\beamer@subsubsectionentry##1##2##3##4##5##6{%
\ifnum##1=\c@part%


to

\def\beamer@subsubsectionentry##1##2##3##4##5##6{%
\ifnum##1=\c@part%
\ifnum##2=\c@section
\ifnum##3=\c@subsection

• Worked for me too, but I skipped the \ifnum##3=\c@subsection part. Mar 11, 2013 at 8:04