2.7 beamer slides (experimental)

A template is provided here on GitHub to produce HTML slides from beamer. The usage instructions are the same as for the main template (see Chapter 1).

The template contains a minimal working example with a few slides, which you can see rendered here in HTML. The sidebar with the list of slides can be toggled on and off using the “menu” button in the toolbar at the top of the page; you can also download the rendered PDF version of the slides by clicking on the PDF icon in the same toolbar.

The way it works is by setting the document class to article for the HTML version, and redefining the frame environment so that each frame becomes a subsection. Together with some appropriate CSS tweaks, we end up with an HTML document with one page per frame, which behaves likes slides.

This uses a slightly different preamble than the main template (see the file preamble/SoM_slides.tex), in particular to avoid errors with beamer commands such as \visible, \onslide, etc. Furthermore, your .tex files are copied, and search-and-replace is performed to remove beamer overlay specifications (e.g. <1-3>, <4>, <5->), and to handle some of the possible ways to specify frame titles (see the sed commands in .github/workflows/bookml.yaml if you’re not afraid of regular expressions).

There are some caveats, and it’s not as robust as the workflow for producing course materials. The below is not an exhaustive list, and any suggestions for solutions or workarounds are very welcome – please post an issue on GitHub (or email lt@maths.ed.ac.uk).

  • Any beamer settings or commands in your preamble must go in an \iflatexml\else ... \fi block, so that they don’t cause errors when rendering HTML.

  • If you already have \subsection commands in your slides, they will each produce their own separate slide.

  • Frames without a title must begin with \begin{frame}{}.

  • If you use \frametitle, it must be on the same line as \begin{frame}.

  • Frames without a title show up as the title of your document in the sidebar.

  • Multicolumn environments don’t work (yet!).

We would recommend starting with editing the main.tex file in the template and replacing the frames with your own, rather than trying to convert one of your existing source files as it is.