Racket's slideshow: The slideshow is a program

2016/02/14

I’m a scientist, and I make a fair number of presentations. I’m also a writing/communications coach, so I’ve thought a lot about what I want my slides to look like. I’m picky. I’m also a fan of computers: most of my work is bioinformatics or modeling, so I spend a lot of my time with a lot of different computing languages and frameworks, which has made me even more picky.

Today I’m pointing my pickiness at slideshows.

Part 1: In which I complain about PowerPoint

To my mind, there are a few nice things about making your slideshow in something like PowerPoint:

The other side of that coin is, to me, very ugly:

Part II: In which I dream of a better life

If I could have my way, I would have a slideshow framework in which I can:

If you’ve used LaTeX (or markdown), you might already be sensing that I want to separate the finished product from the “content”, that is, that I don’t want a WYSIWYG.

Part III: In which I mostly rave about slideshow

I couldn’t help but riff on Matthew Butterick’s “the book is a program” when I got familiar with Racket’s slideshow.

If you’re a programmer of any sort, you can appreciate the basic elements of slideshow: you issue some commands that constitute the contents of the slideshow. You’d write some code that says, “OK, start a new slide, and give it such-and-such title, and put such-and-such things in it.” That’s what slideshow does, only it looks a little funny to most programmers, since it’s written in racket, which is a Lisp dialect:

(slide #:title "The main point of the slide"
  (para "You might need to start with an idea...")
  (item "and back it up")
  (item "with some bullets"))

The nice things here are that the content is either text or filenames that point to the relevant images. You can see evidence of that in a recent talk I gave in my department. (And note, that link is a github repository, and you can just read the code!) The file might look a little scary, since I put in a bunch of little widgets that will adjust how the slides look, how I make the images appear, and so on.

Part IV: In which I offer some stuff to the slideshow world

In making this slideshow, I was a little annoyed by the design cycle. I’m particular about my slides: I want to spacing to look just right, the images to be just the right size, etc. When I made a change, I had to fire up slideshow (Cmd+R in DrRacket), go to my slide, then quit. I wanted something like what many LaTeX IDEs give you: a continuously updating, quick-and-dirty view into what the output will look like.

For that reason I made slide-watcher, a little Racket program that will make a small window (à la slideshow’s actual slideshow) that shows the slides in a file and that you can (crudely) navigate around in. The sweet bit is that the watches keeps a constant eye on the file, and if it changes, it will update the little display. This way you can get quick feedback on the results of your changes.

So now I can write some stuff and see it. first

Then if I make some changes, I just save it (I hit Cmd+S instinctively) and voilà, it shows up in my little window. second

Part V: In which I look forward and am ignorant

I would love for this little thingy to be a DrRacket plugin, but I think that’s a little above my racketeering paygrade yet. I’m also trying to slap together a little racket program that will read some simple subset of markdown, parse it, and spit out the skeleton of a #lang slideshow slideshow.

If you think this is cool and you know more about Racket than me, please send along a message!