# Entire course with beamer

What, if any, support does beamer provide for making presentations that span more than one meeting. A case in point is a university course with 30 or so lecture hours, each with 20 or so frames, for a total of 600 slides.

Beamer does not seem to have the \chapter command, and, the it seems to ignore the \part command.

-
Beamer doesn't provide the command \chapter. However \part can be used. –  Marco Daniel Apr 22 '12 at 18:12
Well, \part of beamer is very different from \part of \LaTeX –  Yossi Gil Nov 9 '13 at 9:51

I use beamer for my lecture notes. A course will generally be one semester with 28 lectures, each 2hrs. As I do the full lecture as a presentation, a typical lecture can run to 100 pages in the PDF (maybe 20 frames). I keep all the lectures for a course in a single file for ease of consistency and the like.

Beamer provides "lectures" to break up a course. These are detailed in Section 10.4 of the manual. You can use the \AtBeginLecture command to insert a lecture title page.

The main problem with this is that in the normal course of things, TeX still processes the entire document but only outputs the frames corresponding to that lecture. This, for me, was a bit ridiculous as I have a lot of stuff and some of it is a bit heavy on the processing. Fine for the lecture concerned, but not for all the other lectures. So I did a bit of hacking, and came up with a system whereby beamer would skip over all of the stuff not in the current lecture. The idea is that certain of the beamer \mode commands would send TeX into a gobbling state so for the lectures we don't want, we go into that state. We merely reemerge each time a lecture is declared to check if it is the one we want or not.

In my lecture TeX file, each lecture starts with:

\mode
<all>
\lecture{Complex Numbers}{2012-01-10}


the first two lines take it out of gobbling mode. In one of my personal packages, I have the code:

  \g@addbefore@macro\beamer@atbeginlecture{
\begin{frame}[plain]
\LectureTitlePage
\end{frame}
\lecturemode
\newtheoremstyle{my@style@rmk}{3pt}{3pt}{\upshape}{}{\bfseries}{}{.5em}{}
\newtheoremstyle{my@style@def}{3pt}{3pt}{\upshape}{}{\bfseries}{}{.5em}{}
\newtheoremstyle{my@style@thm}{3pt}{3pt}{\upshape}{}{\bfseries}{}{.5em}{}
}


This adds a title page to every lecture, executes something called \lecturemode, and sets up theorem, definition, and remarks correctly (don't remember why I do that here and not at the start of the document). The lecture title page command is defined as:

\newcommand{\LectureTitlePage}{%
\global\def\inserttitle{{Lecture \insertlecturenumber: \insertlecture}}
\global\def\insertshorttitle{{Lecture \insertlecturenumber: \insertlecture}}
\global\def\insertdate{\lecturedate}
\global\def\insertshortdate{\lecturedate}
\titlepage
}


So it co-opts the normal beamer title page, setting the parameters to the correct values for the lecture. That means that I have a title page for the whole course and a lecture title page for a specific lecture. (\lecturedate is one of my macros as well. So if you cut-and-paste the above you'll need to provide that as well.)

\lecturemode is the key one. It is defined as:

\newcommand{\lecturemode}{%
\ifbeamer@inlecture
\else
\expandafter\mode\expandafter<\expandafter n\expandafter o\expandafter n\expandafter e\expandafter >\fi
}


(I wrote this before this site was in existence. I'm sure there are better ways to do this.) The \ifbeamer@inlecture is true if the \lecture command matched the lecture that we've declared ourselves to be interested in. So if we're not, we go into that gobbling mode. If we are, we proceed as normal.

With this (and I hope I've copied all of the relevant parts of the code! It is scattered in a few places), keeping all my lecture notes in one file becomes not only feasible but a considerable saving in time and effort.

The icing on the cake is that my file is called lectures.tex but I never process that directly. Instead, I have a load of symlinks that look like lecture.beamer.2012-04-24.tex and when I process that, I have some \jobname hackery (described in my answer to Changing LaTeX headers via a makefile) that looks at it, sees the beamer and the 2012-04-24 and produces the beamer version of the lecture that matches the date 2012-04-24.

You can see what the output looks like by looking at the Teaching part of my website. Admittedly, that doesn't show much of what goes into producing those notes, but it at least shows that the above scheme works.

-