Empty sections not showing up in Beamer ToC

I am going to use Beamer as a lecture tool, and planned on each lecture being represented by a section in Beamer. So even though we're not at lecture 2, a section would show what it will be about.

However, the Beamer table of contents seem to be too smart for its own good, and does not show sections that don't have slides following them.

Here's a MWE:

\documentclass{beamer}

\begin{document}

\section{Table of Contents}

\begin{frame}{Table of Contents}
\tableofcontents
\end{frame}

\section{A real section}

\begin{frame}{A real frame}
This is a frame
\end{frame}

\section{An empty section}

\section{Another real section}
\begin{frame}{Another real frame}
This is also a frame
\end{frame}

\section{Another empty section}

\end{document}


And here is the ToC you then get:

As you can see, the last section does not appear in the ToC. One can add the sections by using \addcontentsline etc but getting the formatting to fit your beamer theme is a hassle. I feel like there should be an easier way to tell beamer to also include the sections that have no slides to the table of contents.

Also tried adding an invisible slide to the bottom, but was again outsmarted by Beamer, who figured out this slide didn't exist, and therefore didn't add the section to the ToC.

1 Answer

You can actually achieve the intended result by adding an empty frame at the very end of your document, see beameruserguide section 4.3 p30.

Of course, this leaves an empty page at the end of your presentation, however, this last frame could actually be used to recall the titlepage.

• Yeah my current solution is to have a final frame with the university logo, but it surprises me that there is no way to achieve the same result without having a "wasted" frame. Jun 4, 2020 at 23:30
• @Greebo The thing is I am not sure sections ate the best way to do this. Parts could be more appropriate. Jun 5, 2020 at 7:20
• With parts I end up with one long slideshow with all the lectures contained in them, instead of shorter slideshows per lecture. I could cut the correct lectures out of this longer slideshow, but then I could also cut away the last empty slide. Would prefer a method that didn't need to post-process the pdf-file. Jun 5, 2020 at 22:49