[Tex/LaTex] Add phantom section to Beamer TOC

beamertable of contents

In preparing my a presentation for my thesis defense, there is obviously way more material in my thesis than what I can cover in my presentation. Using the toc command,

\tableofcontents[hideallsubsections]

for the main toc, as expected, displays the sections with subsections hidden:

  • Motivation
  • Attitude Review
  • Heading Estimation
  • Hover Control
  • Conclusions

I would like to add a phantom section to just the main toc that doesn't get added to the navigation at the top (I'm using the compress option for the beamer package) and is shaded or set off somehow to show that I've done something on it, but am not going to address it in the presentation, something like

  • Motivation
  • Attitude Review
  • Heading Estimation
  • Hover Control
  • Wind Analysis
  • Conclusions

This post is similar, but the solution given there doesn't seem to do what I'm looking for. Any ideas?

Best Answer

If write an extra entry to the toc file, then it will show up in the table of contents, but not in the navigation elements. Below I provide a command \phantomsectionfortoc which writes an appropriate entry, based on \beamer@sectionintoc. beamer keeps track of section numbers in the table of contents via beamer@tocsectionnumber, so this needs to be updated by the command. All you need to provide is the name for the phantom section.

Sample output

\documentclass{beamer}

\usetheme{Warsaw}

\makeatletter
\newcommand{\phantomsectionfortoc}[1]{%
  \global\advance\beamer@tocsectionnumber by 1%
  \addtocontents{toc}{\protect\beamer@sectionintoc{0}{#1}{0}{0}%
    {\the\beamer@tocsectionnumber}}}
\makeatother

\begin{document}

\begin{frame}
  \tableofcontents[hideallsubsections]
\end{frame}

\section{Motivation}
\begin{frame}{Motivation}
\end{frame}

\section{Attitude Review}
\begin{frame}{Attitude Review}
\end{frame}

\section{Heading Estimation}
\begin{frame}{Heading Estimation}
\end{frame}

\section{Hover Control}
\begin{frame}{Hover Control}
\end{frame}

\phantomsectionfortoc{Wind Analysis}

\section{Conclusions}
\begin{frame}{Conclusions}
\end{frame}

\end{document}