Presentation tools
Slide decks, “powerpoints”, beamer lore
June 1, 2015 — March 27, 2024
On tools for presentation.
1 Standard technology
The default options:
- Microsoft PowerPoint.
- Apple Keynote.
Both are a colossal waste of time, adding little to my research while sucking energy into a black hole of trying to care about niggly presentation and file type compatibility issues. Both, last time I looked, had a terrible mathematical equation typesetting workflow, although Keynote went beyond terrible to abysmal in this area. Admittedly, the last time I looked was 2011.
An alternative strategy might reuse the documentation, code, maths markup, and/or graphs from my actual research articles and code.
It turns out that this is not hard as such, merely harder than it should be. Read on for options.
Aside: I was going to try out the cloud-based Microsoft Sway which addresses some of my PowerPoint irritations. However, it also supports no mathematics, so it is once again a non-starter for me.
2 Quarto
My current preferred option. See quarto. It is similar to RMarkdown but with a more modern design and many bonus features.
3 RMarkdown slides
These are often secretly HTML slides, but that is more of an implementation detail. My current default choice. Supporting web display, mathematical markup, code, and dynamic interaction. Recommended. My preferred option for RMarkdown is outputting HTML slides, covered below, but it is also worth mentioning that it can output PDF slides, and crucially, PowerPoint.
3.1 RMarkdown to PowerPoint
RMarkdown will export to PowerPoint (thanks pandoc).
The main trick is the speaker notes, which look like this:
This is the same as reveal.js
but NOT the same as the speaker notes for remark.js
/xaringan
so switching between these is not seamless.
NB Mathematical markup is supported but not LaTeX macros of any kind.
Still, it is not too nasty.
3.2 RMarkdown HTML
RMarkdown renders to various HTML slides systems. A whole lot of backends are supported. A de facto standard is Reveal, which is the one I usually use.
It can be clunky (image and text side-by-side is painful), but it does the job.
Remark.js achieves support via xaringan, which is Yihui Xe’s favourite system. It has such luxuries as presenter notes and interactive style generator, although it has a slightly different syntax and parser so some stuff will format differently, or brokenly if you switch between reveal and remark.
My R IDE is VS Code rather than the more typical RStudio, so I use this script to launch the slide viewer for me:
#!/usr/bin/env Rscript
library(servr)
port=4000
cmdArgs = commandArgs(trailingOnly = TRUE)
if (length(cmdArgs>0)){
port = strtoi(cmdArgs[1])
}
servr::httw(port=port)
browseURL(paste("http://127.0.0.1:", port, sep="")
I save it in serve.R
and execute it as
The smart-ish web server will helpfully update the browser when I update the slides.
4 Mercury
Mercury allows you to add interactive widgets in Python notebooks, so you can share notebooks as web applications. Forget about rewriting notebooks to web frameworks just to share your results. Mercury offers a set of widgets with simple re-execution of cells.
It is implemented as a specialized jupyter front-end.
5 LaTeX slides
Beamer
, the LaTeX slide thingy, works. It is hard to do too exciting a design or even use a modern font but this in itself is perhaps a feature. It lends a certain reassurance to the audience that you are performing the rituals of academia in a Right and Proper fashion by using signifiers of the 80s.
Note that BibTeX does not work with beamer. BibLaTeX, by contrast, seems to.
Fun fact: Knitr does support beamer slides too, although why would you want to do that? “Combine the expressiveness of markdown with the simplicity of LaTeX” sounds to me like trolling.
There is no hope of making beamer match my corporate style guide in any sensible timeframe, but I could choose the closest approximation by looking at the example theme matrix. OTOH, who actually meets corporate style guidelines? No academic I know at any academic conference I have been to.
6 Native PDF slides
Generate a PDF using my choice of PDF technology. Display the PDF in presentation mode using my choice of PDF viewer. Reasonably universal. Not so many conveniences.
AFAICT this cannot play multimedia stuff in any robust way.
6.1 Scribus
Scribus is a good open source desktop publisher system (think InDesign, but free, but also occasionally broken.) I discovered it while writing posters, but it has many features to recommend it for other PDFs also, including an adequate in-built LaTeX math renderer and good support for vector graphics, and it will even render arbitrary graphs from weird command-line software automagically via render frames
.
7 HTML slides
HTML slides are powerful because they can leverage all the powers of web browsers, which are indeed a powerful execution platform these days, and a ubiquitous one. Many of the systems mentioned above output to HTML slides, but you can also use them bareback, writing plain HTML. I have done that and it is not too hard.
Pros
- Free
- Can include animated GIFs and other crap I found on the internet
- slides are more-or-less self-formatting
- easy to automatically generate slides from my statistical software.
They have shortcomings — my two main ones are that
- some formatting is not drag-and-droppable and dicking around with CSS to get formatting right is neither fun nor easy
- sometimes I accidentally include a resource from the internet then need to give a presentation in some office where I cannot access the internet.
A useful tool for HTML slides is decktape: PDF exporter for HTML presentations. This also works to remedy that last shortcoming.
reveal.js and remark.js are the best I have tried. Reveal.js
seems more popular, although a little over-engineered. There are many additional options listed below.
7.1 Reveal.js
reveal.js is the poster child for HTML slides. The online editor makes it easier to collaborate with my non-HTML-nerd colleagues.
- Git source code
- It has a GUI theme editor.
- There is a commercial spinoff GUI slide editor slides.com.
- jupyter notebooks support reveal.js.
- Note that Rmarkdown supports reveal.js.
Creating themes seems to require you to fork reveal’s GitHub repo for full generality, which feels a bit weird. Although in principle one can still just inject those CSS stylesheets as made famous by the web, right? Either way, in practice theming can be a rabbit hole of flex-box and responsive media queries.
If a PDF export is needed, an adequate method is as follows:
Presentations can be exported to PDF via a special print stylesheet.
Note: This feature has only been confirmed to work in Google Chrome and Chromium.
Instructions
- Open your presentation with print-pdf included in the query string, for example: http://localhost:8000/?print-pdf. You can test this at revealjs.com/demo?print-pdf.
- Open the in-browser print dialog (CTRL/CMD+P).
- Change the Destination setting to Save as PDF.
- Change the Layout to Landscape.
- Change the Margins to None.
- Enable the Background graphics option.
- Click Save
Alternatively, generic PDF exporter decktape also works.
See also sundry workflow notes.
Speaker notes require the following header configuration
Thereafter, either of these seem to work as notes:
For the speaker notes to work a local webserver is required — I use serve.R
above.
7.2 Remark.js
remark.js is mostly similar to Reveal.js, is a more minimalist maybe and a little tidier. For me mostly relevant as the backend for xaringan for R HTML slides. It was not immediately obvious what dialects of markdown are supported by remark.js
. (not pandoc!) Specifically it supports gfm and commonmark. The documentation for the former is superior.
7.3 Shower
Shower Presentation Engine IS a do-over for HTML slides.
It has more modern mathematics support and two-column mode. On the downside, it does not support speaker notes (unless you count mouseover footers.) It is also a backend to RMarkdown, via rmdshower
.
7.4 Other HTML slide systems
- The classic is Eric Meyer’s S5, although it’s showing its age. No longer recommended.
- Also foundational and elegant, but no longer maintained, deck.js …
- marp is an integrated markdown presentation writer
- MarkDeck - presentations as code promises good offline support
- impress.js does prezi-style fancy slide animations. Documentation is basic
- DZslides is not my favourite but worth mentioning because it’s used as a knitr example, although in fact one could better use S5 or, more modern still, reveal.js.
- an interactive tutorial on making interactive tutorials using d3.js (which would also work fine with
reveal.js
, presumably.) - wunderpresentation turns other things into presentations. For the moment, notably, trello.
8 Quarto
See quarto.
9 Jupyter
Jupyter supports reveal.js
HTML slide output. TBD.
9.1 RISE
In addition to the basic reveal.js integration, there is even a convenient (although slightly restricted) version of reveal available to display and interact with jupyter notebooks as slideshows via RISE.
Customisation of style etc for RISE:
- use nbextensions_configurator; this tool offers an interactive way to enable, disable and tweak all notebook extensions — see screenshot below;
- define settings in JSON files, typically by using Python scripts;
- you can also embed settings in a specific notebook’s metadata;
- and you can also provide your own CSS file(s), that can supersede styling of the various DOM pieces.
PDF export is clunky but works.
I have not used this for a while, but last time I found it annoying because Jupyter is already clunky. I do not need any additional clunk.