I am in the course of composing a long beamer document, which should serve both as slides for class presentation and as a mini-textbook. My document includes about 600 slides, which are partitioned to sections, subsections, and subsubsections.

I use the article beamer mode for producing the handouts. In these I would like to present a list of frames for each subsection. Ideally, also for subsubsections. To this end, I found the beamer code for the frame environment in /usr/local/texlive/2014/texmf-dist/tex/latex/beamer/beamerbaseframe.sty:

% Frames in article mode

    \else% no slides in frame

    \usebeamertemplate{frame begin}%
    \usebeamertemplate{frame begin}%
    \usebeamertemplate{frame end}\egroup}



  \providecommand\includeonlyframes[1]{}% no effect

I would like hook into this code to produce:

  1. Numbering frames within each subsection
  2. Generating a list of frames for each subsection

I use minitoc for producing the per-section table of contents, so ideally, the solution would extend this use, or at least not interfere with it.

Any tips, ideas, or even a solution?

(Here is a related questions and answers: How to produce a list of frames with Beamer if frame titles have LaTeX tags in them? and here is another one: Is there any way to produce List of frames with beamer?)

  • 1
    Perhaps \AtBeginEnvironment{frame}{Your sophisticated code} from etoolbox will provide the hook? – user31729 Sep 20 '14 at 17:22
  • 2
    Please show, what you already have or some dummy beamer file with some subsections/frames etc. – user31729 Sep 20 '14 at 17:26
  • Does *Numbering frames within each subsection` mean, that the framenumber should be reset with a new subsection? – user31729 Sep 20 '14 at 17:37
  • Yes, within a subsection. – Yossi Gil Sep 20 '14 at 19:03
  • 2
    Add \makeatletter\@addtoreset{framenumber}{subsection}\makeatother to the preamble -- it will reset the framenumber then after every new subsection – user31729 Sep 20 '14 at 19:04

As it turns out, this question sheds its light at the wrong corner. Hooking into the the frame environment is the equivalent of banging your had into the wall, when beamer provides a simple interface for doing it, as in e.g.,


To so it is useful to examine the previous contents of the template, as explained here: "Examining the current value of a beamertemplate".

To restrict changes to the article mode, wrap the above in a \mode<>, e.g.,


You can also use \addtobeamertemplate which adds to the current value of the template, but for purposes such as described in question, such a change would not be sufficient.

Other dead-end directions include:

  • package minitoc: this package cannot generate contents of subsections
  • package titletoc: this package does not play well with hyperref

Seems as if the solution has to be done by hand; package newfile may be of use 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.