15

I am not able to generate the table of contents made of all the parts (declared by \part command) of my Beamer presentation. While sections of each part are listed easily, there is no hint in the Beamer user guide how to use \tableofcontents to generate the list of parts. Anyone knows?

18

I've left away the fancy bits (i.e. routing it all through templates, making hyperlinks out of it, go wild in \beamer@partintoc!), and the part names still won't show in the ordinary \tableofcontents. Oh, and since you can only have one \AtBeginPart, be careful not to overwrite this one.

\makeatletter
\AtBeginPart{%
  \addtocontents{toc}{\protect\beamer@partintoc{\the\c@part}{\beamer@partnameshort}{\the\c@page}}%
}
%% number, shortname, page.
\providecommand\beamer@partintoc[3]{%
  \ifnum\c@tocdepth=-1\relax
    % requesting onlyparts.
    \makebox[6em]{PART #1:} #2
    \par
  \fi
}
\define@key{beamertoc}{onlyparts}[]{%
  \c@tocdepth=-1\relax
}
\makeatother%

\begin{document}

  \begin{frame}
    \tableofcontents[onlyparts]
  \end{frame}
  • Many thanks, Ulrich! Your code did solve the issue. – Tomik Nov 16 '10 at 15:32
  • @Tomik: You're welcome. (You're also welcome to mark your question as sufficiently resolved by ticking the checkbox to the left if you feel it is appropriate.) – Ulrich Schwarz Nov 16 '10 at 15:57
  • @UlrichSchwarz: thank you for this solution. How would I go about to also have a part* command (such that certain parts don't appear in the part ToC)? – GertVdE Nov 10 '15 at 12:35
  • 1
    @UlrichSchwarz this really solved my problem. I still want to go wild and do the fancy bits :-) – Jan Dec 9 '16 at 12:40
  • How to print the part counter in Roman? – Sigur Jun 26 at 19:26
4

Quoting from the beamer documentation, p. 98:

If you give a long talk (like a lecture), you may wish to break up your talk into several parts. Each such part acts like a little “talk of its own” with its own table of contents, its own navigation bars, and so on.

So I guess there is no "built-in" way to create a table of contents spanning several parts in beamer. IMO, you should reorganize your presentation so that former parts become sections and former sections subsections. (As for former subsections, p. 34 of the documentation states "Do not use subsubsections, they are evil", but you could even ignore that.)

  • I obeyed exactly this recommendation from the manual. I use a master document and include every part by \include due to flexibility reasons. Like @Tomik I think, I should do an outline overview about the different parts I will talk about. On every part, I automatically insert a frame with the detailed table of content of that part, as mentioned in your quote. So the only thing missing was the automatic generated outline for \part. Thanks to @UlrichSchwarz this was solved. :-) – Jan Dec 9 '16 at 12:38
3

Since beamer doesn't directly support parts in the table of contents, I would simply use an itemize environment to print out the list of parts.

If you really wish to copy the comfortable \tableofcontents way, you may build a separate TOC file for that using \addtocontents (could be done with \AtBeginPart{\addtocontents...}) and process it, similar to \beamer@tableofcontents in beamerbasetoc.sty. But that requires some programming, you may decide if it's worth the effort for just one document. Extensive presentations with many parts requiring a content frame, besides the existing sectioning structure, might not be very common.

  • I did the same. Yet I am thinking about a more elegant solution. – Tomik Nov 12 '10 at 19:01
  • I'm pretty sure this requires some programming... I'll edit above. – Stefan Kottwitz Nov 12 '10 at 19:57

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.