# 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:

• I know that other people have PowerPoint on their computers and can edit my slides.

• I have complete and straightforward control over every thing floating around in the slide, and I can immediately see what happens when I, say, resize a figure or push a textbox around.

• I can draw stuff by just clicking from little toolbars.

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

• Getting all my slides to look the same is a pain. It either requires figuring out the template thing (which I’ve always had trouble with) or carefully copying and pasting my ad hoc master slide.

• If I want to change something about all the slides, I have to change all the slides. (Maybe master templates would fix this.)

• I can’t diff my slides. If I make some changes, I can’t see what they were.

• Similarly, it’s hard to use version control with binary files like .pptx.

• I like to get my ideas down on paper (i.e., markdown) and then change them into slides. Because PowerPoint is a very complicated format, it would take me a very long time to figure out how to write a converter between the two. (This would probably be my best shot, but it’s in Python 2 and I’ve gone over to 3 and virtual environments give me a yak-shaving headache.)

• The stuff I can draw right in PowerPoint usually looks terrible. I either have to make a thousand clicks to get rid of the shadows under everything or, as I usually do, just fire up Illustrator and make a nice figure.

## 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:

• convert from my markdown notes to a slideshow,

• easily use diff and version control,

• easily transform the “look” of an entire slideshow at once,

• easily swap slides in and out between slideshows and get the “look” to match immediately, and

• give my brain some exercise.

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"
(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.

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

## 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!