Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 8 down vote accepted

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}
share|improve this answer
    
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
add comment

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.)

share|improve this answer
add comment

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.