7

Yes, I realize that subsubsections are evil. The only reason I'm using them however, is for myself, to structure the presentation and be able to jump around efficiently if necessary.

The beamer theme I'm using doesn't show the current section on every slide, so that's of no concern. The only place sections are shown to the viewers, is in the table of contents. I would like to hide the subsubsections from the table of contents, but keep them as PDF bookmarks. I can remove them from the TOC by using the subsubsectionstyle=hide option, however that removes them from the PDF bookmarks as well.

Likewise, using \subsubsection*{A subsubsection}, subsubsections aren't added to the PDF bookmarks either.

I could use \belowpdfbookmark{A subsubsection} to add bookmarks manually, but that's a lot of duplicate work, and my LaTeX editor still uses subsubsections to show the document structure, so I would still need the subsubsections as well.

I've also tried passing the bookmarksdepth=3 option to hyperref, as per this question, but that didn't seem to have any effect. Subsubsections still weren't added to the bookmarks.

Is there no way that I can simply use \subsubsection{A subsubsection} and hide them from the TOC?

Here's a MWE with the subsubsections hidden from the TOC by using the subsubsectionstyle=hide option:

\documentclass[]{beamer}

\title{Title}
\author{Author}

\AtBeginSection
{
    \begin{frame}
        \tableofcontents[currentsection,subsubsectionstyle=hide]
    \end{frame}
}

\begin{document}

\begin{frame}
    \titlepage
\end{frame}

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

\section{Introduction}
\section{Experiments}
\subsection{Small scale experiments}
\subsubsection{Experiment 1}
\subsubsection{Experiment 2}
\subsubsection{Experiment 3}
\subsection{Large scale experiments}
\subsubsection{Experiment 4}
\subsubsection{Experiment 5}
\subsubsection{Experiment 6}
\section{Problems}
\section{Further suggestions for improvements}
\section{Conclusion}

% Enforce entries in TOC
\begin{frame}
    \frametitle{Delete me}
\end{frame}

\end{document}
9

The tocdepth counter value determines also what appears in the bookmarks, not only in the ToC. Since subsubsections are on level 4, the tocdepth must be set to 4.

\documentclass[]{beamer}

\hypersetup{bookmarksopen=true,bookmarksopenlevel=4}
\setcounter{tocdepth}{4}

\title{Title}
\author{Author}

\AtBeginSection
{
    \begin{frame}
        \tableofcontents[currentsection,subsubsectionstyle=hide]
    \end{frame}
}

\begin{document}

\begin{frame}
    \titlepage
\end{frame}

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

\section{Introduction}
\section{Experiments}
\subsection{Small scale experiments}
\subsubsection{Experiment 1}
\subsubsection{Experiment 2}
\subsubsection{Experiment 3}
\subsection{Large scale experiments}
\subsubsection{Experiment 4}
\subsubsection{Experiment 5}
\subsubsection{Experiment 6}
\section{Problems}
\section{Further suggestions for improvements}
\section{Conclusion}

% Enforce entries in TOC
\begin{frame}
    \frametitle{Delete me}
\end{frame}

\end{document}

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.